text stringlengths 1 1.05M |
|---|
; Registers:
; RAW hazard
li a0, 1
addi a0, a0, 2
sw a0, 0(zero)
nop
nop
nop
nop
nop
; WAW hazard
li a0, 1
li a0, 2
sw a0, 4(zero)
nop
nop
nop
nop
nop
; WAR hazard
li a0, 1
nop
nop
nop
nop
nop
mv a1, a0
li a0, 2
sw a1, 8(zero)
nop
nop
nop
nop
nop
; Memory:
; RAW hazard (mem / mem)
li a0, 1
li a1, 0
nop
nop
nop
nop
nop
sw a0, 12(zero)
lw a1, 12(zero)
nop
nop
nop
nop
nop
sw a1, 12(zero)
li a0, 0
li a1, 0
nop
nop
nop
nop
nop
; RAW hazard (reg / mem)
li a0, 1
sw a0, 16(zero)
nop
nop
nop
nop
nop
; WAW hazard (mem / mem)
li a0, 1
li a1, 2
nop
nop
nop
nop
nop
sw a0, 20(zero)
sw a1, 20(zero)
nop
nop
nop
nop
nop
; WAR hazard (mem / mem)
li a0, 1
li a1, 2
sw a0, 24(zero)
nop
nop
nop
nop
nop
lw a0, 24(zero)
sw a1, 24(zero)
|
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd. 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 "KernelGenerator.h"
#include <backend/BackendContext.h>
#include <util/Utils.h>
#include "kernel/IfLayer.h"
#include "kernel/WhileLayer.h"
#include "kernel/PermuteLayer.h"
#include "exec/ExecutorBase.h"
namespace onert
{
namespace backend
{
namespace controlflow
{
KernelGenerator::KernelGenerator(const ir::Operands &operand_ctx,
const ir::Operations &operations_ctx)
: _operand_ctx{operand_ctx}, _operations_ctx{operations_ctx}, _tensor_builder_set{nullptr},
_executor_map{nullptr}
{
UNUSED_RELEASE(_operand_ctx);
UNUSED_RELEASE(_operations_ctx);
UNUSED_RELEASE(_tensor_builder_set);
UNUSED_RELEASE(_executor_map);
}
void KernelGenerator::visit(const ir::OpSequence &op_seq)
{
assert(!_return_fn_seq);
_return_fn_seq = std::make_unique<exec::FunctionSequence>();
for (const auto &op_idx : op_seq.operations())
{
const auto &node = _operations_ctx.at(op_idx);
node.accept(*this);
_return_fn_seq->append(releaseFunction());
}
}
void KernelGenerator::visit(const ir::operation::If &node)
{
const auto then_subg_index = node.param().then_subg_index;
const auto else_subg_index = node.param().else_subg_index;
std::vector<std::shared_ptr<backend::ITensor>> input_tensors;
for (const auto input_index : node.getInputs())
{
auto input_alloc = getTensor(input_index);
input_tensors.emplace_back(input_alloc);
}
std::vector<std::shared_ptr<backend::ITensor>> output_tensors;
exec::DynAllocInfoMap outputs_dyn_alloc_info;
for (const auto output_index : node.getOutputs())
{
auto output_alloc = getTensor(output_index);
output_tensors.emplace_back(output_alloc);
const auto output_tensor_builder = getTensorBuilder(output_index);
if (output_tensor_builder->supportDynamicTensor())
{
auto output_dyn_manager = output_tensor_builder->dynamicTensorManager();
outputs_dyn_alloc_info[output_alloc] = exec::DynAllocInfo{output_index, output_dyn_manager};
}
}
// IfLayer just set ExecutorMap instead of then and else executor to avoid complexity of
// creating executor recusively
const auto cond_tensor = input_tensors.front();
input_tensors.erase(input_tensors.begin());
auto fn = std::make_unique<::onert::backend::controlflow::kernel::IfLayer>(
cond_tensor, input_tensors, output_tensors, outputs_dyn_alloc_info, then_subg_index,
else_subg_index, _executor_map);
_return_fn = std::move(fn);
}
void KernelGenerator::visit(const ir::operation::Permute &node)
{
const auto output_index{node.getOutputs().at(0)};
const auto input_index{node.getInputs().at(0)};
// Add PermuteLayer
std::vector<std::shared_ptr<ITensor>> output_tensors{getTensor(output_index)};
std::vector<std::shared_ptr<ITensor>> input_tensors{getTensor(input_index)};
std::unordered_map<std::shared_ptr<ITensor>, exec::DynAllocInfo> outputs_dyn_alloc_info;
const auto output_tensor_builder = getTensorBuilder(output_index);
assert(output_tensor_builder != nullptr);
if (output_tensor_builder->supportDynamicTensor())
{
outputs_dyn_alloc_info[output_tensors.at(0)] =
exec::DynAllocInfo{output_index, output_tensor_builder->dynamicTensorManager()};
}
auto fn =
std::make_unique<kernel::PermuteLayer>(input_tensors, output_tensors, outputs_dyn_alloc_info);
_return_fn = std::move(fn);
}
void KernelGenerator::visit(const ir::operation::While &node)
{
const auto cond_subg_index = node.param().cond_subg_index;
const auto body_subg_index = node.param().body_subg_index;
// This op does not support input as a constant, because controlflow backend does not have
// TensorBuilder
std::vector<std::shared_ptr<backend::ITensor>> input_tensors;
for (const auto input_index : node.getInputs())
{
auto input_alloc = getTensor(input_index);
input_tensors.emplace_back(input_alloc);
}
std::vector<std::shared_ptr<backend::ITensor>> output_tensors;
std::unordered_map<std::shared_ptr<ITensor>, exec::DynAllocInfo> outputs_dyn_alloc_info;
for (const auto output_index : node.getOutputs())
{
auto output_alloc = getTensor(output_index);
output_tensors.emplace_back(output_alloc);
const auto output_tensor_builder = getTensorBuilder(output_index);
if (output_tensor_builder->supportDynamicTensor())
{
auto output_dyn_manager = output_tensor_builder->dynamicTensorManager();
outputs_dyn_alloc_info[output_alloc] = exec::DynAllocInfo{output_index, output_dyn_manager};
}
}
// WhileLayer just set ExecutorMap instead of cond and body executor to avoid complexity of
// creating executor recusively
auto fn = std::make_unique<::onert::backend::controlflow::kernel::WhileLayer>(
input_tensors, output_tensors, outputs_dyn_alloc_info, cond_subg_index, body_subg_index,
_executor_map);
_return_fn = std::move(fn);
}
std::shared_ptr<backend::ITensor> KernelGenerator::getTensor(const ir::OperandIndex &index)
{
std::shared_ptr<backend::ITensor> ret;
for (auto tensor_builder : _tensor_builder_set)
{
auto tensor = tensor_builder->tensorAt(index);
if (tensor)
{
ret = tensor;
break;
}
}
assert(ret != nullptr);
return ret;
}
std::shared_ptr<backend::ITensorBuilder>
KernelGenerator::getTensorBuilder(const ir::OperandIndex &index)
{
std::shared_ptr<backend::ITensorBuilder> ret;
for (auto tensor_builder : _tensor_builder_set)
{
auto tensor = tensor_builder->tensorAt(index);
if (tensor)
{
ret = tensor_builder;
break;
}
}
assert(ret != nullptr);
return ret;
}
} // namespace controlflow
} // namespace backend
} // namespace onert
|
; A036487: a(n) = floor((n^3)/2).
; 0,0,4,13,32,62,108,171,256,364,500,665,864,1098,1372,1687,2048,2456,2916,3429,4000,4630,5324,6083,6912,7812,8788,9841,10976,12194,13500,14895,16384,17968,19652,21437,23328,25326,27436,29659,32000,34460,37044,39753,42592,45562,48668,51911,55296,58824,62500,66325,70304,74438,78732,83187,87808,92596,97556,102689,108000,113490,119164,125023,131072,137312,143748,150381,157216,164254,171500,178955,186624,194508,202612,210937,219488,228266,237276,246519,256000,265720,275684,285893,296352,307062,318028
pow $0,3
div $0,2
|
.include "myTiny13.h"
;irq Vector
.org 0x0000
rjmp OnReset
.org 0x0006
rjmp TimerComp ; Timer-Compare Interrupt
.org 0x0010
TimerComp:
ldi A, 0b00010000 ; toggle Bit No. 4
in B, PINB
eor A, B
out PORTB, A
dec N ; N = N-1
brne TcEnd ; IF N == 0 then N = 255
ser N
TcEnd:
out OCR0A, N ; set N as new Compare for Timer IRQ
reti
.org 0x0030
OnReset:
sbi DDRB, 4 ; PortB4 is output
ldi A, 0b01000010 ; CTC - Clear Timer on Compare Mode
out TCCR0A, A
ldi A, 0b00000101 ; timer: count on every 1024 clock-ticks
out TCCR0B, A
ldi A, 0b00000100 ; enable timer-compare IRQ
out TIMSK0, A
sei ; IRQ allow
MainLoop:
nop
rjmp MainLoop
|
// 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.
#include "kudu/mini-cluster/mini_cluster.h"
#include <string>
#include <utility>
#include <glog/logging.h>
#include "kudu/gutil/strings/substitute.h"
#include "kudu/util/net/sockaddr.h"
#include "kudu/util/net/socket.h"
using std::string;
using std::unique_ptr;
using strings::Substitute;
namespace kudu {
namespace cluster {
string MiniCluster::GetBindIpForDaemonWithType(DaemonType type,
int index,
BindMode bind_mode) {
int idx;
// Partition the index space 'kServersMaxNum' into three portions, one for each
// daemon type, to get unique address. If a daemon index spans over the portion
// reserved for another type, then duplicate address can be generated. Though this
// should be enough for our current tests.
switch (type) {
case MASTER:
idx = kServersMaxNum - index;
break;
case TSERVER:
idx = index + 1;
break;
case EXTERNAL_SERVER:
idx = kServersMaxNum / 3 + index;
break;
default:
LOG(FATAL) << type;
}
return GetBindIpForDaemon(idx, bind_mode);
}
Status MiniCluster::ReserveDaemonSocket(DaemonType type,
int index,
BindMode bind_mode,
unique_ptr<Socket>* socket) {
string ip = GetBindIpForDaemonWithType(type, index, bind_mode);
Sockaddr sock_addr;
RETURN_NOT_OK(sock_addr.ParseString(ip, 0));
unique_ptr<Socket> sock(new Socket());
RETURN_NOT_OK(sock->Init(0));
RETURN_NOT_OK(sock->SetReuseAddr(true));
RETURN_NOT_OK(sock->SetReusePort(true));
RETURN_NOT_OK(sock->Bind(sock_addr));
*socket = std::move(sock);
return Status::OK();
}
} // namespace cluster
} // namespace kudu
|
; A247161: Dynamic Betting Game D(n,4,2).
; 1,2,4,5,6,8,9,11,12,13,16,17,18,20,21,22,24,25,27,28,29,32,33,34,36,37,38,40,41,43,44,45,48,49,50,52,53,54,56,57,59,60,61,64,65,66,68,69,70,72,73,75,76,77,80,81,82,84,85,86,88,89,91,92,93,96,97,98,100,101,102,104,105,107,108,109,112,113,114,116,117,118,120,121,123,124,125,128,129,130,132,133,134,136,137,139,140,141,144,145
mov $4,$0
sub $0,1
mov $2,4
mov $3,1
add $3,$0
mul $3,2
add $2,$3
add $3,$2
add $3,1
div $3,11
mov $1,$3
lpb $0
div $0,2
div $3,4
add $1,$3
mov $3,2
lpe
add $1,1
add $1,$4
mov $0,$1
|
//
// Created by Rakesh on 17/05/2020.
//
#include "poller.h"
#include "queuemanager.h"
#include "log/NanoLog.h"
#include "model/configuration.h"
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/uri.hpp>
#include <chrono>
namespace spt::queue::poller
{
struct MongoClient
{
explicit MongoClient( const model::Configuration& configuration ) :
database{ configuration.metricsDatabase },
collection{ configuration.metricsCollection },
client{ std::make_unique<mongocxx::client>( mongocxx::uri{ configuration.mongoUri } ) }
{
LOG_INFO << "Connected to mongo";
mongocxx::write_concern wc;
wc.acknowledge_level( mongocxx::write_concern::level::k_unacknowledged );
opts.write_concern( std::move( wc ) );
}
void save( const model::Metric& metric )
{
const auto bson = metric.bson();
const auto view = bson.view();
try
{
(*client)[database][collection].insert_one( view, opts );
}
catch ( const std::exception& ex )
{
LOG_CRIT << "Error saving metric. " << bsoncxx::to_json( view ) << ". " << ex.what();
}
}
private:
mongocxx::options::insert opts;
std::string database;
std::string collection;
std::unique_ptr<mongocxx::client> client = nullptr;
};
}
using spt::queue::Poller;
Poller::Poller() = default;
Poller::~Poller() = default;
void Poller::run()
{
const auto& configuration = model::Configuration::instance();
mongo = std::make_unique<poller::MongoClient>( configuration );
running.store( true );
LOG_INFO << "Metrics queue monitor starting";
while ( running.load() )
{
try
{
loop();
}
catch ( const std::exception& ex )
{
LOG_WARN << "Error monitoring metrics queue. " << ex.what();
}
}
LOG_INFO << "Processed " << count << " total metrics from queue";
}
void spt::queue::Poller::stop()
{
running.store( false );
LOG_INFO << "Stop requested";
}
void Poller::loop()
{
auto& queue = QueueManager::instance();
auto metric = model::Metric{};
while ( queue.consume( metric ) )
{
mongo->save( metric );
if ( ( ++count % 100 ) == 0 ) LOG_INFO << "Published " << count << " metrics to database.";
}
if ( running.load() ) std::this_thread::sleep_for( std::chrono::seconds( 1 ) );
}
|
_mkdir: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: bf 01 00 00 00 mov $0x1,%edi
16: 83 ec 08 sub $0x8,%esp
19: 8b 31 mov (%ecx),%esi
1b: 8b 59 04 mov 0x4(%ecx),%ebx
1e: 83 c3 04 add $0x4,%ebx
int i;
if(argc < 2){
21: 83 fe 01 cmp $0x1,%esi
24: 7e 3e jle 64 <main+0x64>
26: 8d 76 00 lea 0x0(%esi),%esi
29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
printf(2, "Usage: mkdir files...\n");
exit();
}
for(i = 1; i < argc; i++){
if(mkdir(argv[i]) < 0){
30: 83 ec 0c sub $0xc,%esp
33: ff 33 pushl (%ebx)
35: e8 00 03 00 00 call 33a <mkdir>
3a: 83 c4 10 add $0x10,%esp
3d: 85 c0 test %eax,%eax
3f: 78 0f js 50 <main+0x50>
for(i = 1; i < argc; i++){
41: 83 c7 01 add $0x1,%edi
44: 83 c3 04 add $0x4,%ebx
47: 39 fe cmp %edi,%esi
49: 75 e5 jne 30 <main+0x30>
printf(2, "mkdir: %s failed to create\n", argv[i]);
break;
}
}
exit();
4b: e8 82 02 00 00 call 2d2 <exit>
printf(2, "mkdir: %s failed to create\n", argv[i]);
50: 50 push %eax
51: ff 33 pushl (%ebx)
53: 68 9f 07 00 00 push $0x79f
58: 6a 02 push $0x2
5a: e8 d1 03 00 00 call 430 <printf>
break;
5f: 83 c4 10 add $0x10,%esp
62: eb e7 jmp 4b <main+0x4b>
printf(2, "Usage: mkdir files...\n");
64: 52 push %edx
65: 52 push %edx
66: 68 88 07 00 00 push $0x788
6b: 6a 02 push $0x2
6d: e8 be 03 00 00 call 430 <printf>
exit();
72: e8 5b 02 00 00 call 2d2 <exit>
77: 66 90 xchg %ax,%ax
79: 66 90 xchg %ax,%ax
7b: 66 90 xchg %ax,%ax
7d: 66 90 xchg %ax,%ax
7f: 90 nop
00000080 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
80: 55 push %ebp
81: 89 e5 mov %esp,%ebp
83: 53 push %ebx
84: 8b 45 08 mov 0x8(%ebp),%eax
87: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
8a: 89 c2 mov %eax,%edx
8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
90: 83 c1 01 add $0x1,%ecx
93: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
97: 83 c2 01 add $0x1,%edx
9a: 84 db test %bl,%bl
9c: 88 5a ff mov %bl,-0x1(%edx)
9f: 75 ef jne 90 <strcpy+0x10>
;
return os;
}
a1: 5b pop %ebx
a2: 5d pop %ebp
a3: c3 ret
a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000000b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
b0: 55 push %ebp
b1: 89 e5 mov %esp,%ebp
b3: 53 push %ebx
b4: 8b 55 08 mov 0x8(%ebp),%edx
b7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
ba: 0f b6 02 movzbl (%edx),%eax
bd: 0f b6 19 movzbl (%ecx),%ebx
c0: 84 c0 test %al,%al
c2: 75 1c jne e0 <strcmp+0x30>
c4: eb 2a jmp f0 <strcmp+0x40>
c6: 8d 76 00 lea 0x0(%esi),%esi
c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
d0: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
d3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
d6: 83 c1 01 add $0x1,%ecx
d9: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
dc: 84 c0 test %al,%al
de: 74 10 je f0 <strcmp+0x40>
e0: 38 d8 cmp %bl,%al
e2: 74 ec je d0 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
e4: 29 d8 sub %ebx,%eax
}
e6: 5b pop %ebx
e7: 5d pop %ebp
e8: c3 ret
e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
f0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
f2: 29 d8 sub %ebx,%eax
}
f4: 5b pop %ebx
f5: 5d pop %ebp
f6: c3 ret
f7: 89 f6 mov %esi,%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <strlen>:
uint
strlen(const char *s)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
106: 80 39 00 cmpb $0x0,(%ecx)
109: 74 15 je 120 <strlen+0x20>
10b: 31 d2 xor %edx,%edx
10d: 8d 76 00 lea 0x0(%esi),%esi
110: 83 c2 01 add $0x1,%edx
113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
117: 89 d0 mov %edx,%eax
119: 75 f5 jne 110 <strlen+0x10>
;
return n;
}
11b: 5d pop %ebp
11c: c3 ret
11d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
120: 31 c0 xor %eax,%eax
}
122: 5d pop %ebp
123: c3 ret
124: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
12a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000130 <memset>:
void*
memset(void *dst, int c, uint n)
{
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 57 push %edi
134: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
137: 8b 4d 10 mov 0x10(%ebp),%ecx
13a: 8b 45 0c mov 0xc(%ebp),%eax
13d: 89 d7 mov %edx,%edi
13f: fc cld
140: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
142: 89 d0 mov %edx,%eax
144: 5f pop %edi
145: 5d pop %ebp
146: c3 ret
147: 89 f6 mov %esi,%esi
149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000150 <strchr>:
char*
strchr(const char *s, char c)
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 53 push %ebx
154: 8b 45 08 mov 0x8(%ebp),%eax
157: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
15a: 0f b6 10 movzbl (%eax),%edx
15d: 84 d2 test %dl,%dl
15f: 74 1d je 17e <strchr+0x2e>
if(*s == c)
161: 38 d3 cmp %dl,%bl
163: 89 d9 mov %ebx,%ecx
165: 75 0d jne 174 <strchr+0x24>
167: eb 17 jmp 180 <strchr+0x30>
169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
170: 38 ca cmp %cl,%dl
172: 74 0c je 180 <strchr+0x30>
for(; *s; s++)
174: 83 c0 01 add $0x1,%eax
177: 0f b6 10 movzbl (%eax),%edx
17a: 84 d2 test %dl,%dl
17c: 75 f2 jne 170 <strchr+0x20>
return (char*)s;
return 0;
17e: 31 c0 xor %eax,%eax
}
180: 5b pop %ebx
181: 5d pop %ebp
182: c3 ret
183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000190 <gets>:
char*
gets(char *buf, int max)
{
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
193: 57 push %edi
194: 56 push %esi
195: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
196: 31 f6 xor %esi,%esi
198: 89 f3 mov %esi,%ebx
{
19a: 83 ec 1c sub $0x1c,%esp
19d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
1a0: eb 2f jmp 1d1 <gets+0x41>
1a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
1a8: 8d 45 e7 lea -0x19(%ebp),%eax
1ab: 83 ec 04 sub $0x4,%esp
1ae: 6a 01 push $0x1
1b0: 50 push %eax
1b1: 6a 00 push $0x0
1b3: e8 32 01 00 00 call 2ea <read>
if(cc < 1)
1b8: 83 c4 10 add $0x10,%esp
1bb: 85 c0 test %eax,%eax
1bd: 7e 1c jle 1db <gets+0x4b>
break;
buf[i++] = c;
1bf: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
1c3: 83 c7 01 add $0x1,%edi
1c6: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
1c9: 3c 0a cmp $0xa,%al
1cb: 74 23 je 1f0 <gets+0x60>
1cd: 3c 0d cmp $0xd,%al
1cf: 74 1f je 1f0 <gets+0x60>
for(i=0; i+1 < max; ){
1d1: 83 c3 01 add $0x1,%ebx
1d4: 3b 5d 0c cmp 0xc(%ebp),%ebx
1d7: 89 fe mov %edi,%esi
1d9: 7c cd jl 1a8 <gets+0x18>
1db: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
1dd: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
1e0: c6 03 00 movb $0x0,(%ebx)
}
1e3: 8d 65 f4 lea -0xc(%ebp),%esp
1e6: 5b pop %ebx
1e7: 5e pop %esi
1e8: 5f pop %edi
1e9: 5d pop %ebp
1ea: c3 ret
1eb: 90 nop
1ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1f0: 8b 75 08 mov 0x8(%ebp),%esi
1f3: 8b 45 08 mov 0x8(%ebp),%eax
1f6: 01 de add %ebx,%esi
1f8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1fa: c6 03 00 movb $0x0,(%ebx)
}
1fd: 8d 65 f4 lea -0xc(%ebp),%esp
200: 5b pop %ebx
201: 5e pop %esi
202: 5f pop %edi
203: 5d pop %ebp
204: c3 ret
205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000210 <stat>:
int
stat(const char *n, struct stat *st)
{
210: 55 push %ebp
211: 89 e5 mov %esp,%ebp
213: 56 push %esi
214: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
215: 83 ec 08 sub $0x8,%esp
218: 6a 00 push $0x0
21a: ff 75 08 pushl 0x8(%ebp)
21d: e8 f0 00 00 00 call 312 <open>
if(fd < 0)
222: 83 c4 10 add $0x10,%esp
225: 85 c0 test %eax,%eax
227: 78 27 js 250 <stat+0x40>
return -1;
r = fstat(fd, st);
229: 83 ec 08 sub $0x8,%esp
22c: ff 75 0c pushl 0xc(%ebp)
22f: 89 c3 mov %eax,%ebx
231: 50 push %eax
232: e8 f3 00 00 00 call 32a <fstat>
close(fd);
237: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
23a: 89 c6 mov %eax,%esi
close(fd);
23c: e8 b9 00 00 00 call 2fa <close>
return r;
241: 83 c4 10 add $0x10,%esp
}
244: 8d 65 f8 lea -0x8(%ebp),%esp
247: 89 f0 mov %esi,%eax
249: 5b pop %ebx
24a: 5e pop %esi
24b: 5d pop %ebp
24c: c3 ret
24d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
250: be ff ff ff ff mov $0xffffffff,%esi
255: eb ed jmp 244 <stat+0x34>
257: 89 f6 mov %esi,%esi
259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000260 <atoi>:
int
atoi(const char *s)
{
260: 55 push %ebp
261: 89 e5 mov %esp,%ebp
263: 53 push %ebx
264: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
267: 0f be 11 movsbl (%ecx),%edx
26a: 8d 42 d0 lea -0x30(%edx),%eax
26d: 3c 09 cmp $0x9,%al
n = 0;
26f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
274: 77 1f ja 295 <atoi+0x35>
276: 8d 76 00 lea 0x0(%esi),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
280: 8d 04 80 lea (%eax,%eax,4),%eax
283: 83 c1 01 add $0x1,%ecx
286: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
28a: 0f be 11 movsbl (%ecx),%edx
28d: 8d 5a d0 lea -0x30(%edx),%ebx
290: 80 fb 09 cmp $0x9,%bl
293: 76 eb jbe 280 <atoi+0x20>
return n;
}
295: 5b pop %ebx
296: 5d pop %ebp
297: c3 ret
298: 90 nop
299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000002a0 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
2a0: 55 push %ebp
2a1: 89 e5 mov %esp,%ebp
2a3: 56 push %esi
2a4: 53 push %ebx
2a5: 8b 5d 10 mov 0x10(%ebp),%ebx
2a8: 8b 45 08 mov 0x8(%ebp),%eax
2ab: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2ae: 85 db test %ebx,%ebx
2b0: 7e 14 jle 2c6 <memmove+0x26>
2b2: 31 d2 xor %edx,%edx
2b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
2b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
2bc: 88 0c 10 mov %cl,(%eax,%edx,1)
2bf: 83 c2 01 add $0x1,%edx
while(n-- > 0)
2c2: 39 d3 cmp %edx,%ebx
2c4: 75 f2 jne 2b8 <memmove+0x18>
return vdst;
}
2c6: 5b pop %ebx
2c7: 5e pop %esi
2c8: 5d pop %ebp
2c9: c3 ret
000002ca <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2ca: b8 01 00 00 00 mov $0x1,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <exit>:
SYSCALL(exit)
2d2: b8 02 00 00 00 mov $0x2,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <wait>:
SYSCALL(wait)
2da: b8 03 00 00 00 mov $0x3,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <pipe>:
SYSCALL(pipe)
2e2: b8 04 00 00 00 mov $0x4,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <read>:
SYSCALL(read)
2ea: b8 05 00 00 00 mov $0x5,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <write>:
SYSCALL(write)
2f2: b8 10 00 00 00 mov $0x10,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <close>:
SYSCALL(close)
2fa: b8 15 00 00 00 mov $0x15,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <kill>:
SYSCALL(kill)
302: b8 06 00 00 00 mov $0x6,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <exec>:
SYSCALL(exec)
30a: b8 07 00 00 00 mov $0x7,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <open>:
SYSCALL(open)
312: b8 0f 00 00 00 mov $0xf,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <mknod>:
SYSCALL(mknod)
31a: b8 11 00 00 00 mov $0x11,%eax
31f: cd 40 int $0x40
321: c3 ret
00000322 <unlink>:
SYSCALL(unlink)
322: b8 12 00 00 00 mov $0x12,%eax
327: cd 40 int $0x40
329: c3 ret
0000032a <fstat>:
SYSCALL(fstat)
32a: b8 08 00 00 00 mov $0x8,%eax
32f: cd 40 int $0x40
331: c3 ret
00000332 <link>:
SYSCALL(link)
332: b8 13 00 00 00 mov $0x13,%eax
337: cd 40 int $0x40
339: c3 ret
0000033a <mkdir>:
SYSCALL(mkdir)
33a: b8 14 00 00 00 mov $0x14,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <chdir>:
SYSCALL(chdir)
342: b8 09 00 00 00 mov $0x9,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <dup>:
SYSCALL(dup)
34a: b8 0a 00 00 00 mov $0xa,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <getpid>:
SYSCALL(getpid)
352: b8 0b 00 00 00 mov $0xb,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <sbrk>:
SYSCALL(sbrk)
35a: b8 0c 00 00 00 mov $0xc,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <sleep>:
SYSCALL(sleep)
362: b8 0d 00 00 00 mov $0xd,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <uptime>:
SYSCALL(uptime)
36a: b8 0e 00 00 00 mov $0xe,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <cps>:
SYSCALL(cps)
372: b8 16 00 00 00 mov $0x16,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <date>:
SYSCALL(date)
37a: b8 17 00 00 00 mov $0x17,%eax
37f: cd 40 int $0x40
381: c3 ret
382: 66 90 xchg %ax,%ax
384: 66 90 xchg %ax,%ax
386: 66 90 xchg %ax,%ax
388: 66 90 xchg %ax,%ax
38a: 66 90 xchg %ax,%ax
38c: 66 90 xchg %ax,%ax
38e: 66 90 xchg %ax,%ax
00000390 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
390: 55 push %ebp
391: 89 e5 mov %esp,%ebp
393: 57 push %edi
394: 56 push %esi
395: 53 push %ebx
396: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
399: 85 d2 test %edx,%edx
{
39b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
39e: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
3a0: 79 76 jns 418 <printint+0x88>
3a2: f6 45 08 01 testb $0x1,0x8(%ebp)
3a6: 74 70 je 418 <printint+0x88>
x = -xx;
3a8: f7 d8 neg %eax
neg = 1;
3aa: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
3b1: 31 f6 xor %esi,%esi
3b3: 8d 5d d7 lea -0x29(%ebp),%ebx
3b6: eb 0a jmp 3c2 <printint+0x32>
3b8: 90 nop
3b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
3c0: 89 fe mov %edi,%esi
3c2: 31 d2 xor %edx,%edx
3c4: 8d 7e 01 lea 0x1(%esi),%edi
3c7: f7 f1 div %ecx
3c9: 0f b6 92 c4 07 00 00 movzbl 0x7c4(%edx),%edx
}while((x /= base) != 0);
3d0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
3d2: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
3d5: 75 e9 jne 3c0 <printint+0x30>
if(neg)
3d7: 8b 45 c4 mov -0x3c(%ebp),%eax
3da: 85 c0 test %eax,%eax
3dc: 74 08 je 3e6 <printint+0x56>
buf[i++] = '-';
3de: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
3e3: 8d 7e 02 lea 0x2(%esi),%edi
3e6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
3ea: 8b 7d c0 mov -0x40(%ebp),%edi
3ed: 8d 76 00 lea 0x0(%esi),%esi
3f0: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
3f3: 83 ec 04 sub $0x4,%esp
3f6: 83 ee 01 sub $0x1,%esi
3f9: 6a 01 push $0x1
3fb: 53 push %ebx
3fc: 57 push %edi
3fd: 88 45 d7 mov %al,-0x29(%ebp)
400: e8 ed fe ff ff call 2f2 <write>
while(--i >= 0)
405: 83 c4 10 add $0x10,%esp
408: 39 de cmp %ebx,%esi
40a: 75 e4 jne 3f0 <printint+0x60>
putc(fd, buf[i]);
}
40c: 8d 65 f4 lea -0xc(%ebp),%esp
40f: 5b pop %ebx
410: 5e pop %esi
411: 5f pop %edi
412: 5d pop %ebp
413: c3 ret
414: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
418: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
41f: eb 90 jmp 3b1 <printint+0x21>
421: eb 0d jmp 430 <printf>
423: 90 nop
424: 90 nop
425: 90 nop
426: 90 nop
427: 90 nop
428: 90 nop
429: 90 nop
42a: 90 nop
42b: 90 nop
42c: 90 nop
42d: 90 nop
42e: 90 nop
42f: 90 nop
00000430 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 57 push %edi
434: 56 push %esi
435: 53 push %ebx
436: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
439: 8b 75 0c mov 0xc(%ebp),%esi
43c: 0f b6 1e movzbl (%esi),%ebx
43f: 84 db test %bl,%bl
441: 0f 84 b3 00 00 00 je 4fa <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
447: 8d 45 10 lea 0x10(%ebp),%eax
44a: 83 c6 01 add $0x1,%esi
state = 0;
44d: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
44f: 89 45 d4 mov %eax,-0x2c(%ebp)
452: eb 2f jmp 483 <printf+0x53>
454: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
458: 83 f8 25 cmp $0x25,%eax
45b: 0f 84 a7 00 00 00 je 508 <printf+0xd8>
write(fd, &c, 1);
461: 8d 45 e2 lea -0x1e(%ebp),%eax
464: 83 ec 04 sub $0x4,%esp
467: 88 5d e2 mov %bl,-0x1e(%ebp)
46a: 6a 01 push $0x1
46c: 50 push %eax
46d: ff 75 08 pushl 0x8(%ebp)
470: e8 7d fe ff ff call 2f2 <write>
475: 83 c4 10 add $0x10,%esp
478: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
47b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
47f: 84 db test %bl,%bl
481: 74 77 je 4fa <printf+0xca>
if(state == 0){
483: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
485: 0f be cb movsbl %bl,%ecx
488: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
48b: 74 cb je 458 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
48d: 83 ff 25 cmp $0x25,%edi
490: 75 e6 jne 478 <printf+0x48>
if(c == 'd'){
492: 83 f8 64 cmp $0x64,%eax
495: 0f 84 05 01 00 00 je 5a0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
49b: 81 e1 f7 00 00 00 and $0xf7,%ecx
4a1: 83 f9 70 cmp $0x70,%ecx
4a4: 74 72 je 518 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
4a6: 83 f8 73 cmp $0x73,%eax
4a9: 0f 84 99 00 00 00 je 548 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
4af: 83 f8 63 cmp $0x63,%eax
4b2: 0f 84 08 01 00 00 je 5c0 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
4b8: 83 f8 25 cmp $0x25,%eax
4bb: 0f 84 ef 00 00 00 je 5b0 <printf+0x180>
write(fd, &c, 1);
4c1: 8d 45 e7 lea -0x19(%ebp),%eax
4c4: 83 ec 04 sub $0x4,%esp
4c7: c6 45 e7 25 movb $0x25,-0x19(%ebp)
4cb: 6a 01 push $0x1
4cd: 50 push %eax
4ce: ff 75 08 pushl 0x8(%ebp)
4d1: e8 1c fe ff ff call 2f2 <write>
4d6: 83 c4 0c add $0xc,%esp
4d9: 8d 45 e6 lea -0x1a(%ebp),%eax
4dc: 88 5d e6 mov %bl,-0x1a(%ebp)
4df: 6a 01 push $0x1
4e1: 50 push %eax
4e2: ff 75 08 pushl 0x8(%ebp)
4e5: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
4e8: 31 ff xor %edi,%edi
write(fd, &c, 1);
4ea: e8 03 fe ff ff call 2f2 <write>
for(i = 0; fmt[i]; i++){
4ef: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
4f3: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
4f6: 84 db test %bl,%bl
4f8: 75 89 jne 483 <printf+0x53>
}
}
}
4fa: 8d 65 f4 lea -0xc(%ebp),%esp
4fd: 5b pop %ebx
4fe: 5e pop %esi
4ff: 5f pop %edi
500: 5d pop %ebp
501: c3 ret
502: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
508: bf 25 00 00 00 mov $0x25,%edi
50d: e9 66 ff ff ff jmp 478 <printf+0x48>
512: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
518: 83 ec 0c sub $0xc,%esp
51b: b9 10 00 00 00 mov $0x10,%ecx
520: 6a 00 push $0x0
522: 8b 7d d4 mov -0x2c(%ebp),%edi
525: 8b 45 08 mov 0x8(%ebp),%eax
528: 8b 17 mov (%edi),%edx
52a: e8 61 fe ff ff call 390 <printint>
ap++;
52f: 89 f8 mov %edi,%eax
531: 83 c4 10 add $0x10,%esp
state = 0;
534: 31 ff xor %edi,%edi
ap++;
536: 83 c0 04 add $0x4,%eax
539: 89 45 d4 mov %eax,-0x2c(%ebp)
53c: e9 37 ff ff ff jmp 478 <printf+0x48>
541: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
548: 8b 45 d4 mov -0x2c(%ebp),%eax
54b: 8b 08 mov (%eax),%ecx
ap++;
54d: 83 c0 04 add $0x4,%eax
550: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
553: 85 c9 test %ecx,%ecx
555: 0f 84 8e 00 00 00 je 5e9 <printf+0x1b9>
while(*s != 0){
55b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
55e: 31 ff xor %edi,%edi
s = (char*)*ap;
560: 89 cb mov %ecx,%ebx
while(*s != 0){
562: 84 c0 test %al,%al
564: 0f 84 0e ff ff ff je 478 <printf+0x48>
56a: 89 75 d0 mov %esi,-0x30(%ebp)
56d: 89 de mov %ebx,%esi
56f: 8b 5d 08 mov 0x8(%ebp),%ebx
572: 8d 7d e3 lea -0x1d(%ebp),%edi
575: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
578: 83 ec 04 sub $0x4,%esp
s++;
57b: 83 c6 01 add $0x1,%esi
57e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
581: 6a 01 push $0x1
583: 57 push %edi
584: 53 push %ebx
585: e8 68 fd ff ff call 2f2 <write>
while(*s != 0){
58a: 0f b6 06 movzbl (%esi),%eax
58d: 83 c4 10 add $0x10,%esp
590: 84 c0 test %al,%al
592: 75 e4 jne 578 <printf+0x148>
594: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
597: 31 ff xor %edi,%edi
599: e9 da fe ff ff jmp 478 <printf+0x48>
59e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
5a0: 83 ec 0c sub $0xc,%esp
5a3: b9 0a 00 00 00 mov $0xa,%ecx
5a8: 6a 01 push $0x1
5aa: e9 73 ff ff ff jmp 522 <printf+0xf2>
5af: 90 nop
write(fd, &c, 1);
5b0: 83 ec 04 sub $0x4,%esp
5b3: 88 5d e5 mov %bl,-0x1b(%ebp)
5b6: 8d 45 e5 lea -0x1b(%ebp),%eax
5b9: 6a 01 push $0x1
5bb: e9 21 ff ff ff jmp 4e1 <printf+0xb1>
putc(fd, *ap);
5c0: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
5c3: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
5c6: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
5c8: 6a 01 push $0x1
ap++;
5ca: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
5cd: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
5d0: 8d 45 e4 lea -0x1c(%ebp),%eax
5d3: 50 push %eax
5d4: ff 75 08 pushl 0x8(%ebp)
5d7: e8 16 fd ff ff call 2f2 <write>
ap++;
5dc: 89 7d d4 mov %edi,-0x2c(%ebp)
5df: 83 c4 10 add $0x10,%esp
state = 0;
5e2: 31 ff xor %edi,%edi
5e4: e9 8f fe ff ff jmp 478 <printf+0x48>
s = "(null)";
5e9: bb bb 07 00 00 mov $0x7bb,%ebx
while(*s != 0){
5ee: b8 28 00 00 00 mov $0x28,%eax
5f3: e9 72 ff ff ff jmp 56a <printf+0x13a>
5f8: 66 90 xchg %ax,%ax
5fa: 66 90 xchg %ax,%ax
5fc: 66 90 xchg %ax,%ax
5fe: 66 90 xchg %ax,%ax
00000600 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
600: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
601: a1 74 0a 00 00 mov 0xa74,%eax
{
606: 89 e5 mov %esp,%ebp
608: 57 push %edi
609: 56 push %esi
60a: 53 push %ebx
60b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
60e: 8d 4b f8 lea -0x8(%ebx),%ecx
611: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
618: 39 c8 cmp %ecx,%eax
61a: 8b 10 mov (%eax),%edx
61c: 73 32 jae 650 <free+0x50>
61e: 39 d1 cmp %edx,%ecx
620: 72 04 jb 626 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
622: 39 d0 cmp %edx,%eax
624: 72 32 jb 658 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
626: 8b 73 fc mov -0x4(%ebx),%esi
629: 8d 3c f1 lea (%ecx,%esi,8),%edi
62c: 39 fa cmp %edi,%edx
62e: 74 30 je 660 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
630: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
633: 8b 50 04 mov 0x4(%eax),%edx
636: 8d 34 d0 lea (%eax,%edx,8),%esi
639: 39 f1 cmp %esi,%ecx
63b: 74 3a je 677 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
63d: 89 08 mov %ecx,(%eax)
freep = p;
63f: a3 74 0a 00 00 mov %eax,0xa74
}
644: 5b pop %ebx
645: 5e pop %esi
646: 5f pop %edi
647: 5d pop %ebp
648: c3 ret
649: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
650: 39 d0 cmp %edx,%eax
652: 72 04 jb 658 <free+0x58>
654: 39 d1 cmp %edx,%ecx
656: 72 ce jb 626 <free+0x26>
{
658: 89 d0 mov %edx,%eax
65a: eb bc jmp 618 <free+0x18>
65c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
660: 03 72 04 add 0x4(%edx),%esi
663: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
666: 8b 10 mov (%eax),%edx
668: 8b 12 mov (%edx),%edx
66a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
66d: 8b 50 04 mov 0x4(%eax),%edx
670: 8d 34 d0 lea (%eax,%edx,8),%esi
673: 39 f1 cmp %esi,%ecx
675: 75 c6 jne 63d <free+0x3d>
p->s.size += bp->s.size;
677: 03 53 fc add -0x4(%ebx),%edx
freep = p;
67a: a3 74 0a 00 00 mov %eax,0xa74
p->s.size += bp->s.size;
67f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
682: 8b 53 f8 mov -0x8(%ebx),%edx
685: 89 10 mov %edx,(%eax)
}
687: 5b pop %ebx
688: 5e pop %esi
689: 5f pop %edi
68a: 5d pop %ebp
68b: c3 ret
68c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000690 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
690: 55 push %ebp
691: 89 e5 mov %esp,%ebp
693: 57 push %edi
694: 56 push %esi
695: 53 push %ebx
696: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
699: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
69c: 8b 15 74 0a 00 00 mov 0xa74,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
6a2: 8d 78 07 lea 0x7(%eax),%edi
6a5: c1 ef 03 shr $0x3,%edi
6a8: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
6ab: 85 d2 test %edx,%edx
6ad: 0f 84 9d 00 00 00 je 750 <malloc+0xc0>
6b3: 8b 02 mov (%edx),%eax
6b5: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
6b8: 39 cf cmp %ecx,%edi
6ba: 76 6c jbe 728 <malloc+0x98>
6bc: 81 ff 00 10 00 00 cmp $0x1000,%edi
6c2: bb 00 10 00 00 mov $0x1000,%ebx
6c7: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
6ca: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
6d1: eb 0e jmp 6e1 <malloc+0x51>
6d3: 90 nop
6d4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
6d8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
6da: 8b 48 04 mov 0x4(%eax),%ecx
6dd: 39 f9 cmp %edi,%ecx
6df: 73 47 jae 728 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
6e1: 39 05 74 0a 00 00 cmp %eax,0xa74
6e7: 89 c2 mov %eax,%edx
6e9: 75 ed jne 6d8 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
6eb: 83 ec 0c sub $0xc,%esp
6ee: 56 push %esi
6ef: e8 66 fc ff ff call 35a <sbrk>
if(p == (char*)-1)
6f4: 83 c4 10 add $0x10,%esp
6f7: 83 f8 ff cmp $0xffffffff,%eax
6fa: 74 1c je 718 <malloc+0x88>
hp->s.size = nu;
6fc: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
6ff: 83 ec 0c sub $0xc,%esp
702: 83 c0 08 add $0x8,%eax
705: 50 push %eax
706: e8 f5 fe ff ff call 600 <free>
return freep;
70b: 8b 15 74 0a 00 00 mov 0xa74,%edx
if((p = morecore(nunits)) == 0)
711: 83 c4 10 add $0x10,%esp
714: 85 d2 test %edx,%edx
716: 75 c0 jne 6d8 <malloc+0x48>
return 0;
}
}
718: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
71b: 31 c0 xor %eax,%eax
}
71d: 5b pop %ebx
71e: 5e pop %esi
71f: 5f pop %edi
720: 5d pop %ebp
721: c3 ret
722: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
728: 39 cf cmp %ecx,%edi
72a: 74 54 je 780 <malloc+0xf0>
p->s.size -= nunits;
72c: 29 f9 sub %edi,%ecx
72e: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
731: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
734: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
737: 89 15 74 0a 00 00 mov %edx,0xa74
}
73d: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
740: 83 c0 08 add $0x8,%eax
}
743: 5b pop %ebx
744: 5e pop %esi
745: 5f pop %edi
746: 5d pop %ebp
747: c3 ret
748: 90 nop
749: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
750: c7 05 74 0a 00 00 78 movl $0xa78,0xa74
757: 0a 00 00
75a: c7 05 78 0a 00 00 78 movl $0xa78,0xa78
761: 0a 00 00
base.s.size = 0;
764: b8 78 0a 00 00 mov $0xa78,%eax
769: c7 05 7c 0a 00 00 00 movl $0x0,0xa7c
770: 00 00 00
773: e9 44 ff ff ff jmp 6bc <malloc+0x2c>
778: 90 nop
779: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
780: 8b 08 mov (%eax),%ecx
782: 89 0a mov %ecx,(%edx)
784: eb b1 jmp 737 <malloc+0xa7>
|
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
config.cpp
Abstract:
This module contains routines for the fax config dialog.
Author:
Wesley Witt (wesw) 13-Aug-1996
Revision History:
20/10/99 -danl-
Fix ConfigDlgProc to view proper printer properties.
dd/mm/yy -author-
description
--*/
#include "faxext.h"
#include "faxutil.h"
#include "faxreg.h"
#include "resource.h"
#include "debugex.h"
extern HINSTANCE g_hModule; // DLL handle
extern HINSTANCE g_hResource; // Resource DLL handle
VOID
AddCoverPagesToList(
HWND hwndList,
LPTSTR pDirPath,
BOOL ServerCoverPage
)
/*++
Routine Description:
Add the cover page files in the specified directory to a listbox
Arguments:
hwndList - Handle to a list window
pDirPath - Directory to look for coverpage files
ServerCoverPage - TRUE if the dir contains server cover pages
Return Value:
NONE
--*/
{
WIN32_FIND_DATA findData;
TCHAR tszDirName[MAX_PATH] = {0};
TCHAR CpName[MAX_PATH] = {0};
HANDLE hFindFile = INVALID_HANDLE_VALUE;
TCHAR tszFileName[MAX_PATH] = {0};
TCHAR tszPathName[MAX_PATH] = {0};
TCHAR* pPathEnd;
LPTSTR pExtension;
INT listIndex;
INT dirLen;
INT fileLen;
BOOL bGotFile = FALSE;
DBG_ENTER(TEXT("AddCoverPagesToList"));
//
// Copy the directory path to a local buffer
//
if (pDirPath == NULL || pDirPath[0] == 0)
{
return;
}
if ((dirLen = _tcslen( pDirPath )) >= MAX_PATH - MAX_FILENAME_EXT - 1)
{
return;
}
_tcscpy( tszDirName, pDirPath );
TCHAR* pLast = NULL;
pLast = _tcsrchr(tszDirName,TEXT('\\'));
if( !( pLast && (*_tcsinc(pLast)) == '\0' ) )
{
// the last character is not a backslash, add one...
_tcscat(tszDirName, TEXT("\\"));
dirLen += sizeof(TCHAR);
}
_tcsncpy(tszPathName, tszDirName, ARR_SIZE(tszPathName)-1);
pPathEnd = _tcschr(tszPathName, '\0');
TCHAR file_to_find[MAX_PATH] = {0};
_tcscpy(file_to_find,tszDirName);
_tcscat(file_to_find, FAX_COVER_PAGE_MASK );
//
// Call FindFirstFile/FindNextFile to enumerate the files
// matching our specification
//
hFindFile = FindFirstFile( file_to_find, &findData );
if (hFindFile == INVALID_HANDLE_VALUE)
{
CALL_FAIL(GENERAL_ERR, TEXT("FindFirstFile"), ::GetLastError());
bGotFile = FALSE;
}
else
{
bGotFile = TRUE;
}
while (bGotFile)
{
_tcsncpy(pPathEnd, findData.cFileName, MAX_PATH - dirLen);
if(!IsValidCoverPage(tszPathName))
{
goto next;
}
//
// Exclude directories and hidden files
//
if (findData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY))
{
continue;
}
//
// Make sure we have enough room to store the full pathname
//
if ((fileLen = _tcslen( findData.cFileName)) <= MAX_FILENAME_EXT )
{
continue;
}
if (fileLen + dirLen >= MAX_PATH)
{
continue;
}
//
// Add the cover page name to the list window,
// but don't display the filename extension
//
_tcscpy( CpName, findData.cFileName );
if (pExtension = _tcsrchr(CpName,TEXT('.')))
{
*pExtension = NULL;
}
if ( ! ServerCoverPage )
{
TCHAR szPersonal[30];
LoadString( g_hResource, IDS_PERSONAL, szPersonal, 30 );
_tcscat( CpName, TEXT(" "));
_tcscat( CpName, szPersonal );
}
listIndex = (INT)SendMessage(
hwndList,
LB_ADDSTRING,
0,
(LPARAM) CpName);
if (listIndex != LB_ERR)
{
SendMessage(hwndList,
LB_SETITEMDATA,
listIndex,
ServerCoverPage ? SERVER_COVER_PAGE : 0);
}
next:
bGotFile = FindNextFile(hFindFile, &findData);
if (! bGotFile)
{
VERBOSE(DBG_MSG, TEXT("FindNextFile"), ::GetLastError());
break;
}
}
if(INVALID_HANDLE_VALUE != hFindFile)
{
FindClose(hFindFile);
}
}
void EnableCoverPageList(HWND hDlg)
{
DBG_ENTER(TEXT("EnableCoverPageList"));
if (IsDlgButtonChecked( hDlg, IDC_USE_COVERPAGE ) == BST_CHECKED)
{
EnableWindow( GetDlgItem( hDlg, IDC_COVERPAGE_LIST ), TRUE );
EnableWindow( GetDlgItem( hDlg, IDC_STATIC_COVERPAGE ), TRUE );
}
else
{
EnableWindow( GetDlgItem( hDlg, IDC_COVERPAGE_LIST ), FALSE );
EnableWindow( GetDlgItem( hDlg, IDC_STATIC_COVERPAGE ), FALSE );
}
}
INT_PTR CALLBACK
ConfigDlgProc(
HWND hDlg,
UINT message,
WPARAM wParam,
LPARAM lParam
)
/*++
Routine Description:
Dialog procedure for the fax mail transport configuration
Arguments:
hDlg - Window handle for this dialog
message - Message number
wParam - Parameter #1
lParam - Parameter #2
Return Value:
TRUE - Message was handled
FALSE - Message was NOT handled
--*/
{
static PFAXXP_CONFIG FaxConfig = NULL;
static HWND hwndListPrn = NULL;
static HWND hwndListCov = NULL;
PPRINTER_INFO_2 PrinterInfo = NULL;
DWORD CountPrinters = 0;
DWORD dwSelectedItem = 0;
DWORD dwNewSelectedItem = 0;
TCHAR Buffer [256] = {0};
TCHAR CpDir[MAX_PATH] = {0};
LPTSTR p = NULL;
HANDLE hFax = NULL;
DWORD dwError = 0;
DWORD dwMask = 0;
BOOL bShortCutCp = FALSE;
BOOL bGotFaxPrinter = FALSE;
BOOL bIsCpLink = FALSE;
DBG_ENTER(TEXT("ConfigDlgProc"));
switch( message )
{
case WM_INITDIALOG:
FaxConfig = (PFAXXP_CONFIG) lParam;
hwndListPrn = GetDlgItem( hDlg, IDC_PRINTER_LIST );
hwndListCov = GetDlgItem( hDlg, IDC_COVERPAGE_LIST );
//
// populate the printers combobox
//
PrinterInfo = (PPRINTER_INFO_2) MyEnumPrinters(NULL,
2,
&CountPrinters,
PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS);
if (NULL != PrinterInfo)
{
DWORD j = 0;
for (DWORD i=0; i < CountPrinters; i++)
{
if ((NULL != PrinterInfo[i].pDriverName) &&
(_tcscmp( PrinterInfo[i].pDriverName, FAX_DRIVER_NAME ) == 0))
{
//
//if the current printer is a fax printer, add it to the CB list
//
bGotFaxPrinter = TRUE;
SendMessage( hwndListPrn, CB_ADDSTRING, 0, (LPARAM) PrinterInfo[i].pPrinterName );
if ((NULL != FaxConfig->PrinterName) &&
(NULL != PrinterInfo[i].pPrinterName) &&
(_tcscmp( PrinterInfo[i].pPrinterName, FaxConfig->PrinterName ) == 0))
{
//
//if it is also the default printer according to transport config.
//place the default selection on it
//
dwSelectedItem = j;
}
if(FaxConfig->PrinterName == NULL || _tcslen(FaxConfig->PrinterName) == 0)
{
//
// There is no default fax printer
// Choose the first one
//
MemFree(FaxConfig->PrinterName);
FaxConfig->PrinterName = StringDup(PrinterInfo[i].pPrinterName);
if(FaxConfig->PrinterName == NULL)
{
CALL_FAIL(MEM_ERR, TEXT("StringDup"), ERROR_NOT_ENOUGH_MEMORY);
ErrorMsgBox(g_hResource, hDlg, IDS_NOT_ENOUGH_MEMORY);
EndDialog( hDlg, IDABORT);
return FALSE;
}
if(PrinterInfo[i].pServerName)
{
MemFree(FaxConfig->ServerName);
FaxConfig->ServerName = StringDup(PrinterInfo[i].pServerName);
if(FaxConfig->ServerName == NULL)
{
CALL_FAIL(MEM_ERR, TEXT("StringDup"), ERROR_NOT_ENOUGH_MEMORY);
ErrorMsgBox(g_hResource, hDlg, IDS_NOT_ENOUGH_MEMORY);
EndDialog( hDlg, IDABORT);
return FALSE;
}
}
dwSelectedItem = j;
}
j += 1;
} // if fax printer
} // for
MemFree( PrinterInfo );
PrinterInfo = NULL;
SendMessage( hwndListPrn, CB_SETCURSEL, (WPARAM)dwSelectedItem, 0 );
}
if (! bGotFaxPrinter)
{
//
// there were no printers at all, or non of the printers is a fax printer.
//
CALL_FAIL(GENERAL_ERR, TEXT("MyEnumPrinters"), ::GetLastError());
ErrorMsgBox(g_hResource, hDlg, IDS_NO_FAX_PRINTER);
EndDialog( hDlg, IDABORT);
break;
}
//
// Get the Server CP flag and receipts options
//
FaxConfig->ServerCpOnly = FALSE;
if (FaxConnectFaxServer(FaxConfig->ServerName, &hFax) )
{
DWORD dwReceiptOptions;
BOOL bEnableReceiptsCheckboxes = FALSE;
if(!FaxGetPersonalCoverPagesOption(hFax, &FaxConfig->ServerCpOnly))
{
CALL_FAIL(GENERAL_ERR, TEXT("FaxGetPersonalCoverPagesOption"), ::GetLastError());
ErrorMsgBox(g_hResource, hDlg, IDS_CANT_ACCESS_SERVER);
}
else
{
//
// Inverse logic
//
FaxConfig->ServerCpOnly = !FaxConfig->ServerCpOnly;
}
if (!FaxGetReceiptsOptions (hFax, &dwReceiptOptions))
{
CALL_FAIL(GENERAL_ERR, TEXT("FaxGetPersonalCoverPagesOption"), GetLastError());
}
else
{
if (DRT_EMAIL & dwReceiptOptions)
{
//
// Server supports receipts by email - enable the checkboxes
//
bEnableReceiptsCheckboxes = TRUE;
}
}
EnableWindow( GetDlgItem( hDlg, IDC_ATTACH_FAX), bEnableReceiptsCheckboxes);
EnableWindow( GetDlgItem( hDlg, IDC_SEND_SINGLE_RECEIPT), bEnableReceiptsCheckboxes);
FaxClose(hFax);
hFax = NULL;
}
else
{
CALL_FAIL(GENERAL_ERR, TEXT("FaxConnectFaxServer"), ::GetLastError())
ErrorMsgBox(g_hResource, hDlg, IDS_CANT_ACCESS_SERVER);
}
//
//send single receipt for a fax sent to multiple recipients?
//
if(FaxConfig->SendSingleReceipt)
{
CheckDlgButton( hDlg, IDC_SEND_SINGLE_RECEIPT, BST_CHECKED );
}
if (FaxConfig->bAttachFax)
{
CheckDlgButton( hDlg, IDC_ATTACH_FAX, BST_CHECKED );
}
//
// cover page CB & LB enabling
//
if (FaxConfig->UseCoverPage)
{
CheckDlgButton( hDlg, IDC_USE_COVERPAGE, BST_CHECKED );
}
EnableCoverPageList(hDlg);
//
// Emulate printer's selection change, in order to collect printer config info.
// including cover pages LB population
//
ConfigDlgProc(hDlg, WM_COMMAND,MAKEWPARAM(IDC_PRINTER_LIST,CBN_SELCHANGE),(LPARAM)0);
break;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED)
{
if (LOWORD(wParam) == IDC_USE_COVERPAGE)
{
EnableCoverPageList(hDlg);
return FALSE;
}
}
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_PRINTER_LIST)
{
//
// refresh cover pages list
//
TCHAR SelectedPrinter[MAX_PATH];
DWORD dwPrinterNameLength = 0;
//
// a new fax printer was selected - delete all old coverpages from the list
// because they might include the old fax server's cover pages
//
SendMessage(hwndListCov, LB_RESETCONTENT, 0, 0);
if (CB_ERR != (dwSelectedItem =(DWORD)SendMessage( hwndListPrn, CB_GETCURSEL, 0, 0)))
//
// get the 0 based index of the currently pointed printer
//
{
if (CB_ERR != (dwPrinterNameLength = (DWORD)SendMessage( hwndListPrn, CB_GETLBTEXTLEN, dwSelectedItem, 0)))
{
if (dwPrinterNameLength < MAX_PATH)
{
if (CB_ERR != SendMessage( hwndListPrn, CB_GETLBTEXT, dwSelectedItem, (LPARAM) SelectedPrinter ))
//
// get that printer's name into SelectedPrinter
//
{
if(NULL != (PrinterInfo = (PPRINTER_INFO_2) MyGetPrinter( SelectedPrinter, 2 )))
{
LPTSTR lptszServerName = NULL;
if (GetServerNameFromPrinterInfo(PrinterInfo,&lptszServerName))
{
if (GetServerCpDir( lptszServerName, CpDir, sizeof(CpDir)/sizeof(CpDir[0]) ))
{
AddCoverPagesToList( hwndListCov, CpDir, TRUE );
}
if ((NULL == FaxConfig->ServerName) || (NULL == lptszServerName) ||
(_tcscmp(FaxConfig->ServerName,lptszServerName) != 0) )
{
//
// the server's name and config are not updated - refresh them
//
MemFree(FaxConfig->ServerName);
FaxConfig->ServerName = lptszServerName;
FaxConfig->ServerCpOnly = FALSE;
if (FaxConnectFaxServer(FaxConfig->ServerName,&hFax) )
{
DWORD dwReceiptOptions;
BOOL bEnableReceiptsCheckboxes = FALSE;
//
// Get the new server's ServerCpOnly flag
//
if (!FaxGetPersonalCoverPagesOption(hFax,&FaxConfig->ServerCpOnly))
{
CALL_FAIL(GENERAL_ERR, TEXT("FaxGetPersonalCoverPagesOption"), GetLastError());
}
else
{
//
// Inverse logic
//
FaxConfig->ServerCpOnly = !FaxConfig->ServerCpOnly;
}
if (!FaxGetReceiptsOptions (hFax, &dwReceiptOptions))
{
CALL_FAIL(GENERAL_ERR, TEXT("FaxGetPersonalCoverPagesOption"), GetLastError());
}
else
{
if (DRT_EMAIL & dwReceiptOptions)
{
//
// Server supports receipts by email - enable the checkboxes
//
bEnableReceiptsCheckboxes = TRUE;
}
}
EnableWindow( GetDlgItem( hDlg, IDC_ATTACH_FAX), bEnableReceiptsCheckboxes);
EnableWindow( GetDlgItem( hDlg, IDC_SEND_SINGLE_RECEIPT), bEnableReceiptsCheckboxes);
FaxClose(hFax);
hFax = NULL;
}
}
else
//
// the server's name hasn't changed, all details are OK
//
{
MemFree(lptszServerName);
lptszServerName = NULL;
}
}
else
//
// GetServerNameFromPrinterInfo failed
//
{
FaxConfig->ServerCpOnly = FALSE;
}
//
// don't add client coverpages if FaxConfig->ServerCpOnly is set to true
//
if (!FaxConfig->ServerCpOnly)
{
if(GetClientCpDir( CpDir, sizeof(CpDir) / sizeof(CpDir[0])))
{
//
// if the function failes- the ext. is installed on a machine
// that doesn't have a client on it,
// so we shouldn't look for personal cp
//
AddCoverPagesToList( hwndListCov, CpDir, FALSE );
}
}
MemFree(PrinterInfo);
PrinterInfo = NULL;
//
// check if we have any cp in the LB, if not- don't allow the user to
// ask for a cp with he's fax
//
DWORD dwItemCount = (DWORD)SendMessage(hwndListCov, LB_GETCOUNT, NULL, NULL);
if(LB_ERR == dwItemCount)
{
CALL_FAIL(GENERAL_ERR, TEXT("SendMessage (LB_GETCOUNT)"), ::GetLastError());
}
else
{
EnableWindow( GetDlgItem( hDlg, IDC_USE_COVERPAGE ), dwItemCount ? TRUE : FALSE );
}
if (FaxConfig->CoverPageName)
{
_tcscpy( Buffer, FaxConfig->CoverPageName );
}
if ( ! FaxConfig->ServerCoverPage )
{
TCHAR szPersonal[30] = _T("");
LoadString( g_hResource, IDS_PERSONAL, szPersonal, 30 );
_tcscat( Buffer, _T(" ") );
_tcscat( Buffer, szPersonal );
}
dwSelectedItem = (DWORD)SendMessage( hwndListCov, LB_FINDSTRING, -1, (LPARAM) Buffer );
//
// get the index of the default CP
//
if (dwSelectedItem == LB_ERR)
{
dwSelectedItem = 0;
}
SendMessage( hwndListCov, LB_SETCURSEL, (WPARAM) dwSelectedItem, 0 );
//
// place the default selection on that CP
//
}
}
}
}
}
break;
}
switch (wParam)
{
case IDOK :
//
// Update UseCoverPage
//
FaxConfig->UseCoverPage = (IsDlgButtonChecked( hDlg, IDC_USE_COVERPAGE ) == BST_CHECKED);
//
// Update SendSingleReceipt
//
FaxConfig->SendSingleReceipt = (IsDlgButtonChecked(hDlg, IDC_SEND_SINGLE_RECEIPT) == BST_CHECKED);
FaxConfig->bAttachFax = (IsDlgButtonChecked(hDlg, IDC_ATTACH_FAX) == BST_CHECKED);
//
// Update selected printer
//
dwSelectedItem = (DWORD)SendMessage( hwndListPrn, CB_GETCURSEL, 0, 0 );
if (dwSelectedItem != LB_ERR)
{
if (LB_ERR != SendMessage( hwndListPrn, CB_GETLBTEXT, dwSelectedItem, (LPARAM) Buffer ))/***/
{
MemFree( FaxConfig->PrinterName );
FaxConfig->PrinterName = StringDup( Buffer );
if(!FaxConfig->PrinterName)
{
CALL_FAIL(MEM_ERR, TEXT("StringDup"), ERROR_NOT_ENOUGH_MEMORY);
ErrorMsgBox(g_hResource, hDlg, IDS_NOT_ENOUGH_MEMORY);
EndDialog( hDlg, IDABORT);
return FALSE;
}
}
}
//
// Update cover page
//
dwSelectedItem = (DWORD)SendMessage( hwndListCov, LB_GETCURSEL, 0, 0 );
if (dwSelectedItem != LB_ERR)// LB_ERR when no items in list
{
if (LB_ERR != SendMessage( hwndListCov, LB_GETTEXT, dwSelectedItem, (LPARAM) Buffer ))
//
// get the selected CP name into the buffer
//
{
dwMask = (DWORD)SendMessage( hwndListCov, LB_GETITEMDATA, dwSelectedItem, 0 );
if (dwMask != LB_ERR)
{
FaxConfig->ServerCoverPage = (dwMask & SERVER_COVER_PAGE) == SERVER_COVER_PAGE;
if (!FaxConfig->ServerCoverPage)
{
//
// if the selected CP in the LB is not a server's CP
// Omit the suffix: "(personal)"
//
p = _tcsrchr( Buffer, '(' );
Assert(p);
if( p )
{
p = _tcsdec(Buffer,p);
if( p )
{
_tcsnset(p,TEXT('\0'),1);
}
}
}
}
//
// update CP name to the selected one in the LB
//
MemFree( FaxConfig->CoverPageName );
FaxConfig->CoverPageName = StringDup( Buffer );
if(!FaxConfig->CoverPageName)
{
CALL_FAIL(MEM_ERR, TEXT("StringDup"), ERROR_NOT_ENOUGH_MEMORY);
ErrorMsgBox(g_hResource, hDlg, IDS_NOT_ENOUGH_MEMORY);
EndDialog( hDlg, IDABORT);
return FALSE;
}
}
}
EndDialog( hDlg, IDOK );
break;
case IDCANCEL:
EndDialog( hDlg, IDCANCEL );
break;
}
break;
case WM_HELP:
WinHelpContextPopup(((LPHELPINFO)lParam)->dwContextId, hDlg);
return TRUE;
case WM_CONTEXTMENU:
WinHelpContextPopup(GetWindowContextHelpId((HWND)wParam), hDlg);
return TRUE;
}
return FALSE;
}
|
BattleTowerTrainers:
; The trainer class is not used in Crystal 1.0 due to a bug.
; Instead, the sixth character in the trainer's name is used.
; See BattleTowerText in engine/events/battle_tower/trainer_text.asm.
db "HANSON@@@@", FISHER
db "SAWYER@@@@", POKEMANIAC
db "MASUDA@@@@", GUITARIST
db "NICKEL@@@@", SCIENTIST
db "OLSON@@@@@", POKEFANM
db "ZABOROWSKI", LASS
db "WRIGHT@@@@", YOUNGSTER
db "ALEXANDER@", HIKER
db "KAWAKAMI@@", TEACHER
db "BICKETT@@@", POKEFANM
db "SAITO@@@@@", KIMONO_GIRL
db "CRAWFORD@@", BOARDER
db "DIAZ@@@@@@", PICNICKER
db "ERICKSON@@", BIKER
db "FAIRFIELD@", JUGGLER
db "HUNTER@@@@", POKEFANF
db "HILL@@@@@@", FIREBREATHER
db "JAVIER@@@@", SWIMMERF
db "KAUFMAN@@@", SWIMMERM
db "LANCASTER@", SKIER
db "McMAHILL@@", CAMPER
; The following can only be sampled in Crystal 1.1.
db "OBRIEN@@@@", GENTLEMAN
db "FROST@@@@@", BEAUTY
db "MORSE@@@@@", SUPER_NERD
db "YUFUNE@@@@", BLACKBELT_T
db "RAJAN@@@@@", COOLTRAINERF
db "RODRIGUEZ@", OFFICER
db "SANTIAGO@@", PSYCHIC_T
db "STOCK@@@@@", POKEFANM
db "THURMAN@@@", SCIENTIST
db "VALENTINO@", BEAUTY
db "WAGNER@@@@", CAMPER
db "YATES@@@@@", BIRD_KEEPER
db "ANDREWS@@@", PICNICKER
db "BAHN@@@@@@", POKEMANIAC
db "MORI@@@@@@", SCIENTIST
db "BUCKMAN@@@", SAGE
db "COBB@@@@@@", SCHOOLBOY
db "HUGHES@@@@", FISHER
db "ARITA@@@@@", KIMONO_GIRL
db "EASTON@@@@", PSYCHIC_T
db "FREEMAN@@@", CAMPER
db "GIESE@@@@@", LASS
db "HATCHER@@@", GENTLEMAN
db "JACKSON@@@", POKEFANF
db "KAHN@@@@@@", POKEMANIAC
db "LEONG@@@@@", YOUNGSTER
db "MARINO@@@@", TEACHER
db "NEWMAN@@@@", SAILOR
db "NGUYEN@@@@", BLACKBELT_T
db "OGDEN@@@@@", SUPER_NERD
db "PARK@@@@@@", COOLTRAINERF
db "RAINE@@@@@", SWIMMERM
db "SELLS@@@@@", BIRD_KEEPER
db "ROCKWELL@@", BOARDER
db "THORNTON@@", LASS
db "TURNER@@@@", OFFICER
db "VAN DYKE@@", SKIER
db "WALKER@@@@", SCHOOLBOY
db "MEYER@@@@@", SWIMMERF
db "JOHNSON@@@", YOUNGSTER
db "ADAMS@@@@@", GUITARIST
db "SMITH@@@@@", BUG_CATCHER
db "TAJIRI@@@@", BUG_CATCHER
db "BAKER@@@@@", POKEMANIAC
db "COLLINS@@@", SCIENTIST
db "SMART@@@@@", SUPER_NERD
db "DYKSTRA@@@", SWIMMERF
db "EATON@@@@@", BIKER
db "WONG@@@@@@", FIREBREATHER
|
;
; Sprite Rendering Routine
; original code by Patrick Davidson (TI 85)
; modified by Stefano Bodrato - nov 2010
;
; Generic high resolution version
;
;
; $Id: w_putsprite.asm,v 1.8 2017/01/02 21:51:24 aralbrec Exp $
;
SECTION code_clib
PUBLIC putsprite
PUBLIC _putsprite
EXTERN w_pixeladdress
EXTERN swapgfxbk
EXTERN swapgfxbk1
INCLUDE "graphics/grafix.inc"
; __gfx_coords: d,e (vert-horz)
; sprite: (ix)
.offsets_table
defb 1,2,4,8,16,32,64,128
.putsprite
._putsprite
ld hl,2
add hl,sp
ld e,(hl)
inc hl
ld d,(hl) ; sprite address
push de
pop ix
inc hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld c,(hl)
inc hl
ld b,(hl) ; x and y __gfx_coords
inc hl
ld a,(hl) ; and/or/xor mode
ld (ortype+1),a ; Self modifying code
ld (ortype2+1),a ; Self modifying code
inc hl
ld a,(hl)
ld (ortype),a ; Self modifying code
ld (ortype2),a ; Self modifying code
call swapgfxbk
; @@@@@@@@@@@@
ld h,b
ld l,c
ld (curx),hl
ld (oldx),hl
ld (cury),de
call w_pixeladdress
; ------
;ld a,(hl)
; @@@@@@@@@@@@
ld c,a
ld hl,offsets_table
ld c,a
ld b,0
add hl,bc
ld a,(hl)
ld (wsmc1+1),a
ld (wsmc2+1),a
ld (_smc1+1),a
ld h,d
ld l,e ; display location from pixeladdress
ld a,(ix+0)
cp 9
jp nc,putspritew
ld d,a
ld b,(ix+1)
._oloop push bc ;Save # of rows
ld b,d ;Load width
ld c,(ix+2) ;Load one line of image
inc ix
._smc1 ld a,1 ;Load pixel mask
._iloop sla c ;Test leftmost pixel
jp nc,_noplot ;See if a plot is needed
ld e,a
.ortype
nop ; changed into nop / cpl
nop ; changed into and/or/xor (hl)
ld (hl),a
ld a,e
._noplot rrca
jr nc,_notedge ;Test if edge of byte reached
;@@@@@@@@@@
;Go to next byte
;@@@@@@@@@@
push bc
push de
ex af,af
ld hl,(curx)
ld de,8
add hl,de
ld de,(cury)
ld (curx),hl
call w_pixeladdress
ld h,d
ld l,e
ex af,af
pop de
pop bc
;@@@@@@@@@@
._notedge djnz _iloop
push de
;@@@@@@@@@@
;Go to next line
;@@@@@@@@@@
ld hl,(oldx)
ld (curx),hl
ld de,(cury)
inc de
ld (cury),de
call w_pixeladdress
ld h,d
ld l,e
;@@@@@@@@@@
pop de
pop bc ;Restore data
djnz _oloop
jp swapgfxbk1
.putspritew
ld d,a
ld b,(ix+1)
.woloop push bc ;Save # of rows
ld b,d ;Load width
ld c,(ix+2) ;Load one line of image
inc ix
.wsmc1 ld a,1 ;Load pixel mask
.wiloop sla c ;Test leftmost pixel
jp nc,wnoplot ;See if a plot is needed
ld e,a
.ortype2
nop ; changed into nop / cpl
nop ; changed into and/or/xor (hl)
ld (hl),a
ld a,e
.wnoplot rrca
jr nc,wnotedge ;Test if edge of byte reached
;@@@@@@@@@@
;Go to next byte
;@@@@@@@@@@
push bc
push de
ex af,af
ld hl,(curx)
ld de,8
add hl,de
ld de,(cury)
ld (curx),hl
call w_pixeladdress
ld h,d
ld l,e
ex af,af
pop de
pop bc
;@@@@@@@@@@
.wnotedge
.wsmc2 cp 1
jp z,wover_1
djnz wiloop
push de
;@@@@@@@@@@
;Go to next line
;@@@@@@@@@@
ld hl,(oldx)
ld (curx),hl
ld de,(cury)
inc de
ld (cury),de
call w_pixeladdress
ld h,d
ld l,e
;@@@@@@@@@@
pop de
pop bc ;Restore data
djnz woloop
jp swapgfxbk1
.wover_1 ld c,(ix+2)
inc ix
djnz wiloop
dec ix
push de
;@@@@@@@@@@
;Go to next line
;@@@@@@@@@@
ld hl,(oldx)
ld (curx),hl
ld de,(cury)
inc de
ld (cury),de
call w_pixeladdress
ld h,d
ld l,e
;@@@@@@@@@@
pop de
pop bc
djnz woloop
jp swapgfxbk1
SECTION bss_clib
.oldx
defw 0
.curx
defw 0
.cury
defw 0
|
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
section .text code align=64
EXTERN OPENSSL_Uplink
global OPENSSL_UplinkTable
ALIGN 16
_lazy1:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,1
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[8+rax]
_lazy1_end:
ALIGN 16
_lazy2:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,2
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[16+rax]
_lazy2_end:
ALIGN 16
_lazy3:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,3
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[24+rax]
_lazy3_end:
ALIGN 16
_lazy4:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,4
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[32+rax]
_lazy4_end:
ALIGN 16
_lazy5:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,5
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[40+rax]
_lazy5_end:
ALIGN 16
_lazy6:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,6
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[48+rax]
_lazy6_end:
ALIGN 16
_lazy7:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,7
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[56+rax]
_lazy7_end:
ALIGN 16
_lazy8:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,8
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[64+rax]
_lazy8_end:
ALIGN 16
_lazy9:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,9
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[72+rax]
_lazy9_end:
ALIGN 16
_lazy10:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,10
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[80+rax]
_lazy10_end:
ALIGN 16
_lazy11:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,11
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[88+rax]
_lazy11_end:
ALIGN 16
_lazy12:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,12
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[96+rax]
_lazy12_end:
ALIGN 16
_lazy13:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,13
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[104+rax]
_lazy13_end:
ALIGN 16
_lazy14:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,14
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[112+rax]
_lazy14_end:
ALIGN 16
_lazy15:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,15
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[120+rax]
_lazy15_end:
ALIGN 16
_lazy16:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,16
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[128+rax]
_lazy16_end:
ALIGN 16
_lazy17:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,17
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[136+rax]
_lazy17_end:
ALIGN 16
_lazy18:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,18
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[144+rax]
_lazy18_end:
ALIGN 16
_lazy19:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,19
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[152+rax]
_lazy19_end:
ALIGN 16
_lazy20:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,20
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[160+rax]
_lazy20_end:
ALIGN 16
_lazy21:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,21
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[168+rax]
_lazy21_end:
ALIGN 16
_lazy22:
DB 0x48,0x83,0xEC,0x28
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],rdx
mov QWORD[64+rsp],r8
mov QWORD[72+rsp],r9
lea rcx,[OPENSSL_UplinkTable]
mov rdx,22
call OPENSSL_Uplink
mov rcx,QWORD[48+rsp]
mov rdx,QWORD[56+rsp]
mov r8,QWORD[64+rsp]
mov r9,QWORD[72+rsp]
lea rax,[OPENSSL_UplinkTable]
add rsp,40
jmp QWORD[176+rax]
_lazy22_end:
section .data data align=8
OPENSSL_UplinkTable:
DQ 22
DQ _lazy1
DQ _lazy2
DQ _lazy3
DQ _lazy4
DQ _lazy5
DQ _lazy6
DQ _lazy7
DQ _lazy8
DQ _lazy9
DQ _lazy10
DQ _lazy11
DQ _lazy12
DQ _lazy13
DQ _lazy14
DQ _lazy15
DQ _lazy16
DQ _lazy17
DQ _lazy18
DQ _lazy19
DQ _lazy20
DQ _lazy21
DQ _lazy22
section .pdata rdata align=4
ALIGN 4
DD _lazy1 wrt ..imagebase,_lazy1_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy2 wrt ..imagebase,_lazy2_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy3 wrt ..imagebase,_lazy3_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy4 wrt ..imagebase,_lazy4_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy5 wrt ..imagebase,_lazy5_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy6 wrt ..imagebase,_lazy6_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy7 wrt ..imagebase,_lazy7_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy8 wrt ..imagebase,_lazy8_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy9 wrt ..imagebase,_lazy9_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy10 wrt ..imagebase,_lazy10_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy11 wrt ..imagebase,_lazy11_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy12 wrt ..imagebase,_lazy12_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy13 wrt ..imagebase,_lazy13_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy14 wrt ..imagebase,_lazy14_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy15 wrt ..imagebase,_lazy15_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy16 wrt ..imagebase,_lazy16_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy17 wrt ..imagebase,_lazy17_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy18 wrt ..imagebase,_lazy18_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy19 wrt ..imagebase,_lazy19_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy20 wrt ..imagebase,_lazy20_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy21 wrt ..imagebase,_lazy21_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
DD _lazy22 wrt ..imagebase,_lazy22_end wrt ..imagebase,_lazy_unwind_info wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
_lazy_unwind_info:
DB 0x01,0x04,0x01,0x00
DB 0x04,0x42,0x00,0x00
|
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
int Total_Weight, Amount_Elements, Elements_Profits[20], Elements_Weights[20], j;
set < double > Profit_Weight_Ratios;
set < double > :: iterator Iterator;
double CurrentProfit, CurrentWeight, RatioProfitToWeight, Real_Profit_Weight_Ratios[20];
map < double , vector < int > > Elements_By_Ratios;
int Result;
int main() {
cin >> Total_Weight >> Amount_Elements;
for(int i = 1; i <= Amount_Elements; i++) {
cin >> Elements_Profits[i] >> Elements_Weights[i];
}
for(int i = 1; i <= Amount_Elements; i++) {
CurrentProfit = Elements_Profits[i];
CurrentWeight = Elements_Weights[i];
RatioProfitToWeight = CurrentProfit / CurrentWeight;
Profit_Weight_Ratios.insert(RatioProfitToWeight);
Iterator = Profit_Weight_Ratios.find(RatioProfitToWeight);
Elements_By_Ratios[*Iterator].push_back(i);
}
j = Profit_Weight_Ratios.size();
for(Iterator = Profit_Weight_Ratios.begin(); Iterator != Profit_Weight_Ratios.end(); Iterator++, j--) {
Real_Profit_Weight_Ratios[j] = *Iterator;
}
for(int i = 1; i <= Profit_Weight_Ratios.size(); i++) {
for( j = 0; j < Elements_By_Ratios[Real_Profit_Weight_Ratios[i]].size(); j++) {
if(Total_Weight - Elements_Weights[Elements_By_Ratios[Real_Profit_Weight_Ratios[i]][j]] >= 0) {
Result += Elements_Profits[Elements_By_Ratios[Real_Profit_Weight_Ratios[i]][j]];
Total_Weight -= Elements_Weights[Elements_By_Ratios[Real_Profit_Weight_Ratios[i]][j]];
}
}
}
cout << Result << "\n";
return 0;
}
|
# JMH version: 1.19
# VM version: JDK 1.8.0_131, VM 25.131-b11
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: <none>
# Warmup: 20 iterations, 1 s each
# Measurement: 20 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.github.arnaudroger.re2j.Re2jFindRegex.testExp2
# Run progress: 0.00% complete, ETA 00:00:40
# Fork: 1 of 1
# Preparing profilers: LinuxPerfAsmProfiler
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration 1: 6563.040 ops/s
# Warmup Iteration 2: 11790.322 ops/s
# Warmup Iteration 3: 11797.621 ops/s
# Warmup Iteration 4: 11736.210 ops/s
# Warmup Iteration 5: 11475.914 ops/s
# Warmup Iteration 6: 11567.755 ops/s
# Warmup Iteration 7: 11765.711 ops/s
# Warmup Iteration 8: 10978.644 ops/s
# Warmup Iteration 9: 11652.363 ops/s
# Warmup Iteration 10: 11370.165 ops/s
# Warmup Iteration 11: 11612.394 ops/s
# Warmup Iteration 12: 11640.977 ops/s
# Warmup Iteration 13: 11682.052 ops/s
# Warmup Iteration 14: 11885.548 ops/s
# Warmup Iteration 15: 11886.213 ops/s
# Warmup Iteration 16: 11882.107 ops/s
# Warmup Iteration 17: 11842.385 ops/s
# Warmup Iteration 18: 11852.426 ops/s
# Warmup Iteration 19: 11872.527 ops/s
# Warmup Iteration 20: 11873.745 ops/s
Iteration 1: 11866.845 ops/s
Iteration 2: 11818.430 ops/s
Iteration 3: 11831.518 ops/s
Iteration 4: 11834.542 ops/s
Iteration 5: 11833.531 ops/s
Iteration 6: 11828.181 ops/s
Iteration 7: 11881.457 ops/s
Iteration 8: 11883.339 ops/s
Iteration 9: 11852.871 ops/s
Iteration 10: 11812.929 ops/s
Iteration 11: 11738.251 ops/s
Iteration 12: 11742.226 ops/s
Iteration 13: 11739.915 ops/s
Iteration 14: 11727.137 ops/s
Iteration 15: 11741.298 ops/s
Iteration 16: 11742.321 ops/s
Iteration 17: 11744.943 ops/s
Iteration 18: 11743.706 ops/s
Iteration 19: 11744.208 ops/s
Iteration 20: 11744.056 ops/s
# Processing profiler results: LinuxPerfAsmProfiler
Result "com.github.arnaudroger.re2j.Re2jFindRegex.testExp2":
11792.585 ±(99.9%) 48.652 ops/s [Average]
(min, avg, max) = (11727.137, 11792.585, 11883.339), stdev = 56.027
CI (99.9%): [11743.934, 11841.237] (assumes normal distribution)
Secondary result "com.github.arnaudroger.re2j.Re2jFindRegex.testExp2:·asm":
PrintAssembly processed: 193628 total address lines.
Perf output processed (skipped 23.291 seconds):
Column 1: cycles (20687 events)
Column 2: instructions (20668 events)
Hottest code regions (>10.00% "cycles" events):
....[Hottest Region 1]..............................................................................
C2, level 4, com.google.re2j.Machine::step, version 495 (674 bytes)
# parm6: [sp+0x78] = int
# parm7: [sp+0x80] = boolean
0x00007f3e8521afc0: mov 0x8(%rsi),%r10d
0x00007f3e8521afc4: shl $0x3,%r10
0x00007f3e8521afc8: cmp %r10,%rax
0x00007f3e8521afcb: jne 0x00007f3e85045e20 ; {runtime_call}
0x00007f3e8521afd1: data16 xchg %ax,%ax
0x00007f3e8521afd4: nopl 0x0(%rax,%rax,1)
0x00007f3e8521afdc: data16 data16 xchg %ax,%ax
[Verified Entry Point]
0.22% 0.20% 0x00007f3e8521afe0: mov %eax,-0x14000(%rsp)
0.23% 0.24% 0x00007f3e8521afe7: push %rbp
0.07% 0.09% 0x00007f3e8521afe8: sub $0x60,%rsp ;*synchronization entry
; - com.google.re2j.Machine::step@-1 (line 276)
0.16% 0.13% 0x00007f3e8521afec: mov %edi,0x18(%rsp)
0.19% 0.19% 0x00007f3e8521aff0: mov %r9d,0x14(%rsp)
0.06% 0.09% 0x00007f3e8521aff5: mov %r8d,0x10(%rsp)
0.09% 0.09% 0x00007f3e8521affa: mov %rcx,0x8(%rsp)
0.04% 0.03% 0x00007f3e8521afff: vmovq %rdx,%xmm0
0.20% 0.15% 0x00007f3e8521b004: vmovq %rsi,%xmm1
0.05% 0.06% 0x00007f3e8521b009: mov 0x14(%rsi),%r10d ;*getfield re2
; - com.google.re2j.Machine::step@1 (line 276)
0.10% 0.09% 0x00007f3e8521b00d: movzbl 0x18(%r12,%r10,8),%r11d ;*getfield longest
; - com.google.re2j.Machine::step@4 (line 276)
; implicit exception: dispatches to 0x00007f3e8521bbad
0.08% 0.03% 0x00007f3e8521b013: vmovd %r11d,%xmm3
0.17% 0.16% 0x00007f3e8521b018: mov 0xc(%rdx),%ecx ;*getfield size
; - com.google.re2j.Machine::step@15 (line 277)
; implicit exception: dispatches to 0x00007f3e8521bbbd
0.08% 0.10% 0x00007f3e8521b01b: test %ecx,%ecx
╭ 0x00007f3e8521b01d: jle 0x00007f3e8521b16e ;*if_icmpge
│ ; - com.google.re2j.Machine::step@18 (line 277)
0.11% 0.10% │ 0x00007f3e8521b023: test %r11d,%r11d
│ 0x00007f3e8521b026: jne 0x00007f3e8521b721
0.06% 0.07% │ 0x00007f3e8521b02c: xor %r10d,%r10d
0.18% 0.24% │╭ 0x00007f3e8521b02f: jmp 0x00007f3e8521b047
1.42% 0.93% ││ ↗ 0x00007f3e8521b031: mov %r10d,%ecx
0.01% 0.02% ││ │ 0x00007f3e8521b034: mov %r11,0x8(%rsp)
0.10% 0.08% ││ │ 0x00007f3e8521b039: mov %ebx,0x78(%rsp)
0.13% 0.12% ││ │ 0x00007f3e8521b03d: mov %edi,0x80(%rsp)
1.61% 0.83% ││ │ 0x00007f3e8521b044: mov %edx,%r10d ;*getfield size
││ │ ; - com.google.re2j.Machine::step@15 (line 277)
0.08% 0.09% │↘ │ 0x00007f3e8521b047: vmovq %xmm0,%r11
0.22% 0.21% │ │ 0x00007f3e8521b04c: mov 0x20(%r11),%r8d ;*getfield denseThreads
│ │ ; - com.google.re2j.Machine::step@22 (line 278)
0.17% 0.19% │ │ 0x00007f3e8521b050: mov 0xc(%r12,%r8,8),%r9d ; implicit exception: dispatches to 0x00007f3e8521bb69
1.69% 1.12% │ │ 0x00007f3e8521b055: cmp %r9d,%r10d
│ │ 0x00007f3e8521b058: jae 0x00007f3e8521b4a9
0.09% 0.10% │ │ 0x00007f3e8521b05e: lea (%r12,%r8,8),%r11
0.21% 0.20% │ │ 0x00007f3e8521b062: mov 0x10(%r11,%r10,4),%r8d ;*aaload
│ │ ; - com.google.re2j.Machine::step@27 (line 278)
0.15% 0.18% │ │ 0x00007f3e8521b067: mov 0x10(%r12,%r8,8),%edi ;*getfield inst
│ │ ; - com.google.re2j.Machine::step@78 (line 283)
│ │ ; implicit exception: dispatches to 0x00007f3e8521bb7d
3.56% 2.84% │ │ 0x00007f3e8521b06c: mov 0xc(%r12,%rdi,8),%eax ; implicit exception: dispatches to 0x00007f3e8521bb8d
6.90% 7.70% │ │ 0x00007f3e8521b071: mov 0xc(%r12,%r8,8),%r14d ;*getfield cap
│ │ ; - com.google.re2j.Machine::step@106 (line 289)
0.06% 0.01% │ │ 0x00007f3e8521b076: vmovq %xmm1,%r11
0.01% 0.02% │ │ 0x00007f3e8521b07b: mov 0xc(%r11),%r9d ;*getfield poolSize
│ │ ; - com.google.re2j.Machine::free@1 (line 167)
│ │ ; - com.google.re2j.Machine::step@226 (line 303)
0.33% 0.20% │ │ 0x00007f3e8521b07f: mov 0x24(%r11),%r11d ;*getfield pool
│ │ ; - com.google.re2j.Machine::free@5 (line 167)
│ │ ; - com.google.re2j.Machine::step@226 (line 303)
1.72% 1.63% │ │ 0x00007f3e8521b083: mov %r10d,%edx
0.01% 0.04% │ │ 0x00007f3e8521b086: inc %edx ;*iadd
│ │ ; - com.google.re2j.Machine::step@173 (line 295)
0.00% 0.01% │ │ 0x00007f3e8521b088: lea (%r12,%r8,8),%rsi ;*aaload
│ │ ; - com.google.re2j.Machine::step@27 (line 278)
0.33% 0.31% │ │ 0x00007f3e8521b08c: cmp $0x6,%eax
│ ╭ │ 0x00007f3e8521b08f: je 0x00007f3e8521b287 ;*if_icmpne
│ │ │ ; - com.google.re2j.Machine::step@90 (line 285)
1.64% 1.98% │ │ │ 0x00007f3e8521b095: mov 0x8(%r12,%rdi,8),%ebx
0.05% 0.03% │ │ │ 0x00007f3e8521b09a: cmp $0xf8019993,%ebx ; {metadata('com/google/re2j/Inst$RuneInst')}
│ │ │ 0x00007f3e8521b0a0: jne 0x00007f3e8521b4f1
0.01% 0.02% │ │ │ 0x00007f3e8521b0a6: shl $0x3,%rdi ;*invokevirtual matchRune
│ │ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.31% 0.24% │ │ │ 0x00007f3e8521b0aa: mov 0xc(%rdi),%ebp ;*getfield op
│ │ │ ; - com.google.re2j.Inst$RuneInst::matchRune@1 (line 134)
│ │ │ ; - com.google.re2j.Machine::step@189 (line 299)
1.82% 2.00% │ │ │ 0x00007f3e8521b0ad: cmp $0xa,%ebp
│ │╭ │ 0x00007f3e8521b0b0: je 0x00007f3e8521b1a2 ;*if_icmpne
│ ││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@6 (line 134)
│ ││ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.10% 0.14% │ ││ │ 0x00007f3e8521b0b6: cmp $0xb,%ebp
│ ││ │ 0x00007f3e8521b0b9: je 0x00007f3e8521b5cd ;*if_icmpne
│ ││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@17 (line 138)
│ ││ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.27% 0.32% │ ││ │ 0x00007f3e8521b0bf: cmp $0x9,%ebp
│ ││ │ 0x00007f3e8521b0c2: je 0x00007f3e8521b60d ;*if_icmpne
│ ││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@38 (line 142)
│ ││ │ ; - com.google.re2j.Machine::step@189 (line 299)
1.44% 1.92% │ ││ │ 0x00007f3e8521b0c8: cmp $0xc,%ebp
│ ││ │ 0x00007f3e8521b0cb: jne 0x00007f3e8521b58d ;*if_icmpne
│ ││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@61 (line 146)
│ ││ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.84% 1.21% │ ││ │ 0x00007f3e8521b0d1: mov 0x20(%rdi),%eax ;*getfield f0
│ ││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@65 (line 147)
│ ││ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.03% 0.03% │ ││ │ 0x00007f3e8521b0d4: cmp 0x18(%rsp),%eax
│ ││╭ │ 0x00007f3e8521b0d8: je 0x00007f3e8521b1a2 ;*if_icmpeq
│ │││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@69 (line 147)
│ │││ │ ; - com.google.re2j.Machine::step@189 (line 299)
1.42% 1.53% │ │││ │ 0x00007f3e8521b0de: mov 0x24(%rdi),%ebx ;*getfield f1
│ │││ │ ; - com.google.re2j.Inst$RuneInst::matchRune@73 (line 147)
│ │││ │ ; - com.google.re2j.Machine::step@189 (line 299)
0.20% 0.33% │ │││ │ 0x00007f3e8521b0e1: cmp 0x18(%rsp),%ebx
│ │││╭│ 0x00007f3e8521b0e5: je 0x00007f3e8521b1a2 ;*if_icmpeq
│ │││││ ; - com.google.re2j.Inst$RuneInst::matchRune@77 (line 147)
│ │││││ ; - com.google.re2j.Machine::step@189 (line 299)
1.99% 1.98% │ │││││ 0x00007f3e8521b0eb: mov 0x28(%rdi),%ebp ;*getfield f2
│ │││││ ; - com.google.re2j.Inst$RuneInst::matchRune@81 (line 147)
│ │││││ ; - com.google.re2j.Machine::step@189 (line 299)
0.07% 0.12% │ │││││ 0x00007f3e8521b0ee: cmp 0x18(%rsp),%ebp
│ │││││ 0x00007f3e8521b0f2: je 0x00007f3e8521b6a1 ;*if_icmpeq
│ │││││ ; - com.google.re2j.Inst$RuneInst::matchRune@85 (line 147)
│ │││││ ; - com.google.re2j.Machine::step@189 (line 299)
0.91% 1.04% │ │││││ 0x00007f3e8521b0f8: mov 0x2c(%rdi),%ebp ;*getfield f3
│ │││││ ; - com.google.re2j.Inst$RuneInst::matchRune@89 (line 147)
│ │││││ ; - com.google.re2j.Machine::step@189 (line 299)
0.15% 0.19% │ │││││ 0x00007f3e8521b0fb: cmp 0x18(%rsp),%ebp
│ │││││ 0x00007f3e8521b0ff: je 0x00007f3e8521b6e1 ;*if_icmpne
│ │││││ ; - com.google.re2j.Inst$RuneInst::matchRune@93 (line 147)
│ │││││ ; - com.google.re2j.Machine::step@189 (line 299)
1.87% 1.84% │ │││││ 0x00007f3e8521b105: mov 0x78(%rsp),%ebx
0.02% 0.01% │ │││││ 0x00007f3e8521b109: mov 0x80(%rsp),%edi ;*getfield size
│ │││││ ; - com.google.re2j.Machine::step@15 (line 277)
0.11% 0.12% │ │││││ 0x00007f3e8521b110: mov 0xc(%r12,%r11,8),%ebp ;*arraylength
│ │││││ ; - com.google.re2j.Machine::free@8 (line 167)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
│ │││││ ; implicit exception: dispatches to 0x00007f3e8521bb9d
0.10% 0.11% │ │││││ 0x00007f3e8521b115: cmp %ebp,%r9d
│ │││││ 0x00007f3e8521b118: jge 0x00007f3e8521b64d ;*if_icmplt
│ │││││ ; - com.google.re2j.Machine::free@9 (line 167)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
1.52% 1.94% │ │││││ 0x00007f3e8521b11e: mov %r9d,%esi
0.02% │ │││││ 0x00007f3e8521b121: inc %esi
0.14% 0.11% │ │││││ 0x00007f3e8521b123: vmovq %xmm1,%rax
0.11% 0.12% │ │││││ 0x00007f3e8521b128: mov %esi,0xc(%rax) ;*putfield poolSize
│ │││││ ; - com.google.re2j.Machine::free@45 (line 170)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
1.85% 1.89% │ │││││ 0x00007f3e8521b12b: cmp %ebp,%r9d
│ │││││ 0x00007f3e8521b12e: jae 0x00007f3e8521b52d ;*aastore
│ │││││ ; - com.google.re2j.Machine::free@49 (line 170)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
0.01% 0.02% │ │││││ 0x00007f3e8521b134: vmovq %xmm0,%r10
0.12% 0.11% │ │││││ 0x00007f3e8521b139: mov 0xc(%r10),%r10d ;*getfield size
│ │││││ ; - com.google.re2j.Machine::step@15 (line 277)
0.14% 0.21% │ │││││ 0x00007f3e8521b13d: shl $0x3,%r11 ;*getfield pool
│ │││││ ; - com.google.re2j.Machine::free@5 (line 167)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
1.83% 1.99% │ │││││ 0x00007f3e8521b141: lea 0x10(%r11,%r9,4),%r11
0.01% │ │││││ 0x00007f3e8521b146: mov %r8d,(%r11)
0.21% 0.14% │ │││││ 0x00007f3e8521b149: shr $0x9,%r11
0.14% 0.19% │ │││││ 0x00007f3e8521b14d: movabs $0x7f3e80dee000,%r8
1.79% 1.31% │ │││││ 0x00007f3e8521b157: mov %r12b,(%r8,%r11,1) ;*aastore
│ │││││ ; - com.google.re2j.Machine::free@49 (line 170)
│ │││││ ; - com.google.re2j.Machine::step@226 (line 303)
0.06% 0.02% │ │││││ 0x00007f3e8521b15b: mov 0x8(%rsp),%r11 ; OopMap{r11=Oop xmm0=Oop xmm1=Oop off=416}
│ │││││ ;*goto
│ │││││ ; - com.google.re2j.Machine::step@232 (line 277)
0.20% 0.15% │ │││││ ↗ 0x00007f3e8521b160: test %eax,0x16569e9a(%rip) # 0x00007f3e9b785000
│ │││││ │ ;*goto
│ │││││ │ ; - com.google.re2j.Machine::step@232 (line 277)
│ │││││ │ ; {poll}
0.17% 0.14% │ │││││ │ 0x00007f3e8521b166: cmp %ecx,%edx
│ ││││╰ │ 0x00007f3e8521b168: jl 0x00007f3e8521b031 ;*if_icmpge
│ ││││ │ ; - com.google.re2j.Machine::step@18 (line 277)
0.34% 0.24% ↘ ││││ │ 0x00007f3e8521b16e: vmovq %xmm0,%r10
0.01% 0.01% ││││ │ 0x00007f3e8521b173: movzbl 0x18(%r10),%r11d
0.04% 0.01% ││││ │ 0x00007f3e8521b178: test %r11d,%r11d
││││ ╭│ 0x00007f3e8521b17b: jne 0x00007f3e8521b196 ;*ifeq
││││ ││ ; - com.google.re2j.Machine$Queue::clear@4 (line 69)
││││ ││ ; - com.google.re2j.Machine::step@236 (line 306)
0.03% 0.02% ││││ ││ 0x00007f3e8521b17d: mov %r12d,0xc(%r10) ;*putfield size
││││ ││ ; - com.google.re2j.Machine$Queue::clear@10 (line 70)
││││ ││ ; - com.google.re2j.Machine::step@236 (line 306)
0.38% 0.22% ││││ ││ 0x00007f3e8521b181: mov 0x1c(%r10),%ebp ;*getfield pcs
││││ ││ ; - com.google.re2j.Machine$Queue::clear@29 (line 73)
││││ ││ ; - com.google.re2j.Machine::step@236 (line 306)
0.00% ││││ ││ 0x00007f3e8521b185: movb $0x1,0x18(%r10) ;*putfield empty
││││ ││ ; - com.google.re2j.Machine$Queue::clear@15 (line 71)
││││ ││ ; - com.google.re2j.Machine::step@236 (line 306)
0.03% 0.02% ││││ ││ 0x00007f3e8521b18a: mov %r12,0x10(%r10) ;*putfield pcsl
││││ ││ ; - com.google.re2j.Machine$Queue::clear@25 (line 72)
││││ ││ ; - com.google.re2j.Machine::step@236 (line 306)
0.02% ││││ ││ 0x00007f3e8521b18e: test %ebp,%ebp
││││ ││ 0x00007f3e8521b190: jne 0x00007f3e8521b749 ;*getfield size
││││ ││ ; - com.google.re2j.Machine::step@15 (line 277)
0.32% 0.23% ││││ ↘│ 0x00007f3e8521b196: add $0x60,%rsp
││││ │ 0x00007f3e8521b19a: pop %rbp
0.03% 0.02% ││││ │ 0x00007f3e8521b19b: test %eax,0x16569e5f(%rip) # 0x00007f3e9b785000
││││ │ ; {poll_return}
0.04% 0.04% ││││ │ 0x00007f3e8521b1a1: retq
0.29% 0.26% │↘↘↘ │ 0x00007f3e8521b1a2: mov 0x1c(%rdi),%r11d ;*getfield outInst
│ │ ; - com.google.re2j.Machine::step@197 (line 300)
0.21% 0.16% │ │ 0x00007f3e8521b1a6: mov 0x8(%r12,%r11,8),%ebx ; implicit exception: dispatches to 0x00007f3e8521bbcd
0.34% 0.23% │ │ 0x00007f3e8521b1ab: lea (%r12,%r11,8),%r9
0.01% │ │ 0x00007f3e8521b1af: xor %edi,%edi
0.00% │ │ 0x00007f3e8521b1b1: mov $0x1,%eax
│ │ 0x00007f3e8521b1b6: cmp $0xf8019993,%ebx ; {metadata('com/google/re2j/Inst$RuneInst')}
│ │ 0x00007f3e8521b1bc: jne 0x00007f3e8521b3e0 ;*invokevirtual add
│ │ ; - com.google.re2j.Machine::step@213 (line 300)
0.06% 0.09% │ │ 0x00007f3e8521b1c2: mov 0x18(%r9),%ebx ;*getfield pc
│ │ ; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% 0.01% │ │ 0x00007f3e8521b1c6: mov 0x8(%rsp),%r11
│ │ 0x00007f3e8521b1cb: mov 0x10(%r11),%rbp ;*getfield pcsl
│ │ ; - com.google.re2j.Machine$Queue::contains@7 (line 47)
│ │ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
│ │ ; implicit exception: dispatches to 0x00007f3e8521bbed
0.00% │ │ 0x00007f3e8521b1cf: cmp $0x40,%ebx
│ │ 0x00007f3e8521b1d2: jg 0x00007f3e8521b7ad ;*if_icmpgt
│ │ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ │ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.04% 0.05% │ │ 0x00007f3e8521b1d8: mov %ebx,%ecx
│ │ 0x00007f3e8521b1da: shl %cl,%rax ;*lshl
│ │ ; - com.google.re2j.Machine$Queue::contains@12 (line 47)
│ │ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.26% 0.11% │ │ 0x00007f3e8521b1dd: mov %rbp,%rcx
0.00% │ │ 0x00007f3e8521b1e0: and %rax,%rcx ;*land
│ │ ; - com.google.re2j.Machine$Queue::contains@13 (line 47)
│ │ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% │ │ 0x00007f3e8521b1e3: test %rcx,%rcx
│ │ 0x00007f3e8521b1e6: jne 0x00007f3e8521b7f9 ;*ifeq
│ │ ; - com.google.re2j.Machine$Queue::contains@16 (line 47)
│ │ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.11% 0.05% │ │ 0x00007f3e8521b1ec: cmp $0x40,%ebx
│ │ 0x00007f3e8521b1ef: jge 0x00007f3e8521b85d ;*if_icmpge
│ │ ; - com.google.re2j.Machine$Queue::add@3 (line 56)
│ │ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% 0.01% │ │ 0x00007f3e8521b1f5: mov %r12b,0x18(%r11) ;*putfield empty
│ │ ; - com.google.re2j.Machine$Queue::add@33 (line 61)
│ │ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.02% │ │ 0x00007f3e8521b1f9: or %rbp,%rax
│ │ 0x00007f3e8521b1fc: mov %rax,0x10(%r11) ;*putfield pcsl
│ │ ; - com.google.re2j.Machine$Queue::add@15 (line 57)
│ │ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.06% 0.04% │ │ 0x00007f3e8521b200: mov %rsi,%rbx
0.01% 0.00% │ │ 0x00007f3e8521b203: mov %r9,%rcx
0.01% 0.00% │ │ 0x00007f3e8521b206: shr $0x3,%rcx
│ │ 0x00007f3e8521b20a: mov %ecx,0x10(%r12,%r8,8)
0.08% 0.00% │ │ 0x00007f3e8521b20f: shr $0x9,%rbx
0.01% 0.00% │ │ 0x00007f3e8521b213: movabs $0x7f3e80dee000,%r9
0.01% 0.01% │ │ 0x00007f3e8521b21d: mov %r12b,(%r9,%rbx,1) ;*putfield inst
│ │ ; - com.google.re2j.Inst$MatchInst::add@41 (line 101)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
│ │ 0x00007f3e8521b221: mov 0xc(%r12,%r14,8),%ebp ;*arraylength
│ │ ; - com.google.re2j.Inst$MatchInst::add@45 (line 103)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
│ │ ; implicit exception: dispatches to 0x00007f3e8521bc01
0.08% 0.04% │ │ 0x00007f3e8521b226: test %ebp,%ebp
│ │ 0x00007f3e8521b228: jg 0x00007f3e8521b8a9 ;*ifle
│ │ ; - com.google.re2j.Inst$MatchInst::add@46 (line 103)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% 0.01% │ │ 0x00007f3e8521b22e: mov 0x20(%r11),%ecx ;*getfield denseThreads
│ │ ; - com.google.re2j.Machine$Queue::addThread@1 (line 65)
│ │ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.02% 0.00% │ │ 0x00007f3e8521b232: mov 0xc(%r11),%ebp ;*getfield size
│ │ ; - com.google.re2j.Machine$Queue::addThread@6 (line 65)
│ │ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% │ │ 0x00007f3e8521b236: mov %ebp,%r9d
0.09% 0.06% │ │ 0x00007f3e8521b239: inc %r9d
0.01% 0.00% │ │ 0x00007f3e8521b23c: mov %r9d,0xc(%r11) ;*putfield size
│ │ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ │ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.01% │ │ 0x00007f3e8521b240: mov 0xc(%r12,%rcx,8),%ebx ; implicit exception: dispatches to 0x00007f3e8521bc11
0.01% │ │ 0x00007f3e8521b245: cmp %ebx,%ebp
│ │ 0x00007f3e8521b247: jae 0x00007f3e8521b761 ;*aastore
│ │ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ │ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.09% 0.09% │ │ 0x00007f3e8521b24d: lea (%r12,%rcx,8),%r10 ;*getfield denseThreads
│ │ ; - com.google.re2j.Machine$Queue::addThread@1 (line 65)
│ │ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.00% 0.00% │ │ 0x00007f3e8521b251: lea 0x10(%r10,%rbp,4),%r10
0.01% │ │ 0x00007f3e8521b256: mov %r8d,(%r10)
0.08% 0.01% │ │ 0x00007f3e8521b259: shr $0x9,%r10
0.08% 0.07% │ │ 0x00007f3e8521b25d: movabs $0x7f3e80dee000,%r8
0.00% │ │ 0x00007f3e8521b267: mov %r12b,(%r8,%r10,1) ;*synchronization entry
│ │ ; - com.google.re2j.Machine::step@-1 (line 276)
0.02% 0.02% │ │ 0x00007f3e8521b26b: vmovq %xmm0,%r10
│ │ 0x00007f3e8521b270: mov 0xc(%r10),%ecx ;*getfield size
│ │ ; - com.google.re2j.Machine::step@15 (line 277)
0.05% 0.07% │ │ 0x00007f3e8521b274: mov %ecx,%r10d
0.02% 0.02% │ │ 0x00007f3e8521b277: mov 0x78(%rsp),%ebx
0.01% 0.05% │ │ 0x00007f3e8521b27b: mov 0x80(%rsp),%edi
0.00% │ ╰ 0x00007f3e8521b282: jmpq 0x00007f3e8521b160
↘ 0x00007f3e8521b287: mov 0x78(%rsp),%ebx
0x00007f3e8521b28b: cmp $0x2,%ebx
0x00007f3e8521b28e: je 0x00007f3e8521b495 ;*if_icmpne
; - com.google.re2j.Machine::step@96 (line 288)
0x00007f3e8521b294: mov 0x80(%rsp),%edi ;*aload
; - com.google.re2j.Machine::step@104 (line 289)
0x00007f3e8521b29b: mov 0xc(%r12,%r14,8),%ebp ;*arraylength
; - com.google.re2j.Machine::step@109 (line 289)
; implicit exception: dispatches to 0x00007f3e8521bc5d
0x00007f3e8521b2a0: test %ebp,%ebp
....................................................................................................
45.92% 44.75% <total for region 1>
....[Hottest Region 2]..............................................................................
C2, level 4, com.google.re2j.Inst$Alt5Inst::add, version 505 (1276 bytes)
# parm4: rdi:rdi = 'com/google/re2j/Machine$Thread'
# parm5: [sp+0x70] = 'com/google/re2j/Machine' (sp of caller)
0x00007f3e8521f900: mov 0x8(%rsi),%r10d
0x00007f3e8521f904: shl $0x3,%r10
0x00007f3e8521f908: cmp %r10,%rax
0x00007f3e8521f90b: jne 0x00007f3e85045e20 ; {runtime_call}
0x00007f3e8521f911: data16 xchg %ax,%ax
0x00007f3e8521f914: nopl 0x0(%rax,%rax,1)
0x00007f3e8521f91c: data16 data16 xchg %ax,%ax
[Verified Entry Point]
0.31% 0.31% 0x00007f3e8521f920: mov %eax,-0x14000(%rsp)
0.12% 0.15% 0x00007f3e8521f927: push %rbp
0.19% 0.22% 0x00007f3e8521f928: sub $0x60,%rsp ;*synchronization entry
; - com.google.re2j.Inst$Alt5Inst::add@-1 (line 273)
0.18% 0.14% 0x00007f3e8521f92c: vmovq %rsi,%xmm9
0.04% 0.02% 0x00007f3e8521f931: vmovd %ecx,%xmm1
0.28% 0.25% 0x00007f3e8521f935: mov 0x18(%rsi),%ecx ;*getfield pc
; - com.google.re2j.Inst$Alt5Inst::add@2 (line 273)
0.04% 0.06% 0x00007f3e8521f938: mov 0x10(%rdx),%r10 ;*getfield pcsl
; - com.google.re2j.Machine$Queue::contains@7 (line 47)
; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
; implicit exception: dispatches to 0x00007f3e852205c9
0.09% 0.08% 0x00007f3e8521f93c: cmp $0x40,%ecx
0x00007f3e8521f93f: jg 0x00007f3e85220175 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 46)
; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
0.02% 0.04% 0x00007f3e8521f945: mov $0x1,%r14d
0.16% 0.19% 0x00007f3e8521f94b: mov $0x1,%ebx
0.05% 0.07% 0x00007f3e8521f950: shl %cl,%rbx ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 47)
; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
0.31% 0.31% 0x00007f3e8521f953: mov %r10,%r11
0.07% 0.05% 0x00007f3e8521f956: and %rbx,%r11 ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 47)
; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
0.06% 0.08% 0x00007f3e8521f959: test %r11,%r11
0x00007f3e8521f95c: jne 0x00007f3e852201a9 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 47)
; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
0.04% 0.03% 0x00007f3e8521f962: cmp $0x40,%ecx
0x00007f3e8521f965: jge 0x00007f3e852201ed ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 56)
; - com.google.re2j.Inst$Alt5Inst::add@19 (line 276)
0.22% 0.23% 0x00007f3e8521f96b: mov %r12b,0x18(%rdx) ;*putfield empty
; - com.google.re2j.Machine$Queue::add@33 (line 61)
; - com.google.re2j.Inst$Alt5Inst::add@19 (line 276)
0.05% 0.06% 0x00007f3e8521f96f: mov 0x1c(%rsi),%ebp ;*getfield outInst
; - com.google.re2j.Inst$Alt5Inst::add@23 (line 278)
0.08% 0.12% 0x00007f3e8521f972: or %r10,%rbx ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 57)
; - com.google.re2j.Inst$Alt5Inst::add@19 (line 276)
0.02% 0.02% 0x00007f3e8521f975: mov %rbx,0x10(%rdx) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 57)
; - com.google.re2j.Inst$Alt5Inst::add@19 (line 276)
0.24% 0.24% 0x00007f3e8521f979: mov 0x8(%r12,%rbp,8),%r10d ; implicit exception: dispatches to 0x00007f3e852205dd
0.07% 0.08% 0x00007f3e8521f97e: cmp $0xf8019993,%r10d ; {metadata('com/google/re2j/Inst$RuneInst')}
0x00007f3e8521f985: jne 0x00007f3e8521ff65
0.06% 0.11% 0x00007f3e8521f98b: lea (%r12,%rbp,8),%r11 ;*invokevirtual add
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.03% 0.04% 0x00007f3e8521f98f: mov 0x18(%r11),%r10d ;*getfield pc
; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.22% 0.23% 0x00007f3e8521f993: cmp $0x40,%r10d
0x00007f3e8521f997: jg 0x00007f3e85220221 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 46)
; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.08% 0.07% 0x00007f3e8521f99d: mov $0x1,%esi
0.08% 0.07% 0x00007f3e8521f9a2: mov %r10d,%ecx
0.02% 0.03% 0x00007f3e8521f9a5: shl %cl,%rsi ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 47)
; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.48% 0.33% 0x00007f3e8521f9a8: mov %rbx,%rcx
0.04% 0.04% 0x00007f3e8521f9ab: and %rsi,%rcx ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 47)
; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.25% 0.10% 0x00007f3e8521f9ae: test %rcx,%rcx
0x00007f3e8521f9b1: jne 0x00007f3e85220261 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 47)
; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.07% 0.11% 0x00007f3e8521f9b7: cmp $0x40,%r10d
0x00007f3e8521f9bb: jge 0x00007f3e852202a9 ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 56)
; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.10% 0.16% 0x00007f3e8521f9c1: or %rsi,%rbx ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 57)
; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.04% 0.03% 0x00007f3e8521f9c4: mov %rbx,0x10(%rdx) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 57)
; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.21% 0.12% 0x00007f3e8521f9c8: mov %r11,%r10
0.08% 0.12% 0x00007f3e8521f9cb: shr $0x3,%r10 ;*putfield inst
; - com.google.re2j.Machine::alloc@45 (line 138)
; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.10% 0.17% 0x00007f3e8521f9cf: movabs $0x7f3e80dee000,%r13
0.02% 0.05% 0x00007f3e8521f9d9: test %rdi,%rdi
╭ 0x00007f3e8521f9dc: jne 0x00007f3e8521fe1d ;*ifnonnull
│ ; - com.google.re2j.Inst$MatchInst::add@24 (line 98)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.23% 0.36% │ 0x00007f3e8521f9e2: mov 0x70(%rsp),%rdi
0.07% 0.11% │ 0x00007f3e8521f9e7: mov 0xc(%rdi),%ecx ;*getfield poolSize
│ ; - com.google.re2j.Machine::alloc@1 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
│ ; implicit exception: dispatches to 0x00007f3e852206e9
0.10% 0.15% │ 0x00007f3e8521f9ea: test %ecx,%ecx
│ 0x00007f3e8521f9ec: jle 0x00007f3e8522013d ;*ifle
│ ; - com.google.re2j.Machine::alloc@4 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.04% 0.06% │ 0x00007f3e8521f9f2: vmovd %ecx,%xmm0
0.22% 0.22% │ 0x00007f3e8521f9f6: mov %r11,%rax
0.06% 0.08% │ 0x00007f3e8521f9f9: mov 0x24(%rdi),%r11d ;*getfield pool
│ ; - com.google.re2j.Machine::alloc@18 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.06% 0.13% │ 0x00007f3e8521f9fd: mov %ecx,%ebp
0.04% 0.06% │ 0x00007f3e8521f9ff: dec %ebp ;*isub
│ ; - com.google.re2j.Machine::alloc@13 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.21% 0.25% │ 0x00007f3e8521fa01: mov %ebp,0xc(%rdi) ;*putfield poolSize
│ ; - com.google.re2j.Machine::alloc@14 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.07% 0.02% │ 0x00007f3e8521fa04: mov 0xc(%r12,%r11,8),%ecx ; implicit exception: dispatches to 0x00007f3e852206fd
0.05% 0.09% │ 0x00007f3e8521fa09: cmp %ecx,%ebp
│ 0x00007f3e8521fa0b: jae 0x00007f3e85220041
0.00% 0.05% │ 0x00007f3e8521fa11: lea (%r12,%r11,8),%rcx
0.20% 0.30% │ 0x00007f3e8521fa15: vmovd %xmm0,%r11d
0.09% 0.11% │ 0x00007f3e8521fa1a: mov 0xc(%rcx,%r11,4),%ecx ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.06% 0.08% │ 0x00007f3e8521fa1f: mov %r10d,0x10(%r12,%rcx,8) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
│ ; implicit exception: dispatches to 0x00007f3e8522070d
0.23% 0.20% │ 0x00007f3e8521fa24: lea (%r12,%rcx,8),%rdi ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.15% 0.22% │ 0x00007f3e8521fa28: mov %rdi,%r10
0.03% 0.05% │ 0x00007f3e8521fa2b: shr $0x9,%r10
0.08% 0.07% │ 0x00007f3e8521fa2f: mov %r12b,0x0(%r13,%r10,1) ;*aload_3
│ ; - com.google.re2j.Inst$MatchInst::add@44 (line 103)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.33% 0.34% │ 0x00007f3e8521fa34: mov 0xc(%r8),%ebp ;*arraylength
│ ; - com.google.re2j.Inst$MatchInst::add@45 (line 103)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
│ ; implicit exception: dispatches to 0x00007f3e85220605
0.12% 0.11% │ 0x00007f3e8521fa38: test %ebp,%ebp
│ 0x00007f3e8521fa3a: jg 0x00007f3e852202e9 ;*ifle
│ ; - com.google.re2j.Inst$MatchInst::add@46 (line 103)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.03% 0.03% │ 0x00007f3e8521fa40: mov 0xc(%rdx),%ecx ;*getfield size
│ ; - com.google.re2j.Machine$Queue::addThread@6 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.07% 0.08% │ 0x00007f3e8521fa43: mov 0x20(%rdx),%r10d ;*getfield denseThreads
│ ; - com.google.re2j.Machine$Queue::addThread@1 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.21% 0.16% │ 0x00007f3e8521fa47: vmovd %r10d,%xmm0
0.14% 0.12% │ 0x00007f3e8521fa4c: mov %ecx,0x20(%rsp)
0.02% 0.04% │ 0x00007f3e8521fa50: inc %ecx ;*iadd
│ ; - com.google.re2j.Machine$Queue::addThread@11 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.04% 0.06% │ 0x00007f3e8521fa52: mov %ecx,0xc(%rdx) ;*putfield size
│ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.27% 0.16% │ 0x00007f3e8521fa55: vmovd %ecx,%xmm3
0.13% 0.06% │ 0x00007f3e8521fa59: mov 0xc(%r12,%r10,8),%r11d ; implicit exception: dispatches to 0x00007f3e85220615
0.04% 0.01% │ 0x00007f3e8521fa5e: mov 0x20(%rsp),%ecx
0.42% 0.18% │ 0x00007f3e8521fa62: cmp %r11d,%ecx
│ 0x00007f3e8521fa65: jae 0x00007f3e8521fe32 ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.21% 0.21% │ 0x00007f3e8521fa6b: vmovq %xmm9,%r10
0.12% 0.07% │ 0x00007f3e8521fa70: mov 0x20(%r10),%ebp ;*getfield inst2
│ ; - com.google.re2j.Inst$Alt5Inst::add@41 (line 279)
0.06% 0.03% │ 0x00007f3e8521fa74: mov %rdi,%r10
0.02% 0.05% │ 0x00007f3e8521fa77: shr $0x3,%r10 ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.16% 0.23% │ 0x00007f3e8521fa7b: vmovd %xmm0,%ecx
0.07% 0.19% │ 0x00007f3e8521fa7f: lea (%r12,%rcx,8),%rdi ;*getfield denseThreads
│ ; - com.google.re2j.Machine$Queue::addThread@1 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.07% 0.06% │ 0x00007f3e8521fa83: mov 0x20(%rsp),%esi
0.06% 0.07% │ 0x00007f3e8521fa87: lea 0x10(%rdi,%rsi,4),%rcx
0.26% 0.18% │ 0x00007f3e8521fa8c: mov %r10d,(%rcx)
0.16% 0.13% │ 0x00007f3e8521fa8f: mov %rcx,%r10
0.02% 0.02% │ 0x00007f3e8521fa92: shr $0x9,%r10
0.05% 0.02% │ 0x00007f3e8521fa96: mov %r12b,0x0(%r13,%r10,1) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0.26% 0.36% │ 0x00007f3e8521fa9b: mov 0x8(%r12,%rbp,8),%r10d ; implicit exception: dispatches to 0x00007f3e85220629
0.09% 0.19% │ 0x00007f3e8521faa0: cmp $0xf8019993,%r10d ; {metadata('com/google/re2j/Inst$RuneInst')}
│ 0x00007f3e8521faa7: jne 0x00007f3e8521ff95
0.02% 0.04% │ 0x00007f3e8521faad: lea (%r12,%rbp,8),%r10 ;*invokevirtual add
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.07% 0.07% │ 0x00007f3e8521fab1: vmovq %r10,%xmm2
0.21% 0.26% │ 0x00007f3e8521fab6: mov 0x18(%r10),%ecx ;*getfield pc
│ ; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.09% 0.13% │ 0x00007f3e8521faba: mov %ecx,%eax
0.02% 0.03% │ 0x00007f3e8521fabc: cmp $0x40,%ecx
│ 0x00007f3e8521fabf: jg 0x00007f3e85220319 ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.06% 0.03% │ 0x00007f3e8521fac5: mov $0x1,%r10d
0.26% 0.29% │ 0x00007f3e8521facb: shl %cl,%r10 ;*lshl
│ ; - com.google.re2j.Machine$Queue::contains@12 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.14% 0.22% │ 0x00007f3e8521face: mov %rbx,%rcx
0.23% 0.28% │ 0x00007f3e8521fad1: and %r10,%rcx ;*land
│ ; - com.google.re2j.Machine$Queue::contains@13 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.11% 0.15% │ 0x00007f3e8521fad4: test %rcx,%rcx
│ 0x00007f3e8521fad7: jne 0x00007f3e85220351 ;*ifeq
│ ; - com.google.re2j.Machine$Queue::contains@16 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.01% 0.04% │ 0x00007f3e8521fadd: mov %eax,%ecx
0.04% 0.02% │ 0x00007f3e8521fadf: cmp $0x40,%ecx
│ 0x00007f3e8521fae2: jge 0x00007f3e85220395 ;*if_icmpge
│ ; - com.google.re2j.Machine$Queue::add@3 (line 56)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.22% 0.26% │ 0x00007f3e8521fae8: or %r10,%rbx ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.07% 0.08% │ 0x00007f3e8521faeb: mov %rbx,0x10(%rdx) ;*putfield pcsl
│ ; - com.google.re2j.Machine$Queue::add@15 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.04% 0.01% │ 0x00007f3e8521faef: mov 0x70(%rsp),%r10
0.04% 0.08% │ 0x00007f3e8521faf4: mov 0xc(%r10),%ecx ;*getfield poolSize
│ ; - com.google.re2j.Machine::alloc@1 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
│ ; implicit exception: dispatches to 0x00007f3e8522064d
0.28% 0.30% │ 0x00007f3e8521faf8: vmovd %ecx,%xmm5
0.10% 0.21% │ 0x00007f3e8521fafc: test %ecx,%ecx
│ 0x00007f3e8521fafe: jle 0x00007f3e85220075 ;*ifle
│ ; - com.google.re2j.Machine::alloc@4 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.01% │ 0x00007f3e8521fb04: mov 0x24(%r10),%ecx ;*getfield pool
│ ; - com.google.re2j.Machine::alloc@18 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.05% 0.07% │ 0x00007f3e8521fb08: vmovd %ecx,%xmm4
0.20% 0.24% │ 0x00007f3e8521fb0c: vmovd %xmm5,%ecx
0.15% 0.12% │ 0x00007f3e8521fb10: dec %ecx ;*isub
│ ; - com.google.re2j.Machine::alloc@13 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.02% 0.04% │ 0x00007f3e8521fb12: vmovd %ecx,%xmm6
0.06% 0.09% │ 0x00007f3e8521fb16: mov %ecx,0xc(%r10) ;*putfield poolSize
│ ; - com.google.re2j.Machine::alloc@14 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.23% 0.29% │ 0x00007f3e8521fb1a: vmovd %xmm4,%ecx
0.07% 0.13% │ 0x00007f3e8521fb1e: mov 0xc(%r12,%rcx,8),%esi ; implicit exception: dispatches to 0x00007f3e85220661
0.08% 0.06% │ 0x00007f3e8521fb23: vmovd %xmm6,%r10d
0.05% 0.03% │ 0x00007f3e8521fb28: cmp %esi,%r10d
│ 0x00007f3e8521fb2b: jae 0x00007f3e8521fe65
0.23% 0.28% │ 0x00007f3e8521fb31: lea (%r12,%rcx,8),%rax
0.09% 0.09% │ 0x00007f3e8521fb35: vmovd %xmm5,%r10d
0.00% │ 0x00007f3e8521fb3a: mov 0xc(%rax,%r10,4),%r10d ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.05% 0.06% │ 0x00007f3e8521fb3f: vmovd %r10d,%xmm8
0.23% 0.25% │ 0x00007f3e8521fb44: test %r10d,%r10d
│ 0x00007f3e8521fb47: je 0x00007f3e8521fe9d ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.14% 0.16% │ 0x00007f3e8521fb4d: vmovd %r9d,%xmm12
0.04% 0.02% │ 0x00007f3e8521fb52: vmovq %r8,%xmm10
0.03% 0.07% │ 0x00007f3e8521fb57: vmovq %rdx,%xmm7
0.27% 0.22% │ 0x00007f3e8521fb5c: shl $0x3,%r10
0.11% 0.11% │ 0x00007f3e8521fb60: mov 0x20(%rsp),%r8d
0.03% 0.01% │ 0x00007f3e8521fb65: add $0x2,%r8d
0.03% 0.03% │ 0x00007f3e8521fb69: mov %r8d,0xc(%rdx) ;*putfield size
│ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.25% 0.12% │ 0x00007f3e8521fb6d: mov 0x20(%rsp),%r8d
0.10% 0.13% │ 0x00007f3e8521fb72: add $0x4,%r8d ;*iadd
│ ; - com.google.re2j.Machine$Queue::addThread@11 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.02% 0.05% │ 0x00007f3e8521fb76: shr $0x9,%r10
0.04% 0.05% │ 0x00007f3e8521fb7a: mov %r12b,0x0(%r13,%r10,1)
1.26% 1.17% │ 0x00007f3e8521fb7f: vmovq %xmm2,%r10
0.02% 0.02% │ 0x00007f3e8521fb84: mov %r10,%rcx
0.00% │ 0x00007f3e8521fb87: shr $0x3,%rcx
0.00% 0.00% │ 0x00007f3e8521fb8b: vmovd %xmm8,%r10d
0.38% 0.32% │ 0x00007f3e8521fb90: mov %ecx,0x10(%r12,%r10,8) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.19% 0.22% │ 0x00007f3e8521fb95: cmp %r11d,%r8d
│ 0x00007f3e8521fb98: jae 0x00007f3e8521feb1 ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
│ 0x00007f3e8521fb9e: vmovq %xmm9,%r10
0.00% 0.01% │ 0x00007f3e8521fba3: mov 0x24(%r10),%ebp ;*getfield inst3
│ ; - com.google.re2j.Inst$Alt5Inst::add@59 (line 280)
0.24% 0.40% │ 0x00007f3e8521fba7: movslq 0x20(%rsp),%r10
0.07% 0.06% │ 0x00007f3e8521fbac: lea (%rdi,%r10,4),%r11 ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
│ 0x00007f3e8521fbb0: mov %r11,%r9
0.01% │ 0x00007f3e8521fbb3: add $0x14,%r9
0.25% 0.32% │ 0x00007f3e8521fbb7: vmovd %xmm8,%r10d
0.07% 0.11% │ 0x00007f3e8521fbbc: mov %r10d,(%r9)
│ 0x00007f3e8521fbbf: mov %r9,%r10
0.01% 0.00% │ 0x00007f3e8521fbc2: shr $0x9,%r10
0.40% 0.29% │ 0x00007f3e8521fbc6: mov %r12b,0x0(%r13,%r10,1) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@53 (line 279)
0.06% 0.12% │ 0x00007f3e8521fbcb: mov 0x8(%r12,%rbp,8),%r10d ; implicit exception: dispatches to 0x00007f3e85220675
│ 0x00007f3e8521fbd0: cmp $0xf8019993,%r10d ; {metadata('com/google/re2j/Inst$RuneInst')}
│ 0x00007f3e8521fbd7: jne 0x00007f3e8521ffc1
0.01% 0.00% │ 0x00007f3e8521fbdd: lea (%r12,%rbp,8),%r10 ;*invokevirtual add
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.33% 0.27% │ 0x00007f3e8521fbe1: vmovq %r10,%xmm0
0.09% 0.13% │ 0x00007f3e8521fbe6: mov 0x18(%r10),%ecx ;*getfield pc
│ ; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
│ 0x00007f3e8521fbea: cmp $0x40,%ecx
│ 0x00007f3e8521fbed: jg 0x00007f3e852203cd ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.01% 0.02% │ 0x00007f3e8521fbf3: mov $0x1,%r10d
0.35% 0.34% │ 0x00007f3e8521fbf9: shl %cl,%r10 ;*lshl
│ ; - com.google.re2j.Machine$Queue::contains@12 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.11% 0.10% │ 0x00007f3e8521fbfc: mov %rbx,%r9
0.25% 0.34% │ 0x00007f3e8521fbff: and %r10,%r9 ;*land
│ ; - com.google.re2j.Machine$Queue::contains@13 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.09% 0.12% │ 0x00007f3e8521fc02: test %r9,%r9
│ 0x00007f3e8521fc05: jne 0x00007f3e85220409 ;*ifeq
│ ; - com.google.re2j.Machine$Queue::contains@16 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
│ 0x00007f3e8521fc0b: cmp $0x40,%ecx
│ 0x00007f3e8521fc0e: jge 0x00007f3e85220451 ;*if_icmpge
│ ; - com.google.re2j.Machine$Queue::add@3 (line 56)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.00% │ 0x00007f3e8521fc14: or %r10,%rbx ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.34% 0.28% │ 0x00007f3e8521fc17: mov %rbx,0x10(%rdx) ;*putfield pcsl
│ ; - com.google.re2j.Machine$Queue::add@15 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.09% 0.10% │ 0x00007f3e8521fc1b: vmovd %xmm6,%ecx
0.00% │ 0x00007f3e8521fc1f: test %ecx,%ecx
│ 0x00007f3e8521fc21: jle 0x00007f3e852200a9 ;*ifle
│ ; - com.google.re2j.Machine::alloc@4 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.02% 0.00% │ 0x00007f3e8521fc27: vmovd %xmm5,%r9d
0.30% 0.31% │ 0x00007f3e8521fc2c: add $0xfffffffc,%r9d ;*isub
│ ; - com.google.re2j.Machine::alloc@13 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.09% 0.12% │ 0x00007f3e8521fc30: vmovd %xmm5,%r10d
│ 0x00007f3e8521fc35: add $0xfffffffe,%r10d ;*isub
│ ; - com.google.re2j.Machine::alloc@13 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.00% 0.00% │ 0x00007f3e8521fc39: vmovd %r10d,%xmm3
0.28% 0.41% │ 0x00007f3e8521fc3e: mov 0x70(%rsp),%rcx
0.11% 0.12% │ 0x00007f3e8521fc43: mov %r10d,0xc(%rcx) ;*putfield poolSize
│ ; - com.google.re2j.Machine::alloc@14 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.00% │ 0x00007f3e8521fc47: cmp %esi,%r9d
│ 0x00007f3e8521fc4a: jae 0x00007f3e8521feed
0.00% 0.00% │ 0x00007f3e8521fc50: mov 0x10(%rax,%r10,4),%r10d ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.38% 0.33% │ 0x00007f3e8521fc55: test %r10d,%r10d
│ 0x00007f3e8521fc58: je 0x00007f3e8521ff29 ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.09% 0.07% │ 0x00007f3e8521fc5e: mov %r11,%rcx
0.00% │ 0x00007f3e8521fc61: add $0x18,%rcx
0.01% 0.02% │ 0x00007f3e8521fc65: mov %r10d,(%rcx) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.28% 0.26% │ 0x00007f3e8521fc68: vmovq %xmm9,%rdx
0.06% 0.07% │ 0x00007f3e8521fc6d: mov 0x28(%rdx),%ebp ;*getfield inst4
│ ; - com.google.re2j.Inst$Alt5Inst::add@77 (line 281)
0.04% 0.02% │ 0x00007f3e8521fc70: lea (%r12,%r10,8),%rdx
0.01% │ 0x00007f3e8521fc74: vmovq %xmm0,%rsi
0.30% 0.30% │ 0x00007f3e8521fc79: shr $0x3,%rsi
0.06% 0.06% │ 0x00007f3e8521fc7d: mov %esi,0x10(%r12,%r10,8) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.03% 0.00% │ 0x00007f3e8521fc82: mov 0x20(%rsp),%r10d
0.01% │ 0x00007f3e8521fc87: add $0x3,%r10d
0.24% 0.24% │ 0x00007f3e8521fc8b: vmovq %xmm7,%rsi
0.10% 0.04% │ 0x00007f3e8521fc90: mov %r10d,0xc(%rsi) ;*putfield size
│ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.03% 0.03% │ 0x00007f3e8521fc94: shr $0x9,%rdx
0.01% 0.01% │ 0x00007f3e8521fc98: mov %r12b,0x0(%r13,%rdx,1) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.35% 0.20% │ 0x00007f3e8521fc9d: mov %rcx,%r10
0.09% 0.11% │ 0x00007f3e8521fca0: shr $0x9,%r10
0.03% 0.01% │ 0x00007f3e8521fca4: mov %r12b,0x0(%r13,%r10,1) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@71 (line 280)
0.01% │ 0x00007f3e8521fca9: mov 0x8(%r12,%rbp,8),%r10d ; implicit exception: dispatches to 0x00007f3e85220699
0.39% 0.16% │ 0x00007f3e8521fcae: cmp $0xf8019993,%r10d ; {metadata('com/google/re2j/Inst$RuneInst')}
│ 0x00007f3e8521fcb5: jne 0x00007f3e8521ffed
0.10% 0.06% │ 0x00007f3e8521fcbb: lea (%r12,%rbp,8),%rdx ;*invokevirtual add
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.01% 0.01% │ 0x00007f3e8521fcbf: mov 0x18(%rdx),%ecx ;*getfield pc
│ ; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.00% │ 0x00007f3e8521fcc2: vmovd %ecx,%xmm2
0.31% 0.16% │ 0x00007f3e8521fcc6: cmp $0x40,%ecx
│ 0x00007f3e8521fcc9: jg 0x00007f3e8522048d ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.07% 0.03% │ 0x00007f3e8521fccf: mov $0x1,%r10d
0.01% 0.02% │ 0x00007f3e8521fcd5: shl %cl,%r10 ;*lshl
│ ; - com.google.re2j.Machine$Queue::contains@12 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.43% 0.39% │ 0x00007f3e8521fcd8: mov %rbx,%rcx
0.00% 0.01% │ 0x00007f3e8521fcdb: and %r10,%rcx ;*land
│ ; - com.google.re2j.Machine$Queue::contains@13 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.00% 0.00% │ 0x00007f3e8521fcde: test %rcx,%rcx
│ 0x00007f3e8521fce1: jne 0x00007f3e852204c9 ;*ifeq
│ ; - com.google.re2j.Machine$Queue::contains@16 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.34% 0.43% │ 0x00007f3e8521fce7: vmovd %xmm2,%ecx
0.04% 0.11% │ 0x00007f3e8521fceb: cmp $0x40,%ecx
│ 0x00007f3e8521fcee: jge 0x00007f3e85220511 ;*if_icmpge
│ ; - com.google.re2j.Machine$Queue::add@3 (line 56)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.04% 0.05% │ 0x00007f3e8521fcf4: or %r10,%rbx ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.02% 0.00% │ 0x00007f3e8521fcf7: mov %rbx,0x10(%rsi) ;*putfield pcsl
│ ; - com.google.re2j.Machine$Queue::add@15 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.37% 0.30% │ 0x00007f3e8521fcfb: vmovd %xmm3,%ecx
0.10% 0.05% │ 0x00007f3e8521fcff: test %ecx,%ecx
│ 0x00007f3e8521fd01: jle 0x00007f3e852200e1 ;*ifle
│ ; - com.google.re2j.Machine::alloc@4 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.02% 0.02% │ 0x00007f3e8521fd07: vmovd %xmm5,%ecx
0.02% 0.01% │ 0x00007f3e8521fd0b: add $0xfffffffd,%ecx ;*isub
│ ; - com.google.re2j.Machine::alloc@13 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.32% 0.28% │ 0x00007f3e8521fd0e: vmovd %ecx,%xmm0
0.09% 0.11% │ 0x00007f3e8521fd12: mov 0x70(%rsp),%r10
0.01% 0.04% │ 0x00007f3e8521fd17: mov %ecx,0xc(%r10) ;*putfield poolSize
│ ; - com.google.re2j.Machine::alloc@14 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.00% 0.02% │ 0x00007f3e8521fd1b: mov 0x10(%rax,%rcx,4),%esi ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.27% 0.35% │ 0x00007f3e8521fd1f: test %esi,%esi
│ 0x00007f3e8521fd21: je 0x00007f3e8521ff3d ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.08% 0.12% │ 0x00007f3e8521fd27: vmovq %xmm7,%r10
0.01% 0.03% │ 0x00007f3e8521fd2c: mov %r8d,0xc(%r10) ;*putfield size
│ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.00% 0.02% │ 0x00007f3e8521fd30: vmovq %xmm9,%r10
0.29% 0.34% │ 0x00007f3e8521fd35: mov 0x2c(%r10),%ebp ;*getfield inst5
│ ; - com.google.re2j.Inst$Alt5Inst::add@95 (line 282)
0.10% 0.12% │ 0x00007f3e8521fd39: mov %r11,%r8
0.03% 0.02% │ 0x00007f3e8521fd3c: add $0x1c,%r8
0.01% 0.00% │ 0x00007f3e8521fd40: mov %esi,(%r8) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.28% 0.23% │ 0x00007f3e8521fd43: mov %rdx,%r10
0.07% 0.07% │ 0x00007f3e8521fd46: shr $0x3,%r10
0.01% 0.04% │ 0x00007f3e8521fd4a: mov %r10d,0x10(%r12,%rsi,8)
0.03% 0.01% │ 0x00007f3e8521fd4f: mov %r8,%r10
0.21% 0.51% │ 0x00007f3e8521fd52: lea (%r12,%rsi,8),%r8
0.06% 0.15% │ 0x00007f3e8521fd56: shr $0x9,%r10
0.03% 0.05% │ 0x00007f3e8521fd5a: shr $0x9,%r8
0.01% 0.02% │ 0x00007f3e8521fd5e: mov %r12b,0x0(%r13,%r8,1) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.32% 0.38% │ 0x00007f3e8521fd63: mov %r12b,0x0(%r13,%r10,1) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@89 (line 281)
0.09% 0.09% │ 0x00007f3e8521fd68: mov 0x8(%r12,%rbp,8),%ecx ; implicit exception: dispatches to 0x00007f3e852206c1
0.03% 0.03% │ 0x00007f3e8521fd6d: cmp $0xf8019993,%ecx ; {metadata('com/google/re2j/Inst$RuneInst')}
│ 0x00007f3e8521fd73: jne 0x00007f3e85220019
0.01% 0.00% │ 0x00007f3e8521fd79: lea (%r12,%rbp,8),%r10 ;*invokevirtual add
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.26% 0.25% │ 0x00007f3e8521fd7d: mov 0x18(%r10),%ecx ;*getfield pc
│ ; - com.google.re2j.Inst$MatchInst::add@2 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.11% 0.08% │ 0x00007f3e8521fd81: cmp $0x40,%ecx
│ 0x00007f3e8521fd84: jg 0x00007f3e8522054d ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.04% 0.04% │ 0x00007f3e8521fd8a: mov %r10,%r8
0.03% 0.02% │ 0x00007f3e8521fd8d: shl %cl,%r14 ;*lshl
│ ; - com.google.re2j.Machine$Queue::contains@12 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.37% 0.48% │ 0x00007f3e8521fd90: mov %rbx,%r10
0.00% 0.03% │ 0x00007f3e8521fd93: and %r14,%r10 ;*land
│ ; - com.google.re2j.Machine$Queue::contains@13 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.29% 0.43% │ 0x00007f3e8521fd96: test %r10,%r10
│ 0x00007f3e8521fd99: jne 0x00007f3e85220571 ;*ifeq
│ ; - com.google.re2j.Machine$Queue::contains@16 (line 47)
│ ; - com.google.re2j.Inst$MatchInst::add@5 (line 93)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.15% 0.10% │ 0x00007f3e8521fd9f: cmp $0x40,%ecx
│ 0x00007f3e8521fda2: jge 0x00007f3e852205a5 ;*if_icmpge
│ ; - com.google.re2j.Machine$Queue::add@3 (line 56)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.02% 0.02% │ 0x00007f3e8521fda8: or %r14,%rbx
0.02% 0.02% │ 0x00007f3e8521fdab: vmovq %xmm7,%rcx
0.33% 0.29% │ 0x00007f3e8521fdb0: mov %rbx,0x10(%rcx) ;*putfield pcsl
│ ; - com.google.re2j.Machine$Queue::add@15 (line 57)
│ ; - com.google.re2j.Inst$MatchInst::add@19 (line 96)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.10% 0.09% │ 0x00007f3e8521fdb4: vmovd %xmm0,%r10d
0.02% 0.01% │ 0x00007f3e8521fdb9: test %r10d,%r10d
│ 0x00007f3e8521fdbc: jle 0x00007f3e85220119 ;*ifle
│ ; - com.google.re2j.Machine::alloc@4 (line 132)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.01% 0.02% │ 0x00007f3e8521fdc2: mov 0x70(%rsp),%r10
0.22% 0.26% │ 0x00007f3e8521fdc7: mov %r9d,0xc(%r10) ;*putfield poolSize
│ ; - com.google.re2j.Machine::alloc@14 (line 133)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.10% 0.05% │ 0x00007f3e8521fdcb: mov 0x10(%rax,%r9,4),%r9d ;*aaload
│ ; - com.google.re2j.Machine::alloc@25 (line 134)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.01% 0.00% │ 0x00007f3e8521fdd0: test %r9d,%r9d
│ 0x00007f3e8521fdd3: je 0x00007f3e8521ff51 ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.01% 0.02% │ 0x00007f3e8521fdd9: add $0x20,%r11
0.31% 0.28% │ 0x00007f3e8521fddd: mov %r9d,(%r11) ;*aastore
│ ; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.08% 0.09% │ 0x00007f3e8521fde0: shr $0x3,%r8
0.04% 0.02% │ 0x00007f3e8521fde4: mov %r8d,0x10(%r12,%r9,8) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.01% 0.03% │ 0x00007f3e8521fde9: mov %r11,%r10
0.25% 0.29% │ 0x00007f3e8521fdec: mov 0x20(%rsp),%r11d
0.11% 0.08% │ 0x00007f3e8521fdf1: add $0x5,%r11d
0.04% 0.04% │ 0x00007f3e8521fdf5: mov %r11d,0xc(%rcx) ;*putfield size
│ ; - com.google.re2j.Machine$Queue::addThread@12 (line 65)
│ ; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.01% 0.01% │ 0x00007f3e8521fdf9: shr $0x9,%r10
0.29% 0.42% │ 0x00007f3e8521fdfd: lea (%r12,%r9,8),%r11
0.12% 0.14% │ 0x00007f3e8521fe01: shr $0x9,%r11
0.03% 0.01% │ 0x00007f3e8521fe05: mov %r12b,0x0(%r13,%r11,1) ;*putfield inst
│ ; - com.google.re2j.Machine::alloc@45 (line 138)
│ ; - com.google.re2j.Inst$MatchInst::add@30 (line 99)
│ ; - com.google.re2j.Inst$Alt5Inst::add@107 (line 282)
0.05% 0.04% │ 0x00007f3e8521fe0a: mov %r12b,0x0(%r13,%r10,1) ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 46)
│ ; - com.google.re2j.Inst$Alt5Inst::add@5 (line 273)
0.28% 0.32% │ 0x00007f3e8521fe0f: xor %eax,%eax
0.12% 0.11% │ 0x00007f3e8521fe11: add $0x60,%rsp
0.02% 0.02% │ 0x00007f3e8521fe15: pop %rbp
0.02% 0.01% │ 0x00007f3e8521fe16: test %eax,0x165651e4(%rip) # 0x00007f3e9b785000
│ ; {poll_return}
0.25% 0.23% │ 0x00007f3e8521fe1c: retq
↘ 0x00007f3e8521fe1d: mov %r10d,0x10(%rdi)
0x00007f3e8521fe21: mov %rdi,%r10
0x00007f3e8521fe24: shr $0x9,%r10
0x00007f3e8521fe28: mov %r12b,0x0(%r13,%r10,1) ;*putfield inst
; - com.google.re2j.Inst$MatchInst::add@41 (line 101)
; - com.google.re2j.Inst$Alt5Inst::add@35 (line 278)
0x00007f3e8521fe2d: jmpq 0x00007f3e8521fa34 ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 65)
; - com.google.re2j.Inst$MatchInst::add@74 (line 106)
....................................................................................................
30.89% 32.41% <total for region 2>
....[Hottest Region 3]..............................................................................
C2, level 4, com.google.re2j.Machine::match, version 535 (910 bytes)
; - com.google.re2j.Utils::isWordRune@9 (line 149)
; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
; - com.google.re2j.Machine::match@121 (line 201)
0x00007f3e85239571: mov %ebx,%r10d
0x00007f3e85239574: add $0xffffff9f,%r10d
0x00007f3e85239578: cmp $0x1a,%r10d
0x00007f3e8523957c: jae 0x00007f3e85239b4f ;*iconst_1
; - com.google.re2j.Utils::isWordRune@42 (line 149)
; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
; - com.google.re2j.Machine::match@121 (line 201)
0.01% 0.00% 0x00007f3e85239582: or $0x10,%r9d ;*iload_2
; - com.google.re2j.Utils::emptyOpContext@63 (line 190)
; - com.google.re2j.Machine::match@121 (line 201)
0x00007f3e85239586: mov %r8d,0x30(%rsp)
0.01% 0x00007f3e8523958b: mov %r11d,0x2c(%rsp)
0x00007f3e85239590: mov 0x44(%rsp),%r11d
0x00007f3e85239595: and $0x4,%r11d ;*iand
; - com.google.re2j.Machine::match@147 (line 208)
0x00007f3e85239599: mov %r11d,0x14(%rsp)
0.00% 0x00007f3e8523959e: mov %r13,%r10
0x00007f3e852395a1: shl $0x3,%r10 ;*getfield q1
; - com.google.re2j.Machine::match@53 (line 188)
0x00007f3e852395a5: mov %r10,0x50(%rsp)
0.00% 0x00007f3e852395aa: mov %ebx,0x34(%rsp)
0x00007f3e852395ae: xor %eax,%eax
0x00007f3e852395b0: xor %r10d,%r10d
0.00% 0x00007f3e852395b3: mov %r10d,0x58(%rsp)
0.00% ╭ 0x00007f3e852395b8: jmpq 0x00007f3e85239755
│ 0x00007f3e852395bd: data16 xchg %ax,%ax
0.22% 0.21% │ ↗ 0x00007f3e852395c0: or $0x20,%r8d ;*ior ; - com.google.re2j.Utils::emptyOpContext@61 (line 188)
│ │ ; - com.google.re2j.Machine::match@323 (line 241)
0.08% 0.04% │ │ 0x00007f3e852395c4: mov %r8d,0x5c(%rsp) ;*iload_2
│ │ ; - com.google.re2j.Utils::emptyOpContext@63 (line 190)
│ │ ; - com.google.re2j.Machine::match@323 (line 241)
0.15% 0.09% │ │↗ 0x00007f3e852395c9: mov 0x48(%rsp),%r9
0.06% 0.08% │ ││ 0x00007f3e852395ce: mov 0x10(%r9),%r8d ;*getfield end
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::endPos@1 (line 221)
│ ││ ; - com.google.re2j.Machine::match@345 (line 242)
0.27% 0.30% │ ││ 0x00007f3e852395d2: mov 0x58(%rsp),%ecx
0.10% 0.12% │ ││ 0x00007f3e852395d6: cmp %r8d,%ecx
│╭ ││ 0x00007f3e852395d9: je 0x00007f3e852398e8 ;*if_icmpne
││ ││ ; - com.google.re2j.Machine::match@348 (line 242)
0.12% 0.10% ││ ││ 0x00007f3e852395df: xor %eax,%eax ;*invokespecial step
││ ││ ; - com.google.re2j.Machine::match@356 (line 242)
0.06% 0.04% ││ ││ ↗ 0x00007f3e852395e1: mov %rax,-0x8(%rsp)
0.19% 0.28% ││ ││ │ 0x00007f3e852395e6: mov 0x58(%rsp),%eax
0.06% 0.10% ││ ││ │ 0x00007f3e852395ea: mov %eax,0x1c(%rsp)
0.10% 0.11% ││ ││ │ 0x00007f3e852395ee: mov -0x8(%rsp),%rax
0.08% 0.06% ││ ││ │ 0x00007f3e852395f3: add 0x28(%rsp),%ecx ;*iadd
││ ││ │ ; - com.google.re2j.Machine::match@337 (line 242)
0.17% 0.24% ││ ││ │ 0x00007f3e852395f7: mov %ecx,0x58(%rsp)
0.08% 0.07% ││ ││ │ 0x00007f3e852395fb: mov 0x38(%rsp),%rsi
0.08% 0.09% ││ ││ │ 0x00007f3e85239600: mov 0x20(%rsp),%rdx
0.06% 0.05% ││ ││ │ 0x00007f3e85239605: mov 0x50(%rsp),%rcx
0.17% 0.09% ││ ││ │ 0x00007f3e8523960a: mov 0x1c(%rsp),%r8d
0.06% 0.04% ││ ││ │ 0x00007f3e8523960f: mov 0x58(%rsp),%r9d
0.13% 0.14% ││ ││ │ 0x00007f3e85239614: mov 0x34(%rsp),%edi
0.02% 0.08% ││ ││ │ 0x00007f3e85239618: mov 0x5c(%rsp),%r10d
0.24% 0.26% ││ ││ │ 0x00007f3e8523961d: mov %r10d,(%rsp)
0.08% 0.10% ││ ││ │ 0x00007f3e85239621: mov 0x40(%rsp),%r11d
0.13% 0.09% ││ ││ │ 0x00007f3e85239626: mov %r11d,0x8(%rsp)
0.04% 0.06% ││ ││ │ 0x00007f3e8523962b: mov %eax,0x10(%rsp)
0.22% 0.22% ││ ││ │ 0x00007f3e8523962f: callq 0x00007f3e85046020 ; OopMap{[24]=NarrowOop [32]=Oop [56]=Oop [72]=Oop [80]=Oop off=660}
││ ││ │ ;*invokespecial step
││ ││ │ ; - com.google.re2j.Machine::match@356 (line 242)
││ ││ │ ; {optimized virtual_call}
0.37% 0.15% ││ ││ │ 0x00007f3e85239634: mov 0x38(%rsp),%r10
0.03% 0.01% ││ ││ │ 0x00007f3e85239639: movzbl 0x10(%r10),%eax ;*getfield matched
││ ││ │ ; - com.google.re2j.Machine::match@376 (line 246)
0.02% 0.04% ││ ││ │ 0x00007f3e8523963e: mov 0x28(%rsp),%r8d
0.33% 0.21% ││ ││ │ 0x00007f3e85239643: test %r8d,%r8d
││╭ ││ │ 0x00007f3e85239646: je 0x00007f3e85239906 ;*ifne
│││ ││ │ ; - com.google.re2j.Machine::match@361 (line 243)
0.01% │││ ││ │ 0x00007f3e8523964c: mov 0x28(%r10),%ebx ;*getfield matchcap
│││ ││ │ ; - com.google.re2j.Machine::match@368 (line 246)
0.02% 0.03% │││ ││ │ 0x00007f3e85239650: mov 0xc(%r12,%rbx,8),%ebp ;*arraylength
│││ ││ │ ; - com.google.re2j.Machine::match@371 (line 246)
│││ ││ │ ; implicit exception: dispatches to 0x00007f3e8523a675
0.08% 0.06% │││ ││ │ 0x00007f3e85239655: test %ebp,%ebp
│││ ││ │ 0x00007f3e85239657: jne 0x00007f3e85239d5d ;*ifne
│││ ││ │ ; - com.google.re2j.Machine::match@372 (line 246)
0.36% 0.16% │││ ││ │ 0x00007f3e8523965d: test %eax,%eax
│││ ││ │ 0x00007f3e8523965f: jne 0x00007f3e85239e4d ;*ifeq
│││ ││ │ ; - com.google.re2j.Machine::match@379 (line 246)
│││ ││ │ 0x00007f3e85239665: mov 0x2c(%rsp),%r9d
0.04% 0.04% │││ ││ │ 0x00007f3e8523966a: cmp $0xffffffff,%r9d
│││╭ ││ │ 0x00007f3e8523966e: je 0x00007f3e852398f2 ;*if_icmpeq
││││ ││ │ ; - com.google.re2j.Machine::match@401 (line 254)
0.02% 0.03% ││││ ││ │ 0x00007f3e85239674: mov 0x48(%rsp),%r8
0.32% 0.42% ││││ ││ │ 0x00007f3e85239679: mov 0x10(%r8),%r11d ;*getfield end
││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@9 (line 186)
││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.00% ││││ ││ │ 0x00007f3e8523967d: mov 0x30(%rsp),%r10d
0.02% 0.05% ││││ ││ │ 0x00007f3e85239682: add 0x58(%rsp),%r10d
0.02% 0.02% ││││ ││ │ 0x00007f3e85239687: add 0xc(%r8),%r10d ;*iadd
││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@5 (line 185)
││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.30% 0.38% ││││ ││ │ 0x00007f3e8523968b: cmp %r11d,%r10d
││││╭ ││ │ 0x00007f3e8523968e: jge 0x00007f3e852398d1 ;*if_icmpge
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@12 (line 186)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.03% 0.03% │││││ ││ │ 0x00007f3e85239694: mov 0x14(%r8),%ebp ;*getfield str
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@16 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.02% 0.03% │││││ ││ │ 0x00007f3e85239698: mov 0x8(%r12,%rbp,8),%ecx ; implicit exception: dispatches to 0x00007f3e8523a685
0.15% 0.17% │││││ ││ │ 0x00007f3e8523969d: cmp $0xf80002da,%ecx ; {metadata('java/lang/String')}
│││││ ││ │ 0x00007f3e852396a3: jne 0x00007f3e85239c35
0.35% 0.54% │││││ ││ │ 0x00007f3e852396a9: lea (%r12,%rbp,8),%r9 ;*invokeinterface charAt
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.00% │││││ ││ │ 0x00007f3e852396ad: test %r10d,%r10d
│││││ ││ │ 0x00007f3e852396b0: jl 0x00007f3e85239da9 ;*iflt
│││││ ││ │ ; - java.lang.String::charAt@1 (line 657)
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.04% 0.03% │││││ ││ │ 0x00007f3e852396b6: mov %r10d,%edi
0.02% 0.04% │││││ ││ │ 0x00007f3e852396b9: mov 0xc(%r9),%edx ;*getfield value
│││││ ││ │ ; - java.lang.String::charAt@6 (line 657)
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.31% 0.49% │││││ ││ │ 0x00007f3e852396bd: mov 0xc(%r12,%rdx,8),%ebp ;*arraylength
│││││ ││ │ ; - java.lang.String::charAt@9 (line 657)
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
│││││ ││ │ ; implicit exception: dispatches to 0x00007f3e8523a699
0.76% 0.85% │││││ ││ │ 0x00007f3e852396c2: cmp %ebp,%r10d
│││││ ││ │ 0x00007f3e852396c5: jge 0x00007f3e85239ea1 ;*if_icmplt
│││││ ││ │ ; - java.lang.String::charAt@10 (line 657)
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.43% 0.57% │││││ ││ │ 0x00007f3e852396cb: cmp %ebp,%r10d
│││││ ││ │ 0x00007f3e852396ce: jae 0x00007f3e85239bb9
0.13% 0.11% │││││ ││ │ 0x00007f3e852396d4: lea (%r12,%rdx,8),%r10
0.01% 0.03% │││││ ││ │ 0x00007f3e852396d8: movzwl 0x10(%r10,%rdi,2),%ecx ;*caload
│││││ ││ │ ; - java.lang.String::charAt@27 (line 660)
│││││ ││ │ ; - java.lang.Character::codePointAt@2 (line 4866)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.01% 0.02% │││││ ││ │ 0x00007f3e852396de: cmp $0xd800,%ecx
│││││ ││ │ 0x00007f3e852396e4: jge 0x00007f3e85239f0d ;*if_icmplt
│││││ ││ │ ; - java.lang.Character::isHighSurrogate@3 (line 4729)
│││││ ││ │ ; - java.lang.Character::codePointAt@9 (line 4867)
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.21% 0.34% │││││ ││ │ 0x00007f3e852396ea: shl $0x3,%ecx ;*ishl
│││││ ││ │ ; - com.google.re2j.MachineInput$UTF16Input::step@38 (line 190)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.13% 0.15% │││││ ││ │ 0x00007f3e852396ed: mov %ecx,%r10d
0.02% 0.03% │││││ ││ │ 0x00007f3e852396f0: or $0x1,%r10d
0.33% 0.44% │││││ ││ │ 0x00007f3e852396f4: and $0x7,%ecx
0.08% 0.11% │││││ ││ │ 0x00007f3e852396f7: sar $0x3,%r10d ;*ishr
│││││ ││ │ ; - com.google.re2j.Machine::match@417 (line 256)
0.29% 0.31% │││││ ││ │ 0x00007f3e852396fb: or $0x1,%ecx ;*ior ; - com.google.re2j.MachineInput$UTF16Input::step@41 (line 190)
│││││ ││ │ ; - com.google.re2j.Machine::match@409 (line 255)
0.04% 0.05% │││││ ││ │ 0x00007f3e852396fe: mov 0x2c(%rsp),%r9d ;*aload
│││││ ││ │ ; - com.google.re2j.Machine::match@427 (line 259)
│││││ ││ ↗ │↗ 0x00007f3e85239703: mov %r8,0x48(%rsp)
0.10% 0.04% │││││ ││ │ ││ 0x00007f3e85239708: mov %r9d,0x34(%rsp) ; OopMap{r8=Oop rbx=NarrowOop [32]=Oop [56]=Oop [72]=Oop [80]=Oop off=877}
│││││ ││ │ ││ ;*goto
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@439 (line 262)
0.30% 0.35% │││││ ││ │ ││ 0x00007f3e8523970d: test %eax,0x1654b8ed(%rip) # 0x00007f3e9b785000
│││││ ││ │ ││ ;*goto
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@439 (line 262)
│││││ ││ │ ││ ; {poll}
0.02% 0.07% │││││ ││ │ ││ 0x00007f3e85239713: mov 0x38(%rsp),%r11
│││││ ││ │ ││ 0x00007f3e85239718: mov 0x14(%r11),%r11d ;*getfield re2
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@169 (line 216)
0.06% 0.05% │││││ ││ │ ││ 0x00007f3e8523971c: vmovd %r11d,%xmm3
0.37% 0.30% │││││ ││ │ ││ 0x00007f3e85239721: mov 0x50(%rsp),%r11
0.07% 0.05% │││││ ││ │ ││ 0x00007f3e85239726: shr $0x3,%r11
0.00% │││││ ││ │ ││ 0x00007f3e8523972a: mov %r11d,0x18(%rsp)
0.05% 0.08% │││││ ││ │ ││ 0x00007f3e8523972f: mov 0x5c(%rsp),%r9d
0.31% 0.28% │││││ ││ │ ││ 0x00007f3e85239734: mov 0x20(%rsp),%r11
0.05% 0.04% │││││ ││ │ ││ 0x00007f3e85239739: mov %r11,0x50(%rsp)
0.00% 0.00% │││││ ││ │ ││ 0x00007f3e8523973e: mov 0x30(%rsp),%r11d
0.07% 0.04% │││││ ││ │ ││ 0x00007f3e85239743: mov %r11d,0x28(%rsp)
0.27% 0.46% │││││ ││ │ ││ 0x00007f3e85239748: mov %ecx,0x30(%rsp)
0.05% 0.08% │││││ ││ │ ││ 0x00007f3e8523974c: mov %r10d,0x2c(%rsp)
0.01% │││││ ││ │ ││ 0x00007f3e85239751: vmovd %ebx,%xmm2 ;*aload
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@136 (line 207)
0.01% 0.05% ↘││││ ││ │ ││ 0x00007f3e85239755: mov 0x18(%rsp),%r11d
0.29% 0.34% ││││ ││ │ ││ 0x00007f3e8523975a: movzbl 0x18(%r12,%r11,8),%r11d ; implicit exception: dispatches to 0x00007f3e8523a625
0.07% 0.08% ││││ ││ │ ││ 0x00007f3e85239760: test %r11d,%r11d
││││╭ ││ │ ││ 0x00007f3e85239763: je 0x00007f3e852398b7 ;*ifeq
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@141 (line 207)
0.01% │││││ ││ │ ││ 0x00007f3e85239769: mov 0x14(%rsp),%ebx
0.04% 0.04% │││││ ││ │ ││ 0x00007f3e8523976d: test %ebx,%ebx
│││││ ││ │ ││ 0x00007f3e8523976f: jne 0x00007f3e85239f8d ;*ifeq
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@148 (line 208)
0.25% 0.34% │││││ ││ │ ││ 0x00007f3e85239775: test %eax,%eax
│││││ ││ │ ││ 0x00007f3e85239777: jne 0x00007f3e85239fed ;*ifeq
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@162 (line 212)
0.05% 0.02% │││││ ││ │ ││ 0x00007f3e8523977d: vmovd %xmm3,%r10d
0.00% 0.00% │││││ ││ │ ││ 0x00007f3e85239782: mov 0x24(%r12,%r10,8),%r11d ;*getfield prefix
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@172 (line 216)
│││││ ││ │ ││ ; implicit exception: dispatches to 0x00007f3e8523a6a9
0.04% 0.04% │││││ ││ │ ││ 0x00007f3e85239787: mov 0xc(%r12,%r11,8),%r10d ;*getfield value
│││││ ││ │ ││ ; - java.lang.String::isEmpty@1 (line 635)
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@175 (line 216)
│││││ ││ │ ││ ; implicit exception: dispatches to 0x00007f3e8523a6b9
0.30% 0.27% │││││ ││ │ ││ 0x00007f3e8523978c: mov 0xc(%r12,%r10,8),%ebp ;*arraylength
│││││ ││ │ ││ ; - java.lang.String::isEmpty@4 (line 635)
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@175 (line 216)
│││││ ││ │ ││ ; implicit exception: dispatches to 0x00007f3e8523a6c9
0.39% 0.40% │││││ ││ │ ││ 0x00007f3e85239791: test %ebp,%ebp
│││││ ││ │ ││ 0x00007f3e85239793: jne 0x00007f3e85239f6d ;*aload_0
│││││ ││ │ ││ ; - com.google.re2j.Machine::match@267 (line 233)
0.22% 0.25% │││││ ││↗ │ ││ 0x00007f3e85239799: test %eax,%eax
│││││ │││ │ ││ 0x00007f3e8523979b: jne 0x00007f3e85239cba ;*ifne
│││││ │││ │ ││ ; - com.google.re2j.Machine::match@271 (line 233)
0.00% │││││ │││ │ ││ 0x00007f3e852397a1: mov 0x58(%rsp),%r11d
0.15% 0.11% │││││ │││ │ ││ 0x00007f3e852397a6: test %r11d,%r11d
│││││╭ │││ │ ││ 0x00007f3e852397a9: je 0x00007f3e852398de ;*ifeq
││││││ │││ │ ││ ; - com.google.re2j.Machine::match@275 (line 233)
0.04% 0.07% ││││││ │││ │ ││ 0x00007f3e852397af: mov 0x40(%rsp),%r8d
0.24% 0.23% ││││││ │││ │ ││ 0x00007f3e852397b4: test %r8d,%r8d
││││││ │││ │ ││ 0x00007f3e852397b7: jne 0x00007f3e85239d05 ;*aload_0
││││││ │││ │ ││ ; - com.google.re2j.Machine::match@282 (line 236)
0.01% 0.00% ││││││ │││ │↗││ 0x00007f3e852397bd: vmovd %xmm2,%r10d
0.08% 0.13% ││││││ │││ ││││ 0x00007f3e852397c2: mov 0xc(%r12,%r10,8),%ebp ;*arraylength
││││││ │││ ││││ ; - com.google.re2j.Machine::match@286 (line 236)
││││││ │││ ││││ ; implicit exception: dispatches to 0x00007f3e8523a635
0.06% 0.05% ││││││ │││ ││││ 0x00007f3e852397c7: test %ebp,%ebp
││││││ │││ ││││ 0x00007f3e852397c9: jg 0x00007f3e85239e29 ;*ifle
││││││ │││ ││││ ; - com.google.re2j.Machine::match@287 (line 236)
0.19% 0.19% ││││││ │││ ││││ 0x00007f3e852397cf: mov 0x38(%rsp),%rdx
0.02% 0.01% ││││││ │││ ││││ 0x00007f3e852397d4: mov 0x18(%rdx),%edi ;*getfield prog
││││││ │││ ││││ ; - com.google.re2j.Machine::match@298 (line 239)
0.11% 0.09% ││││││ │││ ││││ 0x00007f3e852397d7: mov 0x1c(%r12,%rdi,8),%ebp ;*getfield startInst
││││││ │││ ││││ ; - com.google.re2j.Machine::match@301 (line 239)
││││││ │││ ││││ ; implicit exception: dispatches to 0x00007f3e8523a645
0.03% 0.04% ││││││ │││ ││││ 0x00007f3e852397dc: mov 0x8(%r12,%rbp,8),%ecx ; implicit exception: dispatches to 0x00007f3e8523a655
0.18% 0.33% ││││││ │││ ││││ 0x00007f3e852397e1: cmp $0xf8019a53,%ecx ; {metadata('com/google/re2j/Inst$Alt5Inst')}
││││││ │││ ││││ 0x00007f3e852397e7: jne 0x00007f3e85239b6f ;*invokevirtual add
││││││ │││ ││││ ; - com.google.re2j.Machine::match@315 (line 239)
0.09% 0.06% ││││││ │││ ││││ 0x00007f3e852397ed: mov %ebx,0x14(%rsp)
0.07% 0.05% ││││││ │││ ││││ 0x00007f3e852397f1: mov %r8d,0x40(%rsp) ;*ifle
││││││ │││ ││││ ; - com.google.re2j.Machine::match@287 (line 236)
0.02% 0.04% ││││││ │││ ││││ 0x00007f3e852397f6: lea (%r12,%rbp,8),%rsi ;*invokevirtual add
││││││ │││ ││││ ; - com.google.re2j.Machine::match@315 (line 239)
0.20% 0.16% ││││││ │││ ││││ 0x00007f3e852397fa: mov 0x18(%rsp),%r11d
0.04% 0.05% ││││││ │││ ││││ 0x00007f3e852397ff: shl $0x3,%r11 ;*aload
││││││ │││ ││││ ; - com.google.re2j.Machine::match@136 (line 207)
0.08% 0.03% ││││││ │││ ││││ 0x00007f3e85239803: mov %r11,0x20(%rsp)
0.04% 0.01% ││││││ │││ ││││ 0x00007f3e85239808: mov %r10,%r8
0.26% 0.20% ││││││ │││ ││││ 0x00007f3e8523980b: shl $0x3,%r8 ;*getfield matchcap
││││││ │││ ││││ ; - com.google.re2j.Machine::match@283 (line 236)
0.07% 0.04% ││││││ │││ ││││ 0x00007f3e8523980f: mov %r11,%rdx
0.11% 0.03% ││││││ │││ ││││ 0x00007f3e85239812: mov 0x58(%rsp),%ecx
0.02% 0.02% ││││││ │││ ││││ 0x00007f3e85239816: xor %edi,%edi
0.25% 0.18% ││││││ │││ ││││ 0x00007f3e85239818: mov 0x38(%rsp),%r10
0.08% 0.05% ││││││ │││ ││││ 0x00007f3e8523981d: mov %r10,(%rsp)
0.11% 0.02% ││││││ │││ ││││ 0x00007f3e85239821: xchg %ax,%ax
0.03% 0.07% ││││││ │││ ││││ 0x00007f3e85239823: callq 0x00007f3e85046020 ; OopMap{[24]=NarrowOop [32]=Oop [56]=Oop [72]=Oop [80]=Oop off=1160}
││││││ │││ ││││ ;*invokevirtual add
││││││ │││ ││││ ; - com.google.re2j.Machine::match@315 (line 239)
││││││ │││ ││││ ; {optimized virtual_call}
0.10% 0.12% ││││││ │││ ││││ 0x00007f3e85239828: mov 0x34(%rsp),%r10d
0.09% 0.07% ││││││ │││ ││││ 0x00007f3e8523982d: test %r10d,%r10d
││││││╭ │││ ││││ 0x00007f3e85239830: jl 0x00007f3e852398c6 ;*ifge
│││││││ │││ ││││ ; - com.google.re2j.Utils::emptyOpContext@3 (line 173)
│││││││ │││ ││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.23% 0.43% │││││││ │││ ││││ 0x00007f3e85239836: xor %r8d,%r8d ;*iload_0
│││││││ │││ ││││ ; - com.google.re2j.Utils::emptyOpContext@10 (line 176)
│││││││ │││ ││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.10% 0.15% │││││││ │││ ↗││││ 0x00007f3e85239839: cmp $0xa,%r10d
│││││││ │││ │││││ 0x00007f3e8523983d: je 0x00007f3e85239ad2 ;*iload_1
│││││││ │││ │││││ ; - com.google.re2j.Utils::emptyOpContext@20 (line 179)
│││││││ │││ │││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.03% 0.03% │││││││ │││ │││││ 0x00007f3e85239843: mov 0x2c(%rsp),%r11d
0.02% 0.04% │││││││ │││ │││││ 0x00007f3e85239848: test %r11d,%r11d
│││││││╭ │││ │││││ 0x00007f3e8523984b: jl 0x00007f3e852398c0 ;*iload_1
││││││││ │││ │││││ ; - com.google.re2j.Utils::emptyOpContext@29 (line 182)
││││││││ │││ │││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.32% 0.38% ││││││││ │││↗│││││ 0x00007f3e8523984d: cmp $0xa,%r11d
││││││││ │││││││││ 0x00007f3e85239851: je 0x00007f3e85239adb ;*iload_0
││││││││ │││││││││ ; - com.google.re2j.Utils::emptyOpContext@39 (line 185)
││││││││ │││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.10% 0.08% ││││││││ │││││││││ 0x00007f3e85239857: mov 0x34(%rsp),%r9d
0.04% 0.04% ││││││││ │││││││││ 0x00007f3e8523985c: add $0xffffffbf,%r9d
0.02% 0.06% ││││││││ │││││││││ 0x00007f3e85239860: cmp $0x1a,%r9d
││││││││╭ │││││││││ 0x00007f3e85239864: jb 0x00007f3e85239876 ;*if_icmple
│││││││││ │││││││││ ; - com.google.re2j.Utils::isWordRune@9 (line 149)
│││││││││ │││││││││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
│││││││││ │││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.32% 0.29% │││││││││ │││││││││ 0x00007f3e85239866: mov 0x34(%rsp),%ecx
0.11% 0.13% │││││││││ │││││││││ 0x00007f3e8523986a: add $0xffffff9f,%ecx
0.02% 0.02% │││││││││ │││││││││ 0x00007f3e8523986d: cmp $0x1a,%ecx
│││││││││ │││││││││ 0x00007f3e85239870: jae 0x00007f3e85239ae4 ;*iconst_1
│││││││││ │││││││││ ; - com.google.re2j.Utils::isWordRune@42 (line 149)
│││││││││ │││││││││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
│││││││││ │││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.04% 0.04% ││││││││↘ │││││││││ 0x00007f3e85239876: mov $0x1,%ebp ;*ireturn
││││││││ │││││││││ ; - com.google.re2j.Utils::isWordRune@47 (line 149)
││││││││ │││││││││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
││││││││ │││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.21% 0.24% ││││││││ │││││││││ 0x00007f3e8523987b: mov 0x2c(%rsp),%r9d
0.09% 0.09% ││││││││ │││││││││ 0x00007f3e85239880: add $0xffffffbf,%r9d
0.06% 0.04% ││││││││ │││││││││ 0x00007f3e85239884: cmp $0x1a,%r9d
││││││││ ╭│││││││││ 0x00007f3e85239888: jb 0x00007f3e8523989a ;*if_icmple
││││││││ ││││││││││ ; - com.google.re2j.Utils::isWordRune@9 (line 149)
││││││││ ││││││││││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
││││││││ ││││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.08% 0.09% ││││││││ ││││││││││ 0x00007f3e8523988a: mov 0x2c(%rsp),%ecx
0.21% 0.26% ││││││││ ││││││││││ 0x00007f3e8523988e: add $0xffffff9f,%ecx
0.11% 0.09% ││││││││ ││││││││││ 0x00007f3e85239891: cmp $0x1a,%ecx
││││││││ ││││││││││ 0x00007f3e85239894: jae 0x00007f3e85239b08 ;*iconst_1
││││││││ ││││││││││ ; - com.google.re2j.Utils::isWordRune@42 (line 149)
││││││││ ││││││││││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
││││││││ ││││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.04% 0.04% ││││││││ ↘│││││││││ 0x00007f3e8523989a: mov $0x1,%r9d ;*ireturn
││││││││ │││││││││ ; - com.google.re2j.Utils::isWordRune@47 (line 149)
││││││││ │││││││││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
││││││││ │││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.19% 0.16% ││││││││ │││││││││ 0x00007f3e852398a0: cmp %r9d,%ebp
││││││││ ╰││││││││ 0x00007f3e852398a3: je 0x00007f3e852395c0 ;*if_icmpeq
││││││││ ││││││││ ; - com.google.re2j.Utils::emptyOpContext@47 (line 185)
││││││││ ││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.03% 0.05% ││││││││ ││││││││ 0x00007f3e852398a9: or $0x10,%r8d ;*ior ; - com.google.re2j.Utils::emptyOpContext@53 (line 186)
││││││││ ││││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.01% ││││││││ ││││││││ 0x00007f3e852398ad: mov %r8d,0x5c(%rsp)
0.04% 0.03% ││││││││ ╰│││││││ 0x00007f3e852398b2: jmpq 0x00007f3e852395c9
││││↘│││ │││││││ 0x00007f3e852398b7: mov 0x14(%rsp),%ebx
0.02% 0.00% ││││ │││ ╰││││││ 0x00007f3e852398bb: jmpq 0x00007f3e85239799
0.01% 0.00% ││││ ││↘ ││││││ 0x00007f3e852398c0: or $0xa,%r8d ;*ior ; - com.google.re2j.Utils::emptyOpContext@27 (line 180)
││││ ││ ││││││ ; - com.google.re2j.Machine::match@323 (line 241)
0.00% ││││ ││ ╰│││││ 0x00007f3e852398c4: jmp 0x00007f3e8523984d
0.02% ││││ │↘ │││││ 0x00007f3e852398c6: mov $0x5,%r8d
││││ │ ╰││││ 0x00007f3e852398cc: jmpq 0x00007f3e85239839
0.00% │││↘ │ ││││ 0x00007f3e852398d1: mov $0xffffffff,%r10d
0.00% │││ │ ││││ 0x00007f3e852398d7: xor %ecx,%ecx
│││ │ ╰│││ 0x00007f3e852398d9: jmpq 0x00007f3e85239703
│││ ↘ │││ 0x00007f3e852398de: mov 0x40(%rsp),%r8d
0.00% │││ ╰││ 0x00007f3e852398e3: jmpq 0x00007f3e852397bd
↘││ ││ 0x00007f3e852398e8: mov $0x1,%eax
││ ╰│ 0x00007f3e852398ed: jmpq 0x00007f3e852395e1
│↘ │ 0x00007f3e852398f2: mov 0x30(%rsp),%ecx
0.00% 0.01% │ │ 0x00007f3e852398f6: mov $0xffffffff,%r10d
│ │ 0x00007f3e852398fc: mov 0x48(%rsp),%r8
│ ╰ 0x00007f3e85239901: jmpq 0x00007f3e85239703
↘ 0x00007f3e85239906: mov 0x50(%rsp),%r10
0.00% 0x00007f3e8523990b: mov %r10,0x18(%rsp)
0.00% 0x00007f3e85239910: mov 0xc(%r10),%ebx ;*getfield size
; - com.google.re2j.Machine::freeQueue@1 (line 148)
; - com.google.re2j.Machine::freeQueue@3 (line 144)
; - com.google.re2j.Machine::match@445 (line 263)
; implicit exception: dispatches to 0x00007f3e8523a731
0x00007f3e85239914: test %ebx,%ebx
0x00007f3e85239916: jle 0x00007f3e85239a9b ;*ifle
; - com.google.re2j.Machine::freeQueue@8 (line 149)
; - com.google.re2j.Machine::freeQueue@3 (line 144)
; - com.google.re2j.Machine::match@445 (line 263)
0x00007f3e8523991c: mov 0x38(%rsp),%r10
....................................................................................................
16.98% 18.11% <total for region 3>
....[Hottest Regions]...............................................................................
45.92% 44.75% C2, level 4 com.google.re2j.Machine::step, version 495 (674 bytes)
30.89% 32.41% C2, level 4 com.google.re2j.Inst$Alt5Inst::add, version 505 (1276 bytes)
16.98% 18.11% C2, level 4 com.google.re2j.Machine::match, version 535 (910 bytes)
1.86% 1.85% [kernel.kallsyms] [unknown] (0 bytes)
0.98% 0.23% C2, level 4 com.google.re2j.Machine::init, version 538 (289 bytes)
0.34% 0.45% C2, level 4 com.google.re2j.Machine::match, version 535 (141 bytes)
0.21% 0.01% C2, level 4 com.google.re2j.Machine::init, version 538 (89 bytes)
0.16% 0.05% C2, level 4 com.google.re2j.Machine::init, version 538 (66 bytes)
0.11% 0.03% [kernel.kallsyms] [unknown] (53 bytes)
0.09% 0.00% [kernel.kallsyms] [unknown] (70 bytes)
0.08% 0.08% C2, level 4 com.google.re2j.RE2::match, version 552 (25 bytes)
0.06% 0.03% C2, level 4 com.google.re2j.RE2::match, version 552 (0 bytes)
0.06% 0.01% [kernel.kallsyms] [unknown] (0 bytes)
0.06% C2, level 4 com.google.re2j.RE2::match, version 552 (61 bytes)
0.05% 0.02% [kernel.kallsyms] [unknown] (32 bytes)
0.05% C2, level 4 com.google.re2j.RE2::match, version 552 (103 bytes)
0.05% 0.05% C2, level 4 com.google.re2j.RE2::match, version 552 (12 bytes)
0.05% 0.04% C2, level 4 com.google.re2j.RE2::match, version 552 (8 bytes)
0.05% 0.03% C2, level 4 com.google.re2j.Machine::match, version 535 (77 bytes)
0.04% 0.03% C2, level 4 java.util.Collections::shuffle, version 559 (27 bytes)
1.89% 1.78% <...other 382 warm regions...>
....................................................................................................
100.00% 100.00% <totals>
....[Hottest Methods (after inlining)]..............................................................
45.93% 44.76% C2, level 4 com.google.re2j.Machine::step, version 495
30.89% 32.41% C2, level 4 com.google.re2j.Inst$Alt5Inst::add, version 505
17.44% 18.63% C2, level 4 com.google.re2j.Machine::match, version 535
2.89% 2.73% [kernel.kallsyms] [unknown]
1.38% 0.29% C2, level 4 com.google.re2j.Machine::init, version 538
0.42% 0.23% C2, level 4 com.google.re2j.RE2::match, version 552
0.12% 0.05% C2, level 4 java.util.Collections::shuffle, version 559
0.09% 0.01% C2, level 4 com.github.arnaudroger.re2j.generated.Re2jFindRegex_testExp2_jmhTest::testExp2_thrpt_jmhStub, version 611
0.06% 0.05% hsdis-amd64.so [unknown]
0.04% 0.02% [vdso] [unknown]
0.03% 0.09% libjvm.so _ZN13RelocIterator10initializeEP7nmethodPhS2_
0.03% 0.03% libjvm.so _ZN18PSPromotionManager22copy_to_survivor_spaceILb0EEEP7oopDescS2_
0.03% 0.00% libjvm.so _ZN19GenericTaskQueueSetI17OverflowTaskQueueI8StarTaskL10MemoryType1ELj131072EELS2_1EE15steal_best_of_2EjPiRS1_
0.03% 0.06% libc-2.26.so _IO_fwrite
0.03% 0.07% libc-2.26.so vfprintf
0.02% libc-2.26.so __strchrnul_avx2
0.02% 0.01% libpthread-2.26.so __libc_write
0.02% libc-2.26.so _IO_file_xsputn@@GLIBC_2.2.5
0.02% 0.02% libc-2.26.so __strlen_avx2
0.02% 0.04% libjvm.so _ZN10fileStream5writeEPKcm
0.48% 0.29% <...other 71 warm methods...>
....................................................................................................
100.00% 99.80% <totals>
....[Distribution by Source]........................................................................
96.30% 96.41% C2, level 4
2.89% 2.73% [kernel.kallsyms]
0.40% 0.48% libjvm.so
0.20% 0.24% libc-2.26.so
0.07% 0.05% hsdis-amd64.so
0.06% 0.03% libpthread-2.26.so
0.04% 0.02% [vdso]
0.02% 0.00% interpreter
0.01% 0.01% runtime stub
0.01% 0.01% C1, level 3
....................................................................................................
100.00% 100.00% <totals>
# Run complete. Total time: 00:00:45
Benchmark Mode Cnt Score Error Units
Re2jFindRegex.testExp2 thrpt 20 11792.585 ± 48.652 ops/s
Re2jFindRegex.testExp2:·asm thrpt NaN ---
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x17970, %r14
nop
nop
nop
nop
nop
and $56633, %r10
movw $0x6162, (%r14)
nop
nop
sub $18108, %rcx
lea addresses_D_ht+0xadb2, %r13
nop
nop
nop
dec %rsi
mov (%r13), %r11
and $31891, %r13
lea addresses_normal_ht+0x19b0a, %rsi
nop
nop
nop
nop
nop
and $48352, %rcx
mov (%rsi), %r11w
nop
xor $49953, %r15
lea addresses_D_ht+0x1552, %rsi
lea addresses_D_ht+0xa392, %rdi
clflush (%rsi)
nop
nop
nop
nop
and $28895, %r15
mov $123, %rcx
rep movsw
add %r14, %r14
lea addresses_WT_ht+0x1a000, %r15
dec %rdi
movw $0x6162, (%r15)
nop
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_UC_ht+0x14499, %r10
nop
nop
dec %r13
mov (%r10), %edi
xor %r15, %r15
lea addresses_UC_ht+0x179de, %r15
nop
nop
nop
nop
nop
xor %r13, %r13
mov (%r15), %r14
nop
nop
nop
nop
nop
xor $47907, %rdi
lea addresses_UC_ht+0x8152, %r11
nop
nop
nop
nop
dec %r13
mov (%r11), %esi
nop
nop
nop
dec %r14
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rax
push %rcx
push %rdx
// Store
lea addresses_PSE+0x11d92, %r14
nop
nop
nop
xor $27646, %r11
movb $0x51, (%r14)
nop
and $37853, %rdx
// Store
lea addresses_UC+0xc452, %r8
nop
nop
nop
nop
nop
inc %r12
movb $0x51, (%r8)
nop
nop
xor %r8, %r8
// Faulty Load
lea addresses_UC+0x1a952, %rdx
nop
nop
nop
nop
and $49631, %rax
mov (%rdx), %r12
lea oracles, %r11
and $0xff, %r12
shlq $12, %r12
mov (%r11,%r12,1), %r12
pop %rdx
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'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
*/
|
//
// Created by M_D_Luffy on 2018/6/20.
//
#ifndef ILLUMINATIONMODEL_CAMERA_HPP
#define ILLUMINATIONMODEL_CAMERA_HPP
#include <glm/glm.hpp>
#include <cmath>
using namespace glm;
class Camera {
public:
int height;
int width;
float pixel_size;
float image_distance;
float angle;
vec3 origin;
Camera(int h, int w, float p, float i, float a, vec3 o):
height(h), width(w), pixel_size(p), image_distance(i), angle(a), origin(o) {}
vec3 ray_direction(int i, int j) {
float v_offset = (i - float(height - 1) / 2) * pixel_size;
float x = - image_distance * cos(angle) + v_offset * sin(angle);
float y = (j - float(width - 1) / 2) * pixel_size;
float z = - image_distance * sin(angle) - v_offset * cos(angle);
return vec3(x, y, z);
}
};
#endif //ILLUMINATIONMODEL_CAMERA_HPP
|
// IntegrityIO.cpp : Implementation of CIntegrityIOApp and DLL registration.
#include "stdafx.h"
#include "IntegrityIO.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CIntegrityIOApp NEAR theApp;
const GUID CDECL BASED_CODE _tlid =
{ 0xcbe068b4, 0xc05c, 0x49d7, { 0x9b, 0x1d, 0x44, 0xae, 0x40, 0x69, 0xaf, 0x4c } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;
////////////////////////////////////////////////////////////////////////////
// CIntegrityIOApp::InitInstance - DLL initialization
BOOL CIntegrityIOApp::InitInstance()
{
BOOL bInit = COleControlModule::InitInstance();
if (bInit)
{
// TODO: Add your own module initialization code here.
}
return bInit;
}
////////////////////////////////////////////////////////////////////////////
// CIntegrityIOApp::ExitInstance - DLL termination
int CIntegrityIOApp::ExitInstance()
{
// TODO: Add your own module termination code here.
return COleControlModule::ExitInstance();
}
/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
return ResultFromScode(SELFREG_E_TYPELIB);
if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);
return NOERROR;
}
/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
return ResultFromScode(SELFREG_E_TYPELIB);
if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
return ResultFromScode(SELFREG_E_CLASS);
return NOERROR;
}
|
.include "myTiny13.h"
; This Programm analysed 2 bytes to make a sequence of numbers
; who represents the LEDs, which have to be ON :
;
; Positions (0=off)
; ---------------------
; 11,10, 9, 8
; 15,14,13,12
; 23,22,21,20
; 19,18,17,16
; Register to Load up- and down-Byte
U = 18
D = 19
; Like up- and down-Byte, but used for a LetterMix
H = 21
L = 23
Main:
;initial values
ldi A, 0b00011111 ; up , down / 7 - 0
out DDRB, A
; start mix
ldi ZL, lo8(SY_SPACE)
ldi ZH, hi8(SY_SPACE)
rcall Preload1
ldi ZL, lo8(SY_W)
ldi ZH, hi8(SY_W)
rcall Preload2
rcall MixIt
; end mix
; start mix
ldi ZL, lo8(SY_W)
ldi ZH, hi8(SY_W)
rcall Preload1
ldi ZL, lo8(SY_ee)
ldi ZH, hi8(SY_ee)
rcall Preload2
rcall MixIt
; end mix
; start mix
ldi ZL, lo8(SY_ee)
ldi ZH, hi8(SY_ee)
rcall Preload1
ldi ZL, lo8(SY_ll)
ldi ZH, hi8(SY_ll)
rcall Preload2
rcall MixIt
; end mix
; start mix
ldi ZL, lo8(SY_ll)
ldi ZH, hi8(SY_ll)
rcall Preload1
ldi ZL, lo8(SY_tt)
ldi ZH, hi8(SY_tt)
rcall Preload2
rcall MixIt
; end mix
; start mix
ldi ZL, lo8(SY_tt)
ldi ZH, hi8(SY_tt)
rcall Preload1
ldi ZL, lo8(SY_SPACE)
ldi ZH, hi8(SY_SPACE)
rcall Preload2
rcall MixIt
; end mix
rjmp Main
;subroutine +++++++++++++++++++++++++++++++++++++++++++++++++
; Example Byte U and H
; <<
; 7654 7654
; 3210 3210
; D L
MixIt:
ldi N,4 ; hm, first and last is the same? Make a space-line?
NextStep:
ldi A,0b10000000 ; routine for U(3) := H(7)
and A,H ; if Zero, then the bit was set!
brne SetU3
cbr U,0b00001000 ; clear U(3)
rjmp U3Ready
SetU3:
sbr U,0b00001000
U3Ready:
lsl U ; result Letter(Up Byte) move left
lsl H ; source Letter(Up Byte) move left
ldi A,0b00010000 ; routine for U(0) := H(4)
and A,H ; if Zero, then the bit was set!
brne SetU0
cbr U,0b00000001 ; clear U(0)
rjmp U0Ready
SetU0:
sbr U,0b00000001
U0Ready:
; and now :-/ the same for the 2nd byte
ldi A,0b10000000 ; routine for D(3) := L(7)
and A,L ; if Zero, then the bit was set!
brne SetD3
cbr D,0b00001000 ; clear D(3)
rjmp D3Ready
SetD3:
sbr D,0b00001000
D3Ready:
lsl D ; result Letter(down Byte) move left
lsl L ; source Letter(down Byte) move left
ldi A,0b00010000 ; routine for D(0) := L(4)
and A,L ; if Zero, then the bit was set!
brne SetD0
cbr D,0b00000001 ; clear D(0)
rjmp D0Ready
SetD0:
sbr D,0b00000001
D0Ready:
; now its time to show mix
push N ; save
rcall Show
pop N ; restore
dec N
brne NextStep
ret
;subroutine +++++++++++++++++++++++++++++++++++++++++++++++++
Preload1:
lpm
mov U,r0
adiw Z, 1
lpm
mov D,r0
ret
;subroutine +++++++++++++++++++++++++++++++++++++++++++++++++
Preload2:
lpm
mov H,r0
adiw Z, 1
lpm
mov L,r0
ret
;subroutine +++++++++++++++++++++++++++++++++++++++++++++++++
Show:
ldi XH, 2 ; X for a Letter-Loop
ldi XL, 0
LetterLoop:
ldi I, 0
ldi N, 11 ; we need N to calculate number for LED
ByteLoop:
inc I
; if I = 1 : use mov A, RegUP
; if I = 2 : use mov A, RegDN
; if I = 3 : Loop The Letter
cpi I, 1
brne Qis2nd
mov A, U
Qis2nd:
cpi I, 2
brne Qis3rd
mov A, D
Qis3rd:
cpi I, 3 ; is the final second byte still loaded?
breq MakeLLoop ; Make a Letter-Loop Descission
; ByteAnalyse START -----------------------------------------
Analyse:
rol A ; move highest bit to carry
brcs CalcByte ; branch if carry set, else
ldi B, 0 ; set output to Zero and ...
out PORTB, B
rjmp LineOne ; .. do not make CalcByte
CalcByte: ; ok, Carry is set so we have to do something
out PORTB, N
LineOne:
cpi N, 8 ; if 8, we have to go to next LED-Line (N=15)
brne LineTwo
ldi N, 16 ; need +1 because of dec
rjmp NextBitEnd ; end
LineTwo:
cpi N, 12 ; if 12, we have to go to next LED-Line (N=23)
brne LineThreeFour
ldi N, 23
rjmp ByteLoop
LineThreeFour:
cpi N, 16 ; if 16, we have the last LED reached
breq MakeLLoop ; jump out of the Analyse Loop
NextBitEnd:
dec N
rjmp Analyse
; ByteAnalyse END ------------------------------------------
MakeLLoop:
sbiw X, 1
brne LetterLoop
ret
.include "symbols_small.h"
|
HIGH_SCORE_ZERO_POS = $7090
X_STEP_LETTERS = 20
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
display_highscore
jsr init_objects
jsr spawnStarfield
ldd #PC_SCORE
std NEXT_OBJECT,u
jsr spawnStarfield
ldd #PC_SCORE
std NEXT_OBJECT,u
jsr spawnStarfield
ldd #PC_SCORE
std NEXT_OBJECT,u
jsr spawnStarfield
ldd #PC_SCORE
std NEXT_OBJECT,u
jsr spawnStarfield
ldd #PC_SCORE
std NEXT_OBJECT,u
display_highscore_intern
jsr decode_ym_1_channel
jsr Wait_Recal
ldx RecalCounter ; recal counter, about 21 Minutes befor roll over
leax 1,x
stx RecalCounter
_DP_TO_D0 ; round_startup_main expects dp set to d0
JSR do_ym_sound2_no_sfx
jsr Intensity_5F
ldd #HIGH_SCORE_ZERO_POS
std tmp1
lda #5
sta tmp_count
ldy #highScoreBlock
next_score_entry
lda #3
sta tmp_count2
next_name_letter
_SCALE (SCALE_FACTOR_GAME) ; everything we do with "positioning" is scale SCALE_FACTOR_GAME
ldd tmp1 ; the current move vector
MY_MOVE_TO_D_START_NT
LDB ,y+ ; first char of three letter name
; lets calculate the abc-table offset...
SUBB # 'A' ; subtract smallest letter, so A has 0 offset
LSLB ; multiply by two, since addresses are 16 bit
ldx #_abc ; and add the abc (table of vector list address of the alphabet's letters)
LDX b,X ; in x now address of first letter vectorlist
_SCALE 24 ; (SCROLL_SCALE_FACTOR) ; drawing of letters is done in SCROLL_SCALE_FACTOR
lda mov_x
adda #X_STEP_LETTERS
sta mov_x
MY_MOVE_TO_B_END
jsr myDraw_VL_mode3
_ZERO_VECTOR_BEAM ; draw each letter with a move from zero, more stable
dec tmp_count2
bne next_name_letter
lda mov_x
adda #2*X_STEP_LETTERS
sta mov_x
_SCALE (SCALE_FACTOR_GAME) ; everything we do with "positioning" is scale SCALE_FACTOR_GAME
; put to be displayed bcd score as csa score into player score
; player_score
ldd tmp1 ; the current move vector
MY_MOVE_TO_D_START
leau ,y
leay 3,y
ldx #player_score
jsr bcd_to_csa
pshs y
lda mov_y
suba #50
sta mov_y
lda #$90
sta mov_x
jsr in_game_score ;#isfunction
puls y
dec tmp_count
lbne next_score_entry
jsr getButtonState ; is a button pressed?
beq display_highscore_intern2
cmpb #3 ; same aslast state
beq display_highscore_intern2
cmpb #2 ; as released - possibly from highscore return
beq display_highscore_intern2
lda #15
jsr init_objects
ldb #3
stb last_button_state
stb current_button_state
jmp title_main1_hs_ret
display_highscore_intern2
ldd #emptyStreamInMove
std inMovePointer
ldu list_objects_head
pulu d,x,y,pc ; (D = y,x, X = vectorlist, Y = DDRA+Scale)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; in reg a place to be edited
BLINK_LENGTH = 50/3 ; 1/3 second
edit_highscore
nega
adda #5
; in a now the compare value to ourcounter
sta hs_place_got
lda #3
sta hs_place_edit
lda #BLINK_LENGTH
sta hs_blink_count
clr hs_blink_state
; save player hs
ldx #player_score
ldu #star_0_score
ldd ,x++
std ,u++
ldd ,x++
std ,u++
ldd ,x++
std ,u++
edit_highscore_inner
jsr decode_ym_1_channel
jsr Wait_Recal
ldx RecalCounter ; recal counter, about 21 Minutes befor roll over
leax 1,x
stx RecalCounter
_DP_TO_D0 ; round_startup_main expects dp set to d0
JSR do_ym_sound2
jsr Intensity_5F
ldd #HIGH_SCORE_ZERO_POS
std tmp1
lda #5
sta tmp_count
ldy #highScoreBlock
next_score_entry_edit
lda #3
sta tmp_count2
next_name_letter_edit
_SCALE (SCALE_FACTOR_GAME) ; everything we do with "positioning" is scale SCALE_FACTOR_GAME
ldd tmp1 ; the current move vector
MY_MOVE_TO_D_START_NT
LDB ,y+ ; first char of three letter name
; lets calculate the abc-table offset...
SUBB # 'A' ; subtract smallest letter, so A has 0 offset
LSLB ; multiply by two, since addresses are 16 bit
ldx #_abc ; and add the abc (table of vector list address of the alphabet's letters)
LDX b,X ; in x now address of first letter vectorlist
; check if current place is the "blinker"
lda tmp_count
cmpa hs_place_got
bne no_blinker
lda tmp_count2
cmpa hs_place_edit
bne no_blinker
; here we have our blinking position
dec hs_blink_count
bne no_blink_state_change
lda #BLINK_LENGTH
sta hs_blink_count
lda hs_blink_state
bne clear_blink_state
inc hs_blink_state
bra no_blink_state_change
clear_blink_state
clr hs_blink_state
no_blink_state_change
tst hs_blink_state
bne no_blinker ;if blink state != than display normal character
; load SPACE
ldx #ABC_28
no_blinker:
_SCALE 24 ; (SCROLL_SCALE_FACTOR) ; drawing of letters is done in SCROLL_SCALE_FACTOR
lda mov_x
adda #X_STEP_LETTERS
sta mov_x
MY_MOVE_TO_B_END
jsr myDraw_VL_mode3
_ZERO_VECTOR_BEAM ; draw each letter with a move from zero, more stable
dec tmp_count2
bne next_name_letter_edit
lda mov_x
adda #2*X_STEP_LETTERS
sta mov_x
_SCALE (SCALE_FACTOR_GAME) ; everything we do with "positioning" is scale SCALE_FACTOR_GAME
; put to be displayed bcd score as csa score into player score
; player_score
ldd tmp1 ; the current move vector
MY_MOVE_TO_D_START
leau ,y
leay 3,y
ldx #player_score
jsr bcd_to_csa
lda mov_y
suba #50
sta mov_y
lda #$90
sta mov_x
pshs y
jsr in_game_score ;#isfunction
puls y
dec tmp_count
lbne next_score_entry_edit
jsr query_joystick
ldy #highScoreBlock
LDB last_joy_x ; only jump if last joy pos was zero (needed for testing later)
LDA Vec_Joy_1_X ; load joystick 1 position X to A
STA last_joy_x ; store this joystick position
BEQ hs_no_new_xpos
BMI pos_left_hse ; joystick moved to left
pos_right_hse:
TSTB ; test the old joystick position
BNE positioning_done_hse ; was center
; pos dec 1
dec hs_place_edit
bne hs_no_new_xpos
inc hs_place_edit
bra hs_no_new_xpos
pos_left_hse:
TSTB ; test the old joystick position
BNE positioning_done_hse ; was center
; pos inc 1
inc hs_place_edit
lda #4
cmpa hs_place_edit
bne hs_no_new_xpos
lda #3
sta hs_place_edit
bra hs_no_new_xpos
hs_no_new_xpos:
; todo check y
LDB last_joy_y ; only jump if last joy pos was zero (needed for testing later)
LDA Vec_Joy_1_Y ; load joystick 1 position X to A
STA last_joy_y ; store this joystick position
BEQ hs_no_new_ypos
BMI pos_down_hse ; joystick moved to left
pos_up_hse:
TSTB ; test the old joystick position
BNE positioning_done_hse ; was center
lda hs_place_got
nega
adda #5
ldb #6
mul
leay d,y
lda hs_place_edit
nega
adda #3
leay a,y
; in y now the to be changed letter
lda ,y
inca
cmpa # 'Z'
bls no_overflow_plus_hs
lda # 'A'
no_overflow_plus_hs
sta ,y
bra hs_no_new_ypos
pos_down_hse:
TSTB ; test the old joystick position
BNE positioning_done_hse ; was center
lda hs_place_got
nega
adda #5
ldb #6
mul
leay d,y
lda hs_place_edit
nega
adda #3
leay a,y
; in y now the to be changed letter
lda ,y
deca
cmpa # 'A'
bhs no_overflow_minus_hs
lda # 'Z'
no_overflow_minus_hs
sta ,y
bra hs_no_new_ypos
; letter inc 1
positioning_done_hse
hs_no_new_ypos
jsr getButtonState ; is a button pressed?
lbeq edit_highscore_inner
check_buttons_edit
cmpb #3 ; same aslast state
lbeq edit_highscore_inner
cmpb #2 ; as released - possibly from highscore return
lbeq edit_highscore_inner
ldb #3
stb last_button_state
stb current_button_state
; restore player hs
ldu #player_score
ldx #star_0_score
ldd ,x++
std ,u++
ldd ,x++
std ,u++
ldd ,x++
std ,u++
rts
; bra title_main1
|
; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
; ==++==
;
;
; ==--==
#include "ksarm.h"
#include "asmconstants.h"
#include "asmmacros.h"
IMPORT FixContextHandler
IMPORT LinkFrameAndThrow
IMPORT HijackHandler
IMPORT ThrowControlForThread
;
; WARNING!! These functions immediately ruin thread unwindability. This is
; WARNING!! OK as long as there is a mechanism for saving the thread context
; WARNING!! prior to running these functions as well as a mechanism for
; WARNING!! restoring the context prior to any stackwalk. This means that
; WARNING!! we need to ensure that no GC can occur while the stack is
; WARNING!! unwalkable. This further means that we cannot allow any exception
; WARNING!! to occur when the stack is unwalkable
;
TEXTAREA
; GSCookie, scratch area
GBLA OFFSET_OF_FRAME
; GSCookie + alignment padding
OFFSET_OF_FRAME SETA 4 + SIZEOF__GSCookie
MACRO
GenerateRedirectedStubWithFrame $STUB, $TARGET
;
; This is the primary function to which execution will be redirected to.
;
NESTED_ENTRY $STUB
;
; IN: lr: original IP before redirect
;
PROLOG_PUSH {r4,r7,lr}
PROLOG_STACK_ALLOC OFFSET_OF_FRAME + SIZEOF__FaultingExceptionFrame
; At this point, the stack maybe misaligned if the thread abort was asynchronously
; triggered in the prolog or epilog of the managed method. For such a case, we must
; align the stack before calling into the VM.
;
; Runtime check for 8-byte alignment.
PROLOG_STACK_SAVE r7
and r0, r7, #4
sub sp, sp, r0
; Save pointer to FEF for GetFrameFromRedirectedStubStackFrame
add r4, sp, #OFFSET_OF_FRAME
; Prepare to initialize to NULL
mov r1,#0
str r1, [r4] ; Initialize vtbl (it is not strictly necessary)
str r1, [r4, #FaultingExceptionFrame__m_fFilterExecuted] ; Initialize BOOL for personality routine
mov r0, r4 ; move the ptr to FEF in R0
; stack must be 8 byte aligned
CHECK_STACK_ALIGNMENT
bl $TARGET
; Target should not return.
EMIT_BREAKPOINT
NESTED_END $STUB
MEND
; ------------------------------------------------------------------
;
; Helpers for async (NullRef, AccessViolation) exceptions
;
NESTED_ENTRY NakedThrowHelper2,,FixContextHandler
PROLOG_PUSH {r0, lr}
; On entry:
;
; R0 = Address of FaultingExceptionFrame
bl LinkFrameAndThrow
; Target should not return.
EMIT_BREAKPOINT
NESTED_END NakedThrowHelper2
GenerateRedirectedStubWithFrame NakedThrowHelper, NakedThrowHelper2
; ------------------------------------------------------------------
;
; Helpers for ThreadAbort exceptions
;
NESTED_ENTRY RedirectForThreadAbort2,,HijackHandler
PROLOG_PUSH {r0, lr}
; stack must be 8 byte aligned
CHECK_STACK_ALIGNMENT
; On entry:
;
; R0 = Address of FaultingExceptionFrame.
;
; Invoke the helper to setup the FaultingExceptionFrame and raise the exception
bl ThrowControlForThread
; ThrowControlForThread doesn't return.
EMIT_BREAKPOINT
NESTED_END RedirectForThreadAbort2
GenerateRedirectedStubWithFrame RedirectForThreadAbort, RedirectForThreadAbort2
; ------------------------------------------------------------------
; This helper enables us to call into a funclet after applying the non-volatiles
NESTED_ENTRY CallEHFunclet
PROLOG_PUSH {r4-r11, lr}
PROLOG_STACK_ALLOC 4
; On entry:
;
; R0 = throwable
; R1 = PC to invoke
; R2 = address of R4 register in CONTEXT record; used to restore the non-volatile registers of CrawlFrame
; R3 = address of the location where the SP of funclet's caller (i.e. this helper) should be saved.
;
; Save the SP of this function
str sp, [r3]
; apply the non-volatiles corresponding to the CrawlFrame
ldm r2, {r4-r11}
; Invoke the funclet
blx r1
EPILOG_STACK_FREE 4
EPILOG_POP {r4-r11, pc}
NESTED_END CallEHFunclet
; This helper enables us to call into a filter funclet by passing it the CallerSP to lookup the
; frame pointer for accessing the locals in the parent method.
NESTED_ENTRY CallEHFilterFunclet
PROLOG_PUSH {lr}
PROLOG_STACK_ALLOC 4
; On entry:
;
; R0 = throwable
; R1 = SP of the caller of the method/funclet containing the filter
; R2 = PC to invoke
; R3 = address of the location where the SP of funclet's caller (i.e. this helper) should be saved.
;
; Save the SP of this function
str sp, [r3]
; Invoke the filter funclet
blx r2
EPILOG_STACK_FREE 4
EPILOG_POP {pc}
NESTED_END CallEHFilterFunclet
END
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
%>
<%docstring>epoll_ctl_old(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str
Invokes the syscall epoll_ctl_old.
See 'man 2 epoll_ctl_old' for more information.
Arguments:
vararg(int): vararg
Returns:
long
</%docstring>
<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = []
can_pushstr_array = []
argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4']
argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%r' % (name, arg))
# 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, str):
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_epoll_ctl_old']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* epoll_ctl_old(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=('\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)} |
# AMD K7 mpn_addmul_1/mpn_submul_1 -- add or subtract mpn multiple.
#
# K7: 3.9 cycles/limb.
#
# Future: It should be possible to avoid the separate mul after the unrolled
# loop by moving the movl/adcl to the top.
# Copyright (C) 1999, 2000 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
# The GNU MP Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# The GNU MP Library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the GNU MP Library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
include(`../config.m4')
dnl K7: UNROLL_COUNT cycles/limb
dnl 4 4.42
dnl 8 4.16
dnl 16 3.9
dnl 32 3.9
dnl 64 3.87
dnl Maximum possible with the current code is 64.
deflit(UNROLL_COUNT, 16)
ifdef(`OPERATION_addmul_1',`
define(M4_inst, addl)
define(M4_function_1, mpn_addmul_1)
define(M4_function_1c, mpn_addmul_1c)
define(M4_description, add it to)
define(M4_desc_retval, carry)
',`ifdef(`OPERATION_submul_1',`
define(M4_inst, subl)
define(M4_function_1, mpn_submul_1)
define(M4_function_1c, mpn_submul_1c)
define(M4_description, subtract it from)
define(M4_desc_retval, borrow)
',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
')')')
MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
`#' mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
`#' mp_limb_t mult);
`#' mp_limb_t M4_function_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
`#' mp_limb_t mult, mp_limb_t carry);
`#'
`#' Calculate src,size multiplied by mult and M4_description dst,size.
`#' Return the M4_desc_retval limb from the top of the result.
ifdef(`PIC',`
deflit(UNROLL_THRESHOLD, 9)
',`
deflit(UNROLL_THRESHOLD, 6)
')
defframe(PARAM_CARRY, 20)
defframe(PARAM_MULTIPLIER,16)
defframe(PARAM_SIZE, 12)
defframe(PARAM_SRC, 8)
defframe(PARAM_DST, 4)
deflit(`FRAME',0)
defframe(SAVE_EBX, -4)
defframe(SAVE_ESI, -8)
defframe(SAVE_EDI, -12)
defframe(SAVE_EBP, -16)
deflit(SAVE_SIZE, 16)
.text
ALIGN(32)
PROLOGUE(M4_function_1)
movl PARAM_SIZE, %edx
movl PARAM_SRC, %eax
xorl %ecx, %ecx
decl %edx
jnz LF(M4_function_1c,start_1)
movl (%eax), %eax
movl PARAM_DST, %ecx
mull PARAM_MULTIPLIER
M4_inst %eax, (%ecx)
adcl $0, %edx
movl %edx, %eax
ret
EPILOGUE()
ALIGN(16)
PROLOGUE(M4_function_1c)
movl PARAM_SIZE, %edx
movl PARAM_SRC, %eax
decl %edx
jnz L(more_than_one_limb)
movl (%eax), %eax
movl PARAM_DST, %ecx
mull PARAM_MULTIPLIER
addl PARAM_CARRY, %eax
adcl $0, %edx
M4_inst %eax, (%ecx)
adcl $0, %edx
movl %edx, %eax
ret
# offset 0x44 so close enough to aligned
L(more_than_one_limb):
movl PARAM_CARRY, %ecx
L(start_1):
# eax src
# ecx initial carry
# edx size-1
subl $SAVE_SIZE, %esp
deflit(`FRAME',16)
movl %ebx, SAVE_EBX
movl %esi, SAVE_ESI
movl %edx, %ebx # size-1
movl PARAM_SRC, %esi
movl %ebp, SAVE_EBP
cmpl $UNROLL_THRESHOLD, %edx
movl PARAM_MULTIPLIER, %ebp
movl %edi, SAVE_EDI
movl (%esi), %eax # src low limb
movl PARAM_DST, %edi
ja L(unroll)
# simple loop
leal 4(%esi,%ebx,4), %esi # point one limb past last
leal (%edi,%ebx,4), %edi # point at last limb
negl %ebx
# The movl to load the next source limb is done well ahead of the
# mul. This is necessary for full speed, and leads to one limb
# handled separately at the end.
L(simple):
# eax src limb
# ebx loop counter
# ecx carry limb
# edx scratch
# esi src
# edi dst
# ebp multiplier
mull %ebp
addl %eax, %ecx
adcl $0, %edx
M4_inst %ecx, (%edi,%ebx,4)
movl (%esi,%ebx,4), %eax
adcl $0, %edx
incl %ebx
movl %edx, %ecx
jnz L(simple)
mull %ebp
movl SAVE_EBX, %ebx
movl SAVE_ESI, %esi
movl SAVE_EBP, %ebp
addl %eax, %ecx
adcl $0, %edx
M4_inst %ecx, (%edi)
adcl $0, %edx
movl SAVE_EDI, %edi
addl $SAVE_SIZE, %esp
movl %edx, %eax
ret
#-----------------------------------------------------------------------
ALIGN(16)
L(unroll):
# eax src low limb
# ebx size-1
# ecx carry
# edx size-1
# esi src
# edi dst
# ebp multiplier
dnl overlapping with parameters no longer needed
define(VAR_COUNTER,`PARAM_SIZE')
define(VAR_JUMP, `PARAM_MULTIPLIER')
subl $2, %ebx # (size-2)-1
decl %edx # size-2
shrl $UNROLL_LOG2, %ebx
negl %edx
movl %ebx, VAR_COUNTER
andl $UNROLL_MASK, %edx
movl %edx, %ebx
shll $4, %edx
ifdef(`PIC',`
call L(pic_calc)
L(here):
',`
leal L(entry) (%edx,%ebx,1), %edx
')
negl %ebx
movl %edx, VAR_JUMP
mull %ebp
addl %eax, %ecx # initial carry, becomes low carry
adcl $0, %edx
testb $1, %bl
movl 4(%esi), %eax # src second limb
leal ifelse(UNROLL_BYTES,256,128+) 8(%esi,%ebx,4), %esi
leal ifelse(UNROLL_BYTES,256,128) (%edi,%ebx,4), %edi
movl %edx, %ebx # high carry
cmovnz_ecx_ebx # high,low carry other way around
cmovnz_edx_ecx
jmp *VAR_JUMP
ifdef(`PIC',`
L(pic_calc):
# See README.family about old gas bugs
leal (%edx,%ebx,1), %edx
addl $L(entry)-L(here), %edx
addl (%esp), %edx
ret
')
#-----------------------------------------------------------------------
# This code uses a "two carry limbs" scheme. At the top of the loop the
# carries are ebx=lo, ecx=hi, then they swap for each limb processed. For
# the computed jump an odd size means they start one way around, an even
# size the other. Either way one limb is handled separately at the start of
# the loop.
#
# The positioning of the movl to load the next source limb is important.
# Moving it after the adcl with a view to avoiding a separate mul at the end
# of the loop slows the code down.
ALIGN(32)
L(top):
# eax src limb
# ebx carry high
# ecx carry low
# edx scratch
# esi src+8
# edi dst
# ebp multiplier
#
# VAR_COUNTER loop counter
#
# 17 bytes each limb
L(entry):
deflit(CHUNK_COUNT,2)
forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, `
deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
deflit(`disp1', eval(disp0 + 4))
mull %ebp
Zdisp( M4_inst,%ecx, disp0,(%edi))
movl $0, %ecx
adcl %eax, %ebx
Zdisp( movl, disp0,(%esi), %eax)
adcl %edx, %ecx
mull %ebp
M4_inst %ebx, disp1(%edi)
movl $0, %ebx
adcl %eax, %ecx
movl disp1(%esi), %eax
adcl %edx, %ebx
')
decl VAR_COUNTER
leal UNROLL_BYTES(%esi), %esi
leal UNROLL_BYTES(%edi), %edi
jns L(top)
# eax src limb
# ebx carry high
# ecx carry low
# edx
# esi
# edi dst (points at second last limb)
# ebp multiplier
deflit(`disp0', ifelse(UNROLL_BYTES,256,-128))
deflit(`disp1', eval(disp0-0 + 4))
mull %ebp
M4_inst %ecx, disp0(%edi)
movl SAVE_EBP, %ebp
adcl %ebx, %eax
movl SAVE_EBX, %ebx
movl SAVE_ESI, %esi
adcl $0, %edx
M4_inst %eax, disp1(%edi)
movl SAVE_EDI, %edi
adcl $0, %edx
addl $SAVE_SIZE, %esp
movl %edx, %eax
ret
EPILOGUE()
|
FillAreaWithTiles: ;Fill an area with consecutively numbered tiles, so we can simulate a bitmap area
;BC = X,Y
;HL = W,H
;DE = Start Tile
ld a,h
add b
ld h,a
ld a,l
add c
ld l,a
FillAreaWithTiles_Yagain:
push bc
push de
push hl
call GetVDPScreenPos
pop hl
pop de
FillAreaWithTiles_Xagain:
ld a,e
out (VdpOut_Data),a
inc e
inc b
ld a,b
cp h
jr nz,FillAreaWithTiles_Xagain
pop bc
inc c
ld a,c
cp l
jr nz,FillAreaWithTiles_Yagain
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Write Tile data to Vram
;Tile patterns start at &0000 - each tile is 8 bytes... we have 256 available.
;In theory, The tilemap supports 768 tiles, the first 1/3rd for the top part of the screen,
;The 2nd for the middle, and 3rd for the bottom... we use it to fake a bitmap mode, but it's slow, so we're not using it here.
DefineTiles: ;BC=Bytecount, HL=source, DE=Destination
push bc
ex de,hl
call prepareVram
ex de,hl
pop bc
DefineTiles2:
ld a,(hl)
out (VdpOut_Data),a
inc hl
dec bc
ld a,b
or c
jp nz,DefineTiles2
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GetVDPScreenPos: ;Move the VDP write pointer to a memory location by XY location
push bc ;B=Xpos (0-31), C=Ypos (0-23)
ld h,0
ld l,c
or a
rl l ;32 bytes per line, so shift L left 5 times, and push any overflow into H
rl h
rl l
rl h
rl l
rl h
rl l
rl h
rl l
rl h
ld a,l
or b ;Or in the X co-ordinate
ld l,a
ld a,h
or &18 ;Tilemap starts at &1800
ld h,a
call VDP_SetWriteAddress
pop bc
ret
|
; A056526: First differences of Flavius Josephus's sieve.
; 2,4,6,6,8,12,10,14,16,12,18,24,14,34,26,16,30,36,18,42,38,12,60,22,48,38,46,36,60,54,44,36,84,22,60,84,18,78,72,60,38,112,12,96,114,26,88,92,34,90,138,26,82,98,112,54,170,36,60,168,52,128,52,128,94,108,90,188,34,72,170,120,46,158,196,20,160,108,176,96,130,108,146,120,100,204,138,50,228,172,30,210,128,142,150,150,114,258,108,114,210,228,18,188,240,76,270,110,208,168,210,158,96,324,136,104,262,74,298,138,252,96,264,176,216,166,210,248,132,172,300,192,138,242,220,296,168,216,196,180,324,126,264,134,372,148,276,104,442,204,156,282,258,222,216,356,96,412,168,248,216,216,408,154,338,142,228,414,284,46,576,98,280,276,258,186,416,304,200,316,236,264,504,154,218,408,232,380,168,364,198,522,198,204,530,124,492,300,264,224,300,316,438,146,376,366,410,84,520,344,124,762,66,128,532,360,252,462,360,258,296,406,240,498,356,220,546,516,120,390,408,204,368,408,456,190,588,78,780,284,136,584,280,666,230,340,234,558,552,330
mov $27,$0
mov $29,2
lpb $29
clr $0,27
mov $0,$27
sub $29,1
add $0,$29
sub $0,1
cal $0,73359 ; Nested floor product of n and fractions (2k+2)/(2k+1) for all k>=0, divided by 2.
add $3,$0
mov $1,$3
mov $30,$29
lpb $30
mov $28,$1
sub $30,1
lpe
lpe
lpb $27
mov $27,0
sub $28,$1
lpe
mov $1,$28
sub $1,1
mul $1,2
add $1,2
|
include "ddragon_sound.inc"
include "ddragon_sound_diag.inc"
include "error_addresses.inc"
include "macros.inc"
global handle_reset
global handle_firq
global handle_irq
global handle_nmi
global handle_swi
section reset,"rodata"
handle_reset:
jmp main
section text
; nmi pin is tied to 5V so should never get one
handle_nmi:
jmp EA_UNEXPECTED_NMI
; normal interrupt from from the main cpu. we
; we have no control of when it might happen
; so just ack it and rti
handle_irq:
pshs a
lda MMIO_MAIN_CPU_LATCH
puls a
rti
; timer from ym2151 triggers this
handle_firq:
pshs d
lda g_firq_expected
tsta
beq .unexpected_firq
ldd g_firq_count
addd #1
std g_firq_count
jsr ym2151_wait_busy
lda #YM2151_REG_TIMER
sta MMIO_YM2151_ADDRESS
jsr ym2151_wait_busy
lda #$15
sta MMIO_YM2151_DATA
puls d
rti
.unexpected_firq:
orcc #$40
jmp EA_UNEXPECTED_FIRQ
; should never happen
handle_swi:
rti
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 <aws/appsync/model/CreateResolverRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::AppSync::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateResolverRequest::CreateResolverRequest() :
m_apiIdHasBeenSet(false),
m_typeNameHasBeenSet(false),
m_fieldNameHasBeenSet(false),
m_dataSourceNameHasBeenSet(false),
m_requestMappingTemplateHasBeenSet(false),
m_responseMappingTemplateHasBeenSet(false)
{
}
Aws::String CreateResolverRequest::SerializePayload() const
{
JsonValue payload;
if(m_fieldNameHasBeenSet)
{
payload.WithString("fieldName", m_fieldName);
}
if(m_dataSourceNameHasBeenSet)
{
payload.WithString("dataSourceName", m_dataSourceName);
}
if(m_requestMappingTemplateHasBeenSet)
{
payload.WithString("requestMappingTemplate", m_requestMappingTemplate);
}
if(m_responseMappingTemplateHasBeenSet)
{
payload.WithString("responseMappingTemplate", m_responseMappingTemplate);
}
return payload.View().WriteReadable();
}
|
; A152046: a(n) = Product_{k=1..floor((n-1)/2)} (1 + 8*cos(k*Pi/n)^2) for n >= 0.
; 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
mov $1,2
pow $1,$0
div $1,6
mul $1,2
add $1,1
|
GLOBAL ShadowMaps
SEGMENT code
ShadowMaps
; no blocker (starting state, blocks edge of circular view)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,1fh
db 00h,00h,00h,00h,1fh,1fh
db 00h,00h,00h,1fh,1fh,1fh
; blocker at (x,y)=(1,0)
db 00h,1dh,1fh,1fh,1fh,1fh
db 00h,0ch,1fh,1fh,1fh,1fh
db 00h,00h,0ch,1fh,1fh,1fh
db 00h,00h,00h,0ch,1fh,1fh
db 00h,00h,00h,00h,0ch,1fh
db 00h,00h,00h,00h,00h,0ch
; blocker at (x,y)=(2,0)
db 00h,00h,1dh,1fh,1fh,1fh
db 00h,00h,04h,1ch,1fh,1fh
db 00h,00h,00h,00h,04h,0ch
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(3,0)
db 00h,00h,00h,1dh,1fh,1fh
db 00h,00h,00h,04h,0ch,1eh
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(4,0)
db 00h,00h,00h,00h,1dh,1fh
db 00h,00h,00h,00h,04h,04h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(0,1)
db 00h,00h,00h,00h,00h,00h
db 1bh,03h,00h,00h,00h,00h
db 1fh,1fh,03h,00h,00h,00h
db 1fh,1fh,1fh,03h,00h,00h
db 1fh,1fh,1fh,1fh,03h,00h
db 1fh,1fh,1fh,1fh,1fh,03h
; blocker at (x,y)=(1,1)
db 00h,00h,00h,00h,00h,00h
db 00h,19h,1bh,13h,01h,01h
db 00h,1dh,1fh,1fh,1fh,1fh
db 00h,1ch,1fh,1fh,1fh,1fh
db 00h,08h,1fh,1fh,1fh,1fh
db 00h,08h,1fh,1fh,1fh,1fh
; blocker at (x,y)=(2,1)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,19h,1bh,1bh,1bh
db 00h,00h,0ch,1fh,1fh,1fh
db 00h,00h,00h,0ch,1fh,1fh
db 00h,00h,00h,00h,0ch,1fh
db 00h,00h,00h,00h,00h,0ch
; blocker at (x,y)=(3,1)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,19h,1bh,1bh
db 00h,00h,00h,0ch,1eh,1fh
db 00h,00h,00h,00h,00h,1ch
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(4,1)
db 00h,00h,00h,00h,00h,01h
db 00h,00h,00h,00h,19h,1fh
db 00h,00h,00h,00h,04h,1ch
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(0,2)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 1bh,02h,00h,00h,00h,00h
db 1fh,13h,00h,00h,00h,00h
db 1fh,1fh,02h,00h,00h,00h
db 1fh,1fh,03h,00h,00h,00h
; blocker at (x,y)=(1,2)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,19h,03h,00h,00h,00h
db 00h,1dh,1fh,03h,00h,00h
db 00h,1dh,1fh,1fh,03h,00h
db 00h,1dh,1fh,1fh,1fh,03h
; blocker at (x,y)=(2,2)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,19h,13h,01h,00h
db 00h,00h,1ch,1fh,1fh,13h
db 00h,00h,08h,1fh,1fh,1fh
db 00h,00h,00h,1ch,1fh,1fh
; blocker at (x,y)=(3,2)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,19h,1bh,03h
db 00h,00h,00h,0ch,1fh,1fh
db 00h,00h,00h,00h,0ch,1fh
db 00h,00h,00h,00h,00h,0ch
; blocker at (x,y)=(4,2)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,19h,1bh
db 00h,00h,00h,00h,0ch,1fh
db 00h,00h,00h,00h,00h,04h
db 00h,00h,00h,00h,00h,00h
; blocker at (x,y)=(0,3)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 1bh,02h,00h,00h,00h,00h
db 1fh,03h,00h,00h,00h,00h
db 1fh,17h,00h,00h,00h,00h
; blocker at (x,y)=(1,3)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,19h,03h,00h,00h,00h
db 00h,1dh,17h,00h,00h,00h
db 00h,1dh,1fh,13h,00h,00h
; blocker at (x,y)=(2,3)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,19h,03h,00h,00h
db 00h,00h,1dh,1fh,03h,00h
db 00h,00h,0ch,1fh,1fh,03h
; blocker at (x,y)=(3,3)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,19h,13h,00h
db 00h,00h,00h,1ch,1fh,1bh
db 00h,00h,00h,00h,1dh,1fh
; blocker at (x,y)=(4,3)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,19h,13h
db 00h,00h,00h,00h,0ch,1fh
db 00h,00h,00h,00h,00h,0ch
; blocker at (x,y)=(0,4)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 1bh,02h,00h,00h,00h,00h
db 1fh,02h,00h,00h,00h,00h
; blocker at (x,y)=(1,4)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,19h,02h,00h,00h,00h
db 08h,1fh,13h,00h,00h,00h
; blocker at (x,y)=(2,4)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,19h,03h,00h,00h
db 00h,00h,1dh,1fh,02h,00h
; blocker at (x,y)=(3,4)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,19h,03h,00h
db 00h,00h,00h,1ch,1fh,03h
; blocker at (x,y)=(4,4)
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,00h,00h
db 00h,00h,00h,00h,19h,13h
db 00h,00h,00h,00h,1ch,1fh
|
; void *zx_cyx2saddr(uchar row, uchar col)
SECTION code_arch
PUBLIC zx_cyx2saddr_callee, l0_zx_cyx2saddr_callee
zx_cyx2saddr_callee:
pop af
pop hl
pop de
push af
l0_zx_cyx2saddr_callee:
ld h,e
INCLUDE "arch/zx/display/z80/asm_zx_cyx2saddr.asm"
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x17a7, %r14
nop
nop
nop
sub %rbx, %rbx
mov $0x6162636465666768, %r13
movq %r13, (%r14)
nop
xor $21180, %rbx
lea addresses_WT_ht+0x9643, %rsi
lea addresses_A_ht+0xe4a7, %rdi
nop
nop
nop
xor $58574, %rbp
mov $119, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $47387, %r13
lea addresses_D_ht+0x1efa7, %rsi
lea addresses_A_ht+0x1424e, %rdi
nop
and %r14, %r14
mov $127, %rcx
rep movsq
nop
nop
nop
nop
add %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x187a7, %rcx
clflush (%rcx)
nop
nop
add %r9, %r9
mov $0x5152535455565758, %rdi
movq %rdi, (%rcx)
nop
nop
nop
nop
nop
and %rdi, %rdi
// Store
lea addresses_UC+0x1feb7, %rax
clflush (%rax)
cmp %rbp, %rbp
movb $0x51, (%rax)
nop
nop
cmp %rax, %rax
// Faulty Load
lea addresses_RW+0x19fa7, %rax
nop
sub $62453, %r15
movups (%rax), %xmm4
vpextrq $1, %xmm4, %rcx
lea oracles, %rbp
and $0xff, %rcx
shlq $12, %rcx
mov (%rbp,%rcx,1), %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}}
{'32': 1332}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
; A117676: Squares for which the digital root is also a square.
; 0,1,4,9,36,49,64,81,100,121,144,225,256,289,324,361,400,441,576,625,676,729,784,841,900,1089,1156,1225,1296,1369,1444,1521,1764,1849,1936,2025,2116,2209,2304,2601,2704,2809,2916,3025,3136,3249,3600,3721,3844,3969,4096,4225,4356,4761,4900,5041,5184,5329,5476,5625,6084,6241,6400,6561,6724,6889,7056,7569,7744,7921,8100,8281,8464,8649,9216,9409,9604,9801,10000,10201,10404,11025,11236,11449,11664,11881,12100,12321,12996,13225,13456,13689,13924,14161,14400,15129,15376,15625,15876,16129,16384,16641,17424,17689,17956,18225,18496,18769,19044,19881,20164,20449,20736,21025,21316,21609,22500,22801,23104,23409,23716,24025,24336,25281,25600,25921,26244,26569,26896,27225,28224,28561,28900,29241,29584,29929,30276,31329,31684,32041,32400,32761,33124,33489,34596,34969,35344,35721,36100,36481,36864,38025,38416,38809,39204,39601,40000,40401,41616,42025,42436,42849,43264,43681,44100,45369,45796,46225,46656,47089,47524,47961,49284,49729,50176,50625,51076,51529,51984,53361,53824,54289,54756,55225,55696,56169,57600,58081,58564,59049,59536,60025,60516,62001,62500,63001,63504,64009,64516,65025,66564,67081,67600,68121,68644,69169,69696,71289,71824,72361,72900,73441,73984,74529,76176,76729,77284,77841,78400,78961,79524,81225,81796,82369,82944,83521,84100,84681,86436,87025,87616,88209,88804,89401,90000,91809,92416,93025,93636,94249,94864,95481,97344,97969,98596,99225,99856,100489,101124,103041
mov $1,$0
add $1,$0
lpb $0
sub $0,7
add $1,4
lpe
pow $1,2
div $1,4
|
; A135030: Generalized Fibonacci numbers: a(n) = 6*a(n-1) + 2*a(n-2).
; Submitted by Jamie Morken(s4)
; 0,1,6,38,240,1516,9576,60488,382080,2413456,15244896,96296288,608267520,3842197696,24269721216,153302722688,968355778560,6116740116736,38637152257536,244056393778688,1541612667187200,9737788790680576,61509958078457856,388535326052108288,2454231872469565440,15502461886921609216,97923235066468786176,618544334172655935488,3907112475168873185280,24679763519358550982656,155892806066489052266496,984716363437651415564288,6220083792758886597918720,39289935483428622418640896,248179780486089507707682816
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $3,6
add $3,$1
mov $1,$2
mul $1,2
lpe
mov $0,$3
|
#include <iostream>
#include <boost/program_options.hpp>
int main(int argc, const char *argv[]) {
namespace opts = boost::program_options;
opts::options_description desc;
desc.add_options()
("hello", "say hello")
;
opts::variables_map vm;
opts::store(opts::parse_command_line(argc, argv, desc), vm);
opts::notify(vm);
if (vm.count("hello"))
std::cout << "Hello, world!" << std::endl;
return 0;
}
|
#include "IBPsampler.h"
#include "../core/GeneralFunctions.cpp"
#include "../core/InferenceFunctions.cpp"
//*********************************INPUTS**************************//
#define input_X prhs[0]
#define input_C prhs[1]
#define input_Z prhs[2]
#define input_bias prhs[3]
#define input_F prhs[4]
//#define input_W prhs[4]
//#define input_s2Y prhs[5]
#define input_s2u prhs[5]
#define input_s2B prhs[6]
#define input_alpha prhs[7]
#define input_Nsim prhs[8]
#define input_maxK prhs[9]
#define input_missing prhs[10]
//*********************************OUTPUTS**************************//
#define output_Z plhs[0]
#define output_B plhs[1]
#define output_Theta plhs[2]
#define output_MU plhs[3]
#define output_W plhs[4]
#define output_s2Y plhs[5]
void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[] ) {
//..................CHECKING INPUTS AND OUTPUTS.............//
/* Matrices are arranged per column */
if (nrhs!=11) {
mexErrMsgTxt("Invalid number of arguments\n");
}
const mwSize XNumDim = mxGetNumberOfDimensions(input_X);
const mwSize ZNumDim = mxGetNumberOfDimensions(input_Z);
const mwSize s2BNumDim = mxGetNumberOfDimensions(input_s2B);
const mwSize* Xdim = mxGetDimensions(input_X);
const mwSize* Zdim = mxGetDimensions(input_Z);
const mwSize* Cdim = mxGetDimensions(input_C);
int N = Xdim[0];
// size_t D = Xdim[1];
int D = Xdim[1];
int K = Zdim[1];
if (Cdim[1]!=D & Cdim[0]!=1){
mexErrMsgTxt("Invalid number of dimensions for vector C\n");
}
if (Zdim[0]!=N){
mexErrMsgTxt("Invalid number of dimensions for vector C\n");
}
double *X_dou = mxGetPr(input_X);
char *C= mxArrayToString(input_C);
double *Z_dou = mxGetPr(input_Z);
double *f_dou = mxGetPr(input_F);
//double *w_dou = mxGetPr(input_W);
//Inputs to the C function
int bias = mxGetScalar(input_bias);
double s2B = mxGetScalar(input_s2B);
//double s2Y = mxGetScalar(input_s2Y);
double s2u = mxGetScalar(input_s2u);
double alpha = mxGetScalar(input_alpha);
int maxK = mxGetScalar(input_maxK);
int Nsim = mxGetScalar(input_Nsim);
double missing = mxGetScalar(input_missing);
gsl_matrix_view Zview = gsl_matrix_view_array(Z_dou, K,N);
gsl_matrix *Zm = &Zview.matrix;
gsl_matrix *Z= gsl_matrix_calloc(maxK,N);
for (int i=0;i<N;i++){
for (int k=0; k<K; k++){
gsl_matrix_set (Z, k, i,gsl_matrix_get (Zm, k, i));
}
}
double f[D];
for (int d=0; d<D; d++){
C[d] = tolower(C[d]);//convert to lower case
f[d]= f_dou[d];
}
//...............BODY CODE.......................//
//Starting C function
//...............Initialization.......................//
gsl_matrix_view Xview = gsl_matrix_view_array(X_dou, D,N);
gsl_matrix *X = &Xview.matrix;
gsl_matrix **B=(gsl_matrix **) calloc(D,sizeof(gsl_matrix*));
gsl_vector **theta=(gsl_vector **) calloc(D,sizeof(gsl_vector*));
double w[D],mu[D],s2Y[D];
int R[D];
printf("In C++: Transforming input data... ");
int maxR=initialize_func (N, D, maxK, missing, X, C, B, theta, R, f, mu, w, s2Y);
printf("done\n");
//int maxR = 1;
//for (int d=0; d<D; d++){
// w[d] = 1;
// mu[d]= 0;
// R[d] = 1;
// }
printf("maxR=%d\n", maxR);
//...............Inference Function.......................//
printf("In C++: Running Inference Routine... ");
int Kest = IBPsampler_func (missing, X, C, Z, B, theta, R, f, mu, w, maxR, bias, N, D, K, alpha, s2B, s2Y, s2u, maxK, Nsim);
//...............SET OUTPUT POINTERS.......................//
output_Z = mxCreateDoubleMatrix(Kest,N,mxREAL);
double *pZ=mxGetPr(output_Z);
// size_t Kest2 = (size_t) Kest;
// size_t dimB[3]={D,Kest2,maxR};
// size_t dimB[3]={D,Kest,maxR};
int dimB[3]={D,Kest,maxR};
output_B = mxCreateNumericArray(3,dimB,mxDOUBLE_CLASS,mxREAL);
double *pB=mxGetPr(output_B);
output_Theta = mxCreateDoubleMatrix(D, maxR,mxREAL);
double *pT=mxGetPr(output_Theta);
Zview = gsl_matrix_submatrix (Z, 0, 0, Kest, N);
for (int i=0;i<N;i++){
for (int k=0; k<Kest; k++){
pZ[Kest*i+k]=(&Zview.matrix)->data[k*N+i];
//pgu[i]=xPLS[i];
}
}
int idx_tmp;
for (int d=0; d<D; d++){
if (C[d] =='o') {
idx_tmp = 1;
} else {
idx_tmp = R[d];
}
gsl_matrix_view Bd_view = gsl_matrix_submatrix (B[d], 0, 0, Kest, idx_tmp);
gsl_matrix *BT=gsl_matrix_alloc(idx_tmp,Kest);
gsl_matrix_transpose_memcpy (BT, &Bd_view.matrix);;
for (int i=0;i<Kest*maxR;i++){
if (C[d]!='c' & i<Kest){
pB[D*i+d]=(BT)->data[i];
}else if (C[d]=='c' & i<Kest*idx_tmp){
pB[D*i+d]=(BT)->data[i];
}
}
gsl_matrix_free(BT);
}
for (int d=0; d<D; d++){
for (int i=0;i<maxR;i++){
if (C[d]=='o' & i<(R[d]-1)){
pT[D*i+d]=(theta[d])->data[i];
}
}
}
output_MU = mxCreateDoubleMatrix(D, 1,mxREAL);
double *pMU=mxGetPr(output_MU);
output_W = mxCreateDoubleMatrix(D, 1,mxREAL);
double *pW=mxGetPr(output_W);
output_s2Y = mxCreateDoubleMatrix(D, 1,mxREAL);
double *ps2Y=mxGetPr(output_s2Y);
for (int d=0; d<D; d++){
pMU[d]=mu[d];
pW[d]=w[d];
ps2Y[d]=s2Y[d];
}
//..... Free memory.....//
for (int d=0; d<D; d++){
gsl_matrix_free(B[d]);
if (C[d] == 'o') { // TODO: Verify why this line gives segmentation fault
gsl_vector_free(theta[d]);
}
}
gsl_matrix_free(Z);
free(B);
free(theta);
}
|
; A005676: Sum C(n-k,4*k), k = 0..n.
; 1,1,1,1,1,2,6,16,36,71,128,220,376,661,1211,2290,4382,8347,15706,29191,53824,99009,182497,337745,627401,1167937,2174834,4046070,7517368,13951852,25880583,48009456,89090436,165392856,307137901,570427339,1059372394,1967174726,3652428851,6780867186,12588649487,23371307904,43391549313,80564509441,149586191201,277741246993,515685637121,957466871202,1777696968294,3300574138656,6128037839540,11377713165319,21124692081568,39221763522156,72822290559608,135207674105989,251037028238683,466094159116642
lpb $0
sub $0,1
add $2,4
mov $3,$0
bin $3,$2
add $1,$3
lpe
add $1,1
mov $0,$1
|
;/*
; * FreeRTOS Kernel V10.2.0
; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. 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.
; *
; * http://www.FreeRTOS.org
; * http://aws.amazon.com/freertos
; *
; * 1 tab == 4 spaces!
; */
.thumb
.ref ulRegTest1LoopCounter
.ref ulRegTest2LoopCounter
.def vRegTest1Implementation
.def vRegTest2Implementation
ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter
ulNVIC_INT_CTRL: .word 0xe000ed04
;/*-----------------------------------------------------------*/
.align 4
vRegTest1Implementation: .asmfunc
;/* Fill the core registers with known values. */
mov r0, #100
mov r1, #101
mov r2, #102
mov r3, #103
mov r4, #104
mov r5, #105
mov r6, #106
mov r7, #107
mov r8, #108
mov r9, #109
mov r10, #110
mov r11, #111
mov r12, #112
;/* Fill the VFP registers with known values. */
vmov d0, r0, r1
vmov d1, r2, r3
vmov d2, r4, r5
vmov d3, r6, r7
vmov d4, r8, r9
vmov d5, r10, r11
vmov d6, r0, r1
vmov d7, r2, r3
vmov d8, r4, r5
vmov d9, r6, r7
vmov d10, r8, r9
vmov d11, r10, r11
vmov d12, r0, r1
vmov d13, r2, r3
vmov d14, r4, r5
vmov d15, r6, r7
reg1_loop:
;/* Check all the VFP registers still contain the values set above.
;First save registers that are clobbered by the test. */
push { r0-r1 }
vmov r0, r1, d0
cmp r0, #100
bne reg1_error_loopf
cmp r1, #101
bne reg1_error_loopf
vmov r0, r1, d1
cmp r0, #102
bne reg1_error_loopf
cmp r1, #103
bne reg1_error_loopf
vmov r0, r1, d2
cmp r0, #104
bne reg1_error_loopf
cmp r1, #105
bne reg1_error_loopf
vmov r0, r1, d3
cmp r0, #106
bne reg1_error_loopf
cmp r1, #107
bne reg1_error_loopf
vmov r0, r1, d4
cmp r0, #108
bne reg1_error_loopf
cmp r1, #109
bne reg1_error_loopf
vmov r0, r1, d5
cmp r0, #110
bne reg1_error_loopf
cmp r1, #111
bne reg1_error_loopf
vmov r0, r1, d6
cmp r0, #100
bne reg1_error_loopf
cmp r1, #101
bne reg1_error_loopf
vmov r0, r1, d7
cmp r0, #102
bne reg1_error_loopf
cmp r1, #103
bne reg1_error_loopf
vmov r0, r1, d8
cmp r0, #104
bne reg1_error_loopf
cmp r1, #105
bne reg1_error_loopf
vmov r0, r1, d9
cmp r0, #106
bne reg1_error_loopf
cmp r1, #107
bne reg1_error_loopf
vmov r0, r1, d10
cmp r0, #108
bne reg1_error_loopf
cmp r1, #109
bne reg1_error_loopf
vmov r0, r1, d11
cmp r0, #110
bne reg1_error_loopf
cmp r1, #111
bne reg1_error_loopf
vmov r0, r1, d12
cmp r0, #100
bne reg1_error_loopf
cmp r1, #101
bne reg1_error_loopf
vmov r0, r1, d13
cmp r0, #102
bne reg1_error_loopf
cmp r1, #103
bne reg1_error_loopf
vmov r0, r1, d14
cmp r0, #104
bne reg1_error_loopf
cmp r1, #105
bne reg1_error_loopf
vmov r0, r1, d15
cmp r0, #106
bne reg1_error_loopf
cmp r1, #107
bne reg1_error_loopf
;/* Restore the registers that were clobbered by the test. */
pop {r0-r1}
;/* VFP register test passed. Jump to the core register test. */
b reg1_loopf_pass
reg1_error_loopf:
;/* If this line is hit then a VFP register value was found to be
;incorrect. */
b reg1_error_loopf
reg1_loopf_pass:
cmp r0, #100
bne reg1_error_loop
cmp r1, #101
bne reg1_error_loop
cmp r2, #102
bne reg1_error_loop
cmp r3, #103
bne reg1_error_loop
cmp r4, #104
bne reg1_error_loop
cmp r5, #105
bne reg1_error_loop
cmp r6, #106
bne reg1_error_loop
cmp r7, #107
bne reg1_error_loop
cmp r8, #108
bne reg1_error_loop
cmp r9, #109
bne reg1_error_loop
cmp r10, #110
bne reg1_error_loop
cmp r11, #111
bne reg1_error_loop
cmp r12, #112
bne reg1_error_loop
;/* Everything passed, increment the loop counter. */
push { r0-r1 }
ldr r0, ulRegTest1LoopCounterConst
ldr r1, [r0]
adds r1, r1, #1
str r1, [r0]
pop { r0-r1 }
;/* Start again. */
b reg1_loop
reg1_error_loop:
;/* If this line is hit then there was an error in a core register value.
;The loop ensures the loop counter stops incrementing. */
b reg1_error_loop
.endasmfunc
;/*-----------------------------------------------------------*/
.align 4
vRegTest2Implementation: .asmfunc
;/* Set all the core registers to known values. */
mov r0, #-1
mov r1, #1
mov r2, #2
mov r3, #3
mov r4, #4
mov r5, #5
mov r6, #6
mov r7, #7
mov r8, #8
mov r9, #9
mov r10, #10
mov r11, #11
mov r12, #12
;/* Set all the VFP to known values. */
vmov d0, r0, r1
vmov d1, r2, r3
vmov d2, r4, r5
vmov d3, r6, r7
vmov d4, r8, r9
vmov d5, r10, r11
vmov d6, r0, r1
vmov d7, r2, r3
vmov d8, r4, r5
vmov d9, r6, r7
vmov d10, r8, r9
vmov d11, r10, r11
vmov d12, r0, r1
vmov d13, r2, r3
vmov d14, r4, r5
vmov d15, r6, r7
reg2_loop:
;/* Check all the VFP registers still contain the values set above.
;First save registers that are clobbered by the test. */
push { r0-r1 }
vmov r0, r1, d0
cmp r0, #-1
bne reg2_error_loopf
cmp r1, #1
bne reg2_error_loopf
vmov r0, r1, d1
cmp r0, #2
bne reg2_error_loopf
cmp r1, #3
bne reg2_error_loopf
vmov r0, r1, d2
cmp r0, #4
bne reg2_error_loopf
cmp r1, #5
bne reg2_error_loopf
vmov r0, r1, d3
cmp r0, #6
bne reg2_error_loopf
cmp r1, #7
bne reg2_error_loopf
vmov r0, r1, d4
cmp r0, #8
bne reg2_error_loopf
cmp r1, #9
bne reg2_error_loopf
vmov r0, r1, d5
cmp r0, #10
bne reg2_error_loopf
cmp r1, #11
bne reg2_error_loopf
vmov r0, r1, d6
cmp r0, #-1
bne reg2_error_loopf
cmp r1, #1
bne reg2_error_loopf
vmov r0, r1, d7
cmp r0, #2
bne reg2_error_loopf
cmp r1, #3
bne reg2_error_loopf
vmov r0, r1, d8
cmp r0, #4
bne reg2_error_loopf
cmp r1, #5
bne reg2_error_loopf
vmov r0, r1, d9
cmp r0, #6
bne reg2_error_loopf
cmp r1, #7
bne reg2_error_loopf
vmov r0, r1, d10
cmp r0, #8
bne reg2_error_loopf
cmp r1, #9
bne reg2_error_loopf
vmov r0, r1, d11
cmp r0, #10
bne reg2_error_loopf
cmp r1, #11
bne reg2_error_loopf
vmov r0, r1, d12
cmp r0, #-1
bne reg2_error_loopf
cmp r1, #1
bne reg2_error_loopf
vmov r0, r1, d13
cmp r0, #2
bne reg2_error_loopf
cmp r1, #3
bne reg2_error_loopf
vmov r0, r1, d14
cmp r0, #4
bne reg2_error_loopf
cmp r1, #5
bne reg2_error_loopf
vmov r0, r1, d15
cmp r0, #6
bne reg2_error_loopf
cmp r1, #7
bne reg2_error_loopf
;/* Restore the registers that were clobbered by the test. */
pop {r0-r1}
;/* VFP register test passed. Jump to the core register test. */
b reg2_loopf_pass
reg2_error_loopf
;/* If this line is hit then a VFP register value was found to be
;incorrect. */
b reg2_error_loopf
reg2_loopf_pass
cmp r0, #-1
bne reg2_error_loop
cmp r1, #1
bne reg2_error_loop
cmp r2, #2
bne reg2_error_loop
cmp r3, #3
bne reg2_error_loop
cmp r4, #4
bne reg2_error_loop
cmp r5, #5
bne reg2_error_loop
cmp r6, #6
bne reg2_error_loop
cmp r7, #7
bne reg2_error_loop
cmp r8, #8
bne reg2_error_loop
cmp r9, #9
bne reg2_error_loop
cmp r10, #10
bne reg2_error_loop
cmp r11, #11
bne reg2_error_loop
cmp r12, #12
bne reg2_error_loop
;/* Increment the loop counter to indicate this test is still functioning
;correctly. */
push { r0-r1 }
ldr r0, ulRegTest2LoopCounterConst
ldr r1, [r0]
adds r1, r1, #1
str r1, [r0]
;/* Yield to increase test coverage. */
movs r0, #0x01
ldr r1, ulNVIC_INT_CTRL
lsl r0, r0, #28 ;/* Shift to PendSV bit */
str r0, [r1]
dsb
pop { r0-r1 }
;/* Start again. */
b reg2_loop
reg2_error_loop:
;/* If this line is hit then there was an error in a core register value.
;This loop ensures the loop counter variable stops incrementing. */
b reg2_error_loop
;/*-----------------------------------------------------------*/
.end
|
%include "macro.asm"
global _start
_start:
extern proc
global buffer,abuflen
section .text
pop rcx
pop rcx
pop rcx
mov [filename],rcx
open [filename]
cmp rax,-1h
je error
mov [filehandle],rax
read [filehandle],buffer,buflen
dec rax
mov [abuflen],rax
call proc
exit:
close [filehandle]
mov rax,60
mov rdi,0
syscall
error:
disp msg1,len1
jmp exit
section .data
msg1:db "Error in opening file......."
len1: equ $-msg1
section .bss
buffer resb 200
buflen resb 200
filename resb 100
filehandle resb 200
abuflen resb 200
|
;;
;; Copyright (c) 2020-2022, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;; * Neither the name of Intel Corporation nor the names of its contributors
;; may be used to endorse or promote products derived from this software
;; without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
;;; Routine to compute CBC-MAC based on 256 bit CBC AES encryption code
%include "include/aesni_emu.inc"
%define AES_CBC_ENC_X4
%define CBC_MAC
%include "sse/aes256_cbc_enc_x4_sse.asm"
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x11674, %r13
nop
nop
nop
nop
and $44007, %rbp
mov $0x6162636465666768, %r12
movq %r12, (%r13)
and %r8, %r8
lea addresses_UC_ht+0x6c4a, %rsi
lea addresses_WC_ht+0xea30, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $42, %rcx
rep movsb
add %rsi, %rsi
lea addresses_WT_ht+0x16990, %r13
nop
cmp %rax, %rax
vmovups (%r13), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rsi
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0xe798, %r8
cmp %r12, %r12
and $0xffffffffffffffc0, %r8
movaps (%r8), %xmm4
vpextrq $1, %xmm4, %rsi
nop
nop
dec %rsi
lea addresses_normal_ht+0x160ad, %r12
cmp %rax, %rax
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
movups %xmm4, (%r12)
nop
nop
inc %rdi
lea addresses_WT_ht+0x174e0, %r12
nop
nop
nop
nop
nop
and %r13, %r13
movups (%r12), %xmm7
vpextrq $0, %xmm7, %rdi
nop
nop
nop
nop
nop
xor $59929, %rsi
lea addresses_A_ht+0x12c48, %rax
nop
nop
nop
nop
nop
add $16960, %rbp
mov $0x6162636465666768, %rdi
movq %rdi, (%rax)
nop
nop
add %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rbp
push %rdi
push %rsi
// Faulty Load
lea addresses_normal+0x19230, %rsi
nop
nop
nop
nop
nop
xor $33616, %r10
movups (%rsi), %xmm4
vpextrq $0, %xmm4, %rbp
lea oracles, %rsi
and $0xff, %rbp
shlq $12, %rbp
mov (%rsi,%rbp,1), %rbp
pop %rsi
pop %rdi
pop %rbp
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
// $Id$
#include "Options.h"
#include "SMR_Server.h"
#include "ace/Log_Msg.h"
SMR_Server::SMR_Server (short port_number)
{
if (CM_Server::open (port_number) < 0)
ACE_ERROR ((LM_ERROR,
"%p\n%a",
Options::program_name,
1));
}
SMR_Server::~SMR_Server (void)
{
}
|
; A112415: a(n) = C(1+n,1) * C(2+n,1) * C(4+n,2).
; 12,60,180,420,840,1512,2520,3960,5940,8580,12012,16380,21840,28560,36720,46512,58140,71820,87780,106260,127512,151800,179400,210600,245700,285012,328860,377580,431520,491040,556512,628320,706860,792540,885780,987012,1096680,1215240,1343160,1480920,1629012,1787940,1958220,2140380,2334960,2542512,2763600,2998800,3248700,3513900,3795012,4092660,4407480,4740120,5091240,5461512,5851620,6262260,6694140,7147980,7624512,8124480,8648640,9197760,9772620,10374012,11002740,11659620,12345480,13061160
add $0,4
bin $0,4
mul $0,12
|
include "hardware.inc" ; Community standard hardware.inc
include "includesm.inc" ; My own macros.
; Suggested tab width: 8
; bgbtest.gb has the nibbles of the joypad variables swapped compared to
; the community hardware.inc. I happened to standardize on the opposite
; order compared to most other software, as well as the definitions in
; hardware.inc. The below purges and redefines the EQUs from hardware.inc.
;
; This is needed to produce a binary that's identical to the one shipped
; with BGB. The code would mainly work fine if these lines were removed
; and the swap A instruction in READPAD was moved to after the D pad
; group instead of the button group. However, this would change the
; order of the musical scale and the easter egg button sequence.
PURGE PADF_DOWN,PADF_UP,PADF_LEFT,PADF_RIGHT,PADF_START,PADF_SELECT,PADF_B,PADF_A
PURGE PADB_DOWN,PADB_UP,PADB_LEFT,PADB_RIGHT,PADB_START,PADB_SELECT,PADB_B,PADB_A
PADF_DOWN EQU $08
PADF_UP EQU $04
PADF_LEFT EQU $02
PADF_RIGHT EQU $01
PADF_START EQU $80
PADF_SELECT EQU $40
PADF_B EQU $20
PADF_A EQU $10
PADB_DOWN EQU $3
PADB_UP EQU $2
PADB_LEFT EQU $1
PADB_RIGHT EQU $0
PADB_START EQU $7
PADB_SELECT EQU $6
PADB_B EQU $5
PADB_A EQU $4
; Crash handler: endless loop of ld B,B (break).
; We should certainly never reach this code, but this may be useful for
; emulator authors debugging their emulator. If a crash would happen on
; hardware due to a hardware glitch, this might also decrease the risk
; of graphical corruption from the recursive call to $0038 that would
; otherwise ensue.
SECTION "CRASH",ROM0[$38]
CRASH::
BREAK
jr CRASH
SECTION "VBLINT",ROM0[$40]
; Slim interrupt handler: push only AF and HL for potential faster interrupt return.
push AF
push HL
jp HANDLE_VBL
SECTION "LCDINT",ROM0[$48]
LCDINT::
; Slim interrupt handler: push only AF and HL for potential faster interrupt return.
push AF
push HL
; Sine wave effect.
ld HL,slowfc ; Slow frame counter.
ldh A,[rLY] ; Current scanline.
cp 80 ; Check if we're on the last scanline that should be affected by the effect.
jr nc,.lastline
add [HL] ; Add frame counter to animate the effect.
and $1f ; MOD 32 using bit masking.
ld H,$0a ; Sine table, high address byte.
ld L,A ; Table index.
ld A,[HL]
sub $a ; Add some offset to center the logo
ldh [rSCX],A ; Change BG X scroll position.
pop HL
pop AF
reti
.lastline
xor A ; A=0
ldh [rSCX],A ; Restore SCX.
inc A ; A=1, only VBlank interrupt enabled.
ldh [rIE],A
pop HL
pop AF
reti
SECTION "ENTRY",ROM0[$100]
nop
jp ENTRY
SECTION "HEADERFILLER",ROM0[$104]
; Fill the header with null bytes to prevent other sections from
; getting placed there. rgbfix will fill in header data.
rept $4c
DB $00
endr
SECTION "MAIN",ROM0[$150]
ENTRY::
di
ld SP,$fffe
WAITVBL ; Wait for VBlank.
xor A
ldh [rLCDC],A ; Turn off LCD (may only be done in VBlank).
; Clear memory
ld HL,_VRAM ; Clear video RAM.
ld DE,$2000 ; Length.
call CLEAR_MEM
ld HL,_RAM ; Clear work RAM.
ld DE,$2000 ; Length.
call CLEAR_MEM
; Copy text tiles
ld HL,$8010 ; Start at tile 1, to keep tile 0 empty.
ld BC,TEXT_TILES
ld DE,TEXT_TILES_End-TEXT_TILES ; Length.
call COPY_MEM_V1BIT ;
; Copy sprite tiles.
ld HL,$8800 ; Tile $80.
ld BC,SPRITE_TILES
ld DE,SPRITE_TILES_End-SPRITE_TILES; Length.
call COPY_MEM
; Copy OAM DMA routine.
ld HL,OAM_DMA ; High RAM.
ld BC,OAM_DMA_Src
ld DE,OAM_DMA_End-OAM_DMA_Src ; Length.
call COPY_MEM
ld HL,$9800
ld DE,TILEDEF
call DECOMPRESS
ld HL,OAMSOURCE ; The OAM DMA source in WRAM.
ld BC,OAMSOURCE_INITVALUES ; Initial OAM contents.
ld DE,$a0 ; Size of OAM.
call COPY_MEM
call INIT_SOUND
; Turn on LCD.
ld A,LCDCF_ON|LCDCF_WIN9C00|LCDCF_WINOFF|LCDCF_BG8000|LCDCF_BG9800|LCDCF_OBJ8|LCDCF_OBJON|LCDCF_BGON
ld [rLCDC],A
; Set up palettes.
ld A,%00011011 ; Inverted palette.
ldh [rBGP],A
ldh [rOBP0],A
ld A,%01000000 ; OBP1 palette. (Used for the stars.)
ldh [rOBP1],A
; Set up interrupts and scroll positions.
ld A,STATF_MODE00 ; LCD interrupt reason (every HBlank).
ldh [rSTAT],A
ld A,IEF_VBLANK|IEF_LCDC
ldh [rIE],A
ld A,IEF_VBLANK ; Leave wavy effect turned off by default.
ld [current_ie],A
ld A,8 ; BG scroll Y position
ldh [rSCY],A
xor A ; A=0
ldh [rIF],A
ldh [rSCX],A
; Init RNG and misc variables.
ld hl,SHIFTREG ; Seed shift register with some random-looking values.
ld [hl],$c5
inc HL
ld [hl],$a7
ld A,1
ld [tickcounter],A ; Trigger wave channel on next tick
ld A,$80
ld [easteregg_nextbutton],A ; Init next expected button for the easter egg.
; All initialization is done. Enable interrupts globally and start the main program.
ei
; Main idle loop
.el halt
nop
jr .el
HANDLE_VBL::
push BC ; Push the other two registers that weren't pushed initially.
push DE
; High priority tasks. (Needs VRAM/OAM access. Should be finished within the VBlank period.)
call READPAD ; Read button inputs.
call KEYINDICATORS ; Draw graphics indicating which buttons are currently held.
call OAM_DMA ; OAM DMA. (Updates the stars as well as the D pad indicators.)
; Process frame counters.
ld HL,framecounter ; Frame counter.
inc [HL] ; Increments on each frame.
ld A,[HL+] ; Read back value. (HL now points to slowfc)
srl A ; Right shift used as division. (/2)
srl A ; Right shift used as division. (/4)
ld [HL],A ; Write slowfc. Slow frame counter that increments every 4th frame. Used for the easter egg sine animation.
; Re-init some value at the start of the frame.
ld A,%01000000 ; OBP1 palette. (Used for the stars.)
ldh [rOBP1],A
xor A
ldh [rSCX],A
ld A,[current_ie] ; Current value of IE.
ldh [rIE],A
; Low priority tasks. (Don't need to be done within VBlank.)
call STARFIELD_ADVANCE ; Advance the state of the starfield animation in shadow OAM.
call PLAYNOTES ; Play notes if new buttons have been detected.
call MELODY_ADVANCE ; Advance the state of the pseudorandom ch3 melody.
call CHECK_SCALE ; Check whether the user is pressing the buttons in the order of the musical scale.
pop DE ; Unusual pop order due to slim interrupt handling.
pop BC
pop HL
pop AF
reti
STARFIELD_ADVANCE::
ld BC,OAMSOURCE+4*$10 ; Start at sprite slot $10.
; +0
.starloop
inc C ; +1
inc C ; +2
inc C ; +3
ld A,[BC] ; Get attribute byte.
and $03 ; Get lower bits (speed). Here, we're using memory bits that are unused by the hardware to store the current speed of a star.
ld E,A
dec C ; +2
dec C ; +1
ld A,[BC] ; Get X position.
sub E ; Subtract speed value to produce left motion.
jr c,.reinitstar ; If carry is set (moved past left side of screen) reinit the star with a random position and speed.
ld [BC],A ; Get X position.
inc C ; +2
inc C ; +3
inc C ; +4 (next array index)
.starcheck
ld A,C ; Check if we're at the end of the OAM shadow buffer.
cp $A0
jr nz,.starloop
ret
.reinitstar
ld A,168
ld [BC],A ; Write X position.
dec C ; +0
ld A,[BC] ; Check if Y position = 01 (reinit X pos needed).
dec A
jr nz,.nofirstinit
call RANDOM ; Generate new random number. (X pos.)
inc C ; +1
ld [BC],A ; Reinit X pos
dec C ; +0
.nofirstinit
call RANDOM
and $7f ; Limit Y position to 0-$7f
add 2
ld [BC],A ; Write Y position
inc C ; +1
inc C ; +2
call RANDOM ; Generate new random number. (Star type.)
and $01 ; Limit random value to 0/1
add $90 ; Star tile offset.
ld [BC],A ; Write tile index
inc C ; +3
ld A,L ; Get some randomness for the scroll speed
and $0f
.subloop ; Determine (simplified) YPOS%3
ld E,A
sub 3
jr nc,.subloop
inc E ; Make sure E is >0
or A,OAMF_PRI|OAMF_PAL1
ld [BC],A ; Write sprite attributes
inc C ; +4 (next array index)
jr .starcheck
; Check for secret button sequence to unlock the sine wave effect.
; Toggle the effect if the notes are played in ascending pitch.
; 04 se st b a
; 02 08 01 40 80 20 10
; Start, Select, B, A, Down, Up, Left, Right
CHECK_SCALE::
ld A,[joyp_new_buttons]
or A
ret z ; Return if no buttons were pressed.
ld HL,easteregg_nextbutton ; v
bit 7,A ; v Always check for start. (Or whichever button is represented by bit 7, see the remark at the start.)
jr nz,.start ; +->
and [HL] ; Check if pressed button matches current expected button
jr z,.wrongkey
ld A,[HL]
srl A ; Move the sentinel bit one step to the right to detect the next button in the sequence.
jr c,.sequence_final ; If the bit has reached, toggle the effect
ld [HL],A
ret
.sequence_final
dec L ; current_ie
ld A,[HL]
xor IEF_LCDC
ld [HL+],A ; HL+ makes HL=easteregg_nextbutton
; Fallthrough
.wrongkey
ld [HL],$80 ; Reset to start value
ret
.start
ld [HL],$40 ; Make sure you can always press start as the first part of a sequence.
; If start triggers the .wrongkey condition, you'd need to press it again
; to advance the sequence.
ret
; Out data
; 04 se st b a
; 02 08 01 40 80 20 10
PLAYNOTES::
ld A,[joyp_held_buttons]
xor PADF_SELECT|PADF_START ; Check if select and start are simultaneously held.
and PADF_SELECT|PADF_START ; Sets z if both are held.
ld A,[joyp_new_buttons] ; Load the newly pressed buttons this frame.
jr z,.togglemelody ; Flags are preserved from the check above.
.notogglemelody
ld B,A
ld HL,SHIFTREG ; Mix up the shift register a bit for more randomness
xor [HL]
ld A,[HL]
ld A,B
ld HL,NOTETABLE
.noteloop ; Iterate through all of the bits in the joypad register
add A ; Left shift out one bit into c.
jr c,.triggernote ; If the button was newly pressed this frame, trigger a note.
inc HL ; Step over one entry in the note table for each loop iteration.
inc HL
;or A ; Zero check. Not needed - the z flag presists from the add A instruction above.
jr nz,.noteloop
ret
; If select is held and start pushed, toggle the wave channel.
; From the check above, we know that select and start are both held.
; Additionally check if start was newly pressed this frame.
.togglemelody
bit PADB_START,A ; Start
jr z,.notogglemelody ; Start was not newly pressed this frame. Go back and check for other buttons...
ldh A,[rAUDTERM] ; Start was pressed. Toggle the enable bits for channel 3.
xor $44
ldh [rAUDTERM],A
ret ; Return and do not play note for this start press. (This is intended behavior.)
; However, this means that any other buttons pressed this exact frame will also be ignored.
.triggernote
push AF ; Temporarily save AF.
ld C,LOW(rAUD1LOW) ; PU1 freq lo.
ld B,0 ; Don't detune.
ld A,[currentchannel] ; Toggle which channel is active.
xor 1
ld [currentchannel],A
jr nz,.channel1
ld C,LOW(rAUD2LOW) ; PU2 freq lo.
ld B,2 ; Detune.
.channel1
ld A,[HL+] ; Read low byte of frequency value.
add B ; Add detune parameter.
ld [$ff00+C],A ; Write the low byte of the frequency value.
inc C ; PU1/2 freq hi is the next byte after freq lo.
ld A,[HL+] ; Read high byte of the frequency value.
or $80 ; Trigger the sound.
ld [$ff00+C],A ; Write the high byte of the frequency value.
pop AF ; Restore AF
jr .noteloop ; Continue the loop.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 8 specific note values for each of the 8 buttons.
NOTETABLE::
dw 1546 ; C5
dw 1602 ; D5
dw 1650 ; E5
dw 1673 ; F5
dw 1714 ; G5
dw 1750 ; A5
dw 1767 ; A#5
dw 1798 ; C6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Advance the state of the pseudorandom CH3 melody.
MELODY_ADVANCE::
ld BC,tickcounter ; Tick countdown until the next step.
ld A,[BC]
dec A
ld [BC],A
ret nz ; Return of the the tick counter is still >0.
ld A,4 ; Reload the tick counter. (A new music event happens every 4th frame.)
ld [BC],A
ld C,LOW(rAUD3LEVEL) ; CH3 audio level.
ld A,[$ff00+C]
and %01100000 ; Mask out the volume bits
jr z,.doplay ; z=currently muted. (Play a new note.)
add $20 ; Cycle through the values %10, %11, %00 (1/2, 1/4, 0).
ld [$ff00+C],A
ret
.doplay
ld HL,barcounter ; Counter that is incremented on each step.
inc [HL]
ld A,[HL]
and $02 ; Check which step we're on.
ld C,A ; Save.
call RANDOM ; Generate random numbers. Leaves a random value in HL.
ld A,C ; Restore.
; On barcounter%4 == 0,1 always play a new note.
; On barcounter%4 == 2,3 randomly skip the current note with a 50% probability.
or A
jr z,.noexit
bit 0,L
ret z
.noexit
ld D,0 ; Prepare upper byte of DE for 16-bit addition.
ld A,H ; Get part of the random value from before.
and $07 ; A%=8 (8 entries in the note table.)
add A ; A*=2 (Each entry is 2 bytes big.)
ld E,A ; Prepare lower byte of DE for 16-bit addition.
ld HL,NOTETABLE
add HL,DE
ld A,$80
ldh [rAUD3ENA],A ; Turn on CH3 playback.
ld A,$40 ; 1/2 volume.
ldh [rAUD3LEVEL],A
ld C,LOW(rAUD3LOW) ; CH3 freq lo.
ld A,[HL+] ; Read low byte.
ld [$ff00+C],A ; Write CH3 freq lo.
inc C ; C is now pointing to CH3 freq hi.
ld A,[HL+] ; Read high byte.
or $80 ; Trigger note.
ld [$ff00+C],A ; Write CH3 freq hi.
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Generate new random data using a LFSR.
RANDOM::
ld DE,SHIFTREG
ld A,[DE]
ld H,A
inc E
ld A,[DE]
ld L,A
add HL,HL
jr nc,.nocarry
set 0,l
.nocarry
ld A,L ; Useful for ld [DE],A later
bit 7,H
jr z,.nocarry2
xor 1
.nocarry2
ld [DE],A
dec E
ld A,H
ld [DE],A
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Parse the currently held buttons and indicate them on screen.
KEYINDICATORS:
ld A,[joyp_held_buttons] ; Currently held buttons.
ld B,A
; The button group (select, start, B, A) is indicated in the BG map to save on the number of sprites.
;;;; Check for select.
ld A,$94 ; First tile index for the tiles of the select indicator.
bit PADB_SELECT,B ; Check if select is pressed.
jr nz,.sel
add $10 ; If not pressed, add $10 to the tile index to produce an unused tiles for clearing the indicator.
.sel
ld HL,$9a07 ; Position in VRAM for the indicator.
ld [HL+],A ; Write or clear the indicator. (Two tiles.)
inc A
ld [HL+],A
inc L
;;;; Start
ld A,$96 ; First tile index for the tiles of the start indicator.
bit PADB_START,B ; Check if start is pressed.
jr nz,.start
add $10 ; If not pressed, add $10 to the tile index to produce an unused tiles for clearing the indicator.
.start
;ld HL,$9a0a ; HL=$9a0a from the select code so this line is redundant and commented out.
ld [HL+],A ; Write or clear the indicator. (Two tiles.)
inc A
ld [HL+],A
;;;; B
ld A,$9c ; First tile index for the tiles of the B indicator.
bit PADB_B,B ; Check if B is pressed.
jr nz,.butb
add $10 ; If not pressed, add $10 to the tile index to produce an unused tiles for clearing the indicator.
.butb
ld HL,$99ad ; Position in VRAM for the indicator. (Four tiles.)
ld [HL+],A
inc A
ld [HL+],A
inc L
inc A
ld L,$cd ; Second row.
ld [HL+],A
inc A
ld [HL-],A
;;;; A
ld A,$98 ; First tile index for the tiles of the A indicator.
bit PADB_A,B ; Check if A is pressed.
jr nz,.buta
add $10 ; If not pressed, add $10 to the tile index to produce an unused tiles for clearing the indicator.
.buta
ld HL,$9990 ; Position in VRAM for the indicator. (Four tiles.)
ld [HL+],A
inc A
ld [HL+],A
inc L
inc A
ld L,$b0 ; Second row.
ld [HL+],A
inc A
ld [HL-],A
; The D pad group is indicated using sprites to make use of X and Y mirroring to produce all 4 graphics using a single tile.
; XOFFSET and YOFFSET set global offsets for tweaking the position of the D pad indicator group.
XOFFSET = 8 +24
YOFFSET = 16 +96
ld H,HIGH(OAMSOURCE) ; OAM source high byte.
;;;; D
ld A,YOFFSET+8 ; Intended Y position.
bit PADB_DOWN,B
jr nz,.butD
xor A ; If not pressed, Y=0.
.butD
ld L,0 ; Set Y position for sprites slots 0 and 1.
ld [HL],A
ld L,4
ld [HL],A
;;;; U
ld A,YOFFSET-16 ; Intended Y position.
bit PADB_UP,B
jr nz,.butU
xor A ; If not pressed, Y=0.
.butU
ld L,8 ; Set Y position for sprites slots 2 and 3.
ld [HL],A
ld L,$c
ld [HL],A
;;;; L
ld A,XOFFSET-16 ; Intended X position. (Here we set X instead of Y since L and R are graphically vertical.)
bit PADB_LEFT,B
jr nz,.butL
xor A ; If not pressed, X=0.
.butL
ld L,$10+1 ; Set X position for sprites slots 4 and 5.
ld [HL],A
ld L,$14+1
ld [HL],A
;;;; R
ld A,XOFFSET+8 ; Intended X position. (Here we set X instead of Y since L and R are graphically vertical.)
bit PADB_RIGHT,B
jr nz,.butR
xor A ; If not pressed, X=0.
.butR
ld L,$18+1 ; Set X position for sprites slots 6 and 7.
ld [HL],A
ld L,$1c+1
ld [HL],A
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clear memory.
;; HL = Destination address
;; DE = Number of bytes to clear
CLEAR_MEM::
call ADJUST_E
.clearloop
ld [HL+],A
dec E
jr nz,.clearloop
dec D
jr nz,.clearloop
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copy memory
;; HL = Destination address
;; BC = Source address
;; DE = Number of bytes to copy
COPY_MEM::
call ADJUST_E
.clearloop
ld A,[BC]
ld [HL+],A
inc BC
dec E
jr nz,.clearloop
dec D
jr nz,.clearloop
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copy memory and expand 1 bit compression
;; HL = Destination address
;; BC = Source address
;; DE = Number of source bytes to copy.
;; Will produce twice as many output bytes
COPY_MEM_V1BIT::
call ADJUST_E
.clearloop
ld A,[BC]
ld [HL+],A
;xor A
ld [HL+],A
inc BC
dec E
jr nz,.clearloop
dec D
jr nz,.clearloop
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Adjust length parameter for copy/clear loops
ADJUST_E::
push AF
ld A,E
or A ; Check if lower byte of length is 0. If not, increment D to give correct to be used in the loop
jr z,.lb_is_zero
inc D
.lb_is_zero
pop AF
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Decompress RLE etc data
DECOMPRESS::
tileprint_loop::
ld A,[DE]
inc DE
cp $c0 ; RLE (Run length encoding)
jr z,rle
cp $e0 ; Extended command.
jr z,ext_cmd
ld [HL+],A ; Misc character. Continue.
jr tileprint_loop
seq_plus::
ld A,[DE] ; Read start value.
ld B,A
inc DE
ld A,[DE] ; Read length.
ld C,A
ld A,B
inc DE
seq_plus_loop:
ld [HL+],A
inc A
dec C
jr nz,seq_plus_loop
jr tileprint_loop
rle::
ld A,[DE] ; Read the byte to repeat.
ld B,A
inc DE
ld A,[DE] ; Number of times.
ld C,A
ld A,B
inc DE
rle_loop::
ld [HL+],A
dec C
jr nz,rle_loop
jr tileprint_loop
ext_cmd::
ld A,[DE]
inc DE
cp $ff
ret z ; EOF. Return.
cp $f3
jr z,seq_plus ; Sequence.
.el
ld b,b ; Error condition. Break.
jr .el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The OAM DMA routine.
OAM_DMA_Src::
ld a,HIGH(OAMSOURCE)
ldh [rDMA],a
ld a,$28
.dmaloop
dec a
jr nz,.dmaloop
ret
OAM_DMA_End::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Reads the joypad state and puts the result in joyp_held_buttons and joyp_new_buttons.
READPAD::
; Out data
; 04 se st b a
; 02 08 01 40 80 20 10
ld A,P1F_GET_DPAD ; Select D pad.
ldh [rP1],A
ldh A,[rP1]
ldh A,[rP1]
ldh A,[rP1]
ldh A,[rP1]
cpl ; Invert a to make pressed keys 1.
and $0f ; Mask lower nibble.
ld B,A ; Store result in B temporarily.
ld A,P1F_GET_BTN ; Select button group.
ldh [rP1],A
ldh A,[rP1]
ldh A,[rP1]
ldh A,[rP1]
ldh A,[rP1]
cpl ; Invert A to make pressed keys 1
and $0f ; Mask lower nibble
swap A ; Put button group data into the upper nibble.
or B ; Combine the values.
ld B,A ; Store result in B temporarily.
ld A,[joyp_held_buttons] ; Load which buttons were held in the previous frame.
xor B ; Produce the difference.
and B ; Mask by the currently held buttons to produce the newly pressed buttons.
ld [joyp_new_buttons],A
ld A,B
ld [joyp_held_buttons],a ; Store which buttons are currently held.
ld A,P1F_GET_NONE ; Deactivate joypad readout.
ld [rP1],A
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Initialize the sound hardware
INIT_SOUND:
xor A
ldh [rAUDENA],A ; Turn all sound off.
nop
nop
nop
nop
ld A,$80
ldh [rAUDENA],A ; Turn the sound circutry on again.
ld A,$ff
ldh [rAUDTERM],A ; Route all sound everywhere.
ld A,$77
ldh [rAUDVOL],A ; Master volume = full.
xor A
ldh [rAUD1SWEEP],A ; No sweep for ch1.
ldh [rAUD3LEVEL],A ; CH3 level.
ld A,$40 ; 25% duty.
ldh [rAUD1LEN],A
ldh [rAUD2LEN],A
ld A,$94 ; Volume envelope.
ldh [rAUD1ENV],A
ldh [rAUD2ENV],A
ld HL,CH3_WAVE
ld C,LOW(_AUD3WAVERAM) ; CH3 wave RAM.
.loop
ld A,[HL+] ; Copy the waveform into CH3 wave RAM.
ld [$ff00+C],A
inc C
ld A,C
cp LOW(_AUD3WAVERAM)+$10 ; Is C==the byte after wave RAM?
jr nz,.loop
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A sawtooth wave, as well as a few other waveform types I experimented with.
CH3_WAVE::
db $00,$11,$22,$33,$44,$55,$66,$77,$88,$99,$aa,$bb,$cc,$dd,$ee,$ff ; Sawtooth wave
;db $01,$23,$45,$67,$89,$ab,$cd,$ef,$fe,$dc,$ba,$98,$76,$54,$32,$10 ; Triangle wave
;db $00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Square wave
;db $00,$00,$00,$00,$cc,$cc,$cc,$cc,$44,$44,$44,$44,$ff,$ff,$ff,$ff ; Octave interval square wave
SECTION "GRAPHICS",ROM0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; All tile data used by the ROM.
; 1 bpp tiles
TEXT_TILES::
; 1 bpp tile for BGB text
incbin "res/bgb-text-1b.bin"
; "presbuton" tiles
incbin "res/presbuton-1b.bin"
TEXT_TILES_End::
; 2 bpp tiles
SPRITE_TILES::
; 2 bpp tiles for sprites
incbin "res/bgb-linv.bin"
; Stars. Manually created graphics.
db %11000000
db %11000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %11110000
db %11110000
db %11110000
db %11110000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
db %00000000
; 2 bpp tiles for sprites.
incbin "res/buttons.bin"
SPRITE_TILES_End::
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Compressed definition for the tilemap data. "Write once, read never" style data.
TILEDEF::
; BGB icon and text.
db $c0, $00, $20*3+6-5 ; RLE: $c0, <data>, <times>
db $e0, $f3, $80, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $00
db $e0, $f3, $01, $08 ; Sequence: $c0, $f3, <start value>, <times>
db $e0, $f3, $01, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $c0, $00, $20-$0c-5 ; RLE: $c0, <data>, <times>
db $e0, $f3, $84, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $00
db $e0, $f3, $09, $08 ; Sequence: $c0, $f3, <start value>, <times>
db $e0, $f3, $09, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $c0, $00, $20-$0c-5 ; RLE: $c0, <data>, <times>
db $e0, $f3, $88, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $00
db $e0, $f3, $11, $08 ; Sequence: $c0, $f3, <start value>, <times>
db $e0, $f3, $11, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $c0, $00, $20-$0c-5 ; RLE: $c0, <data>, <times>
db $e0, $f3, $8c, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $00
db $e0, $f3, $19, $08 ; Sequence: $c0, $f3, <start value>, <times>
db $e0, $f3, $19, $04 ; Sequence: $c0, $f3, <start value>, <times>
db $c0, $00, 2*$20+$0e+3 ; RLE: $c0, <data>, <times>
PB_offset = $21 ; Tile index offset at which the letters are stored.
;PRESS BUTTONS text.
db PB_offset,PB_offset+1,PB_offset+2,PB_offset+3,PB_offset+3,0,PB_offset+4,PB_offset+5,PB_offset+6,PB_offset+6,PB_offset+7,PB_offset+8,PB_offset+3
db $c0, $00, $20-10 ; RLE: $c0, <data>, <times>
db PB_offset+6,PB_offset+7,0,PB_offset+6,PB_offset+2,PB_offset+3,PB_offset+6
db $e0, $ff ; EOF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Initial OAM contents.
OAMSOURCE_INITVALUES::
; Initial values for the D pad graphics. (Those sprites are actually
; shown/hidden by changing the tile index so the Y/X values stay
; constant forever.)
XOFFSET = 8 +24
YOFFSET = 16 +96
PATOFFSET = $92 ; Tile index for the D pad corner piece.
; D
db YOFFSET+8, XOFFSET-8, PATOFFSET+0, OAMF_YFLIP
db YOFFSET+8, XOFFSET+0, PATOFFSET+0, OAMF_YFLIP|OAMF_XFLIP
; U
db YOFFSET-16, XOFFSET-8, PATOFFSET+0, 0
db YOFFSET-16, XOFFSET+0, PATOFFSET+0, OAMF_XFLIP
; L
db YOFFSET-8, XOFFSET-16, PATOFFSET+0, 0
db YOFFSET+0, XOFFSET-16, PATOFFSET+0, OAMF_YFLIP
; R
db YOFFSET-8, XOFFSET+8, PATOFFSET+0, OAMF_XFLIP
db YOFFSET+0, XOFFSET+8, PATOFFSET+0, OAMF_XFLIP|OAMF_YFLIP
rept 8
db 0,0,0,0
endr
; Sprites for sel, start, B, A
; Actually unused and commented out using "IF 0" because those
; indicators live in the tilemap.
IF 0;;;; Start of commented out code.
XOFFSET = 8 +8 ; Pos -8
YOFFSET = 16 +24 ; Pos -16
PATOFFSET = $80
db YOFFSET+0, XOFFSET+0, PATOFFSET+0, 0
db YOFFSET+0, XOFFSET+8, PATOFFSET+1, 0
db YOFFSET+0, XOFFSET+16, PATOFFSET+2, 0
db YOFFSET+0, XOFFSET+24, PATOFFSET+3, 0
db YOFFSET+8, XOFFSET+0, PATOFFSET+4, 0
db YOFFSET+8, XOFFSET+8, PATOFFSET+5, 0
db YOFFSET+8, XOFFSET+16, PATOFFSET+6, 0
db YOFFSET+8, XOFFSET+24, PATOFFSET+7, 0
db YOFFSET+16, XOFFSET+0, PATOFFSET+8, 0
db YOFFSET+16, XOFFSET+8, PATOFFSET+9, 0
db YOFFSET+16, XOFFSET+16, PATOFFSET+10, 0
db YOFFSET+16, XOFFSET+24, PATOFFSET+11, 0
db YOFFSET+24, XOFFSET+0, PATOFFSET+12, 0
db YOFFSET+24, XOFFSET+8, PATOFFSET+13, 0
db YOFFSET+24, XOFFSET+16, PATOFFSET+14, 0
db YOFFSET+24, XOFFSET+24, PATOFFSET+15, 0
ENDC ;;;; End of commented out code.
rept $a0-(4*16)
db $01
endr
; Sine table for the easter egg animation.
SECTION "SINETABLE",ROM0[$0a00]
db 0, 1, 1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15, 15, 15, 15, 15, 14, 13, 12, 11, 9, 8, 7, 5, 4, 3, 2, 1, 1
SECTION "VARS",WRAM0
SHIFTREG: dw ; Shift register state (RNG)
joyp_held_buttons: db ; Currently held buttons.
joyp_new_buttons: db ; Newly pressed buttons this frame.
currentchannel: db ; Which of the pulse channels is in use.
tickcounter: db ; Counter that counts down until the next note step.
barcounter: db ; Counter that keeps track of which "step" the notes are on.
; framecounter and slowfc must be consecutive. (Relies on pointer increments to access the second variable.)
framecounter: db ; Frame counter (increments each frame.)
slowfc: db ; Slow frame counter that increments every
; 4th frame. Used for the easter egg sine animation.
; current_ie and easteregg_nextbutton must be consecutive. (Relies on pointer increments to access the second variable.)
current_ie: db ; The current global value of rIE. (The easter
; egg effect turns itself off at a certain
; line, and the VBL handler restores this value.)
easteregg_nextbutton: db ; The next expected button press for the easter
; egg activation sequence.
SECTION "OAMSOURCE",WRAM0[$c100]
OAMSOURCE: ds $A0 ; Shadow OAM storage.
SECTION "HIVARS",HRAM[$FF80]
OAM_DMA:
ds OAM_DMA_End-OAM_DMA_Src ; Space for the OAM DMA routine.
|
; A229278: Number of ascending runs in {1,...,4}^n.
; 0,4,26,144,736,3584,16896,77824,352256,1572864,6946816,30408704,132120576,570425344,2449473536,10468982784,44560285696,188978561024,798863917056,3367254360064,14156212207616,59373627899904,248489627877376,1037938976620544,4327677766926336,18014398509481984,74872343805034496,310748374288564224,1288029493427961856,5332261958806667264,22049623775605948416,91080798863940911104,375852410501832114176,1549526502191602335744,6382573449503504859136,26268163560962401501184,108024133295643134263296,443902449389746650087424,1822833462387683052486656,7480228508865518018494464,30676492672721215308169216,125728285239921434169442304,515002399155832028424830976,2108366629407913280687570944,8626894648769993790703271936,35281291119633337834625040384,144220014576746802025747972096,589259458699841010851983130624,2406555436370779254403897491456,9824292151768777861599449841664,40089450232217754822333238870016,163526927429441592793074713493504,666784215720048665187265886027776,2717842886889323836808931672326144,11074195643593812051475199202164736,45108078958521315022858686860099584,183677501370669527359266307646160896,747690747629015178508391471407693824
mov $2,$0
lpb $0
add $1,1
add $1,$2
add $2,$0
sub $0,1
trn $2,$1
add $2,$1
sub $2,1
add $2,$1
mul $1,2
lpe
mov $0,$1
|
Name: zel_sut3.asm
Type: file
Size: 67193
Last-Modified: '2016-05-13T04:23:03Z'
SHA-1: CB425E67FF0D0A46D9C30C37D870281A4FF21700
Description: null
|
; Troy's HBC-56 - BASIC
;
; Copyright (c) 2021 Troy Schrapel
;
; This code is licensed under the MIT license
;
; https://github.com/visrealm/hbc-56
;
!src "basic_hbc56_core.asm" ; core basic
!src "drivers/input.asm" ; input routines
!src "drivers/output_tms9918.asm" ; output routines
; -----------------------------------------------------------------------------
; metadata for the HBC-56 kernel
; -----------------------------------------------------------------------------
hbc56Meta:
+setHbcMetaTitle "HBC-56 BASIC"
rts |
.data
.text
addi $s0, $zero, 4
sll $t0, $s0, 2 # 2^i t0 = $s0, 2^2
li $v0, 1
add $a0, $zero, $t0
syscall |
; A023458: n-16.
; -16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44
sub $0,16
mov $1,$0
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x3f6e, %r14
nop
xor %rdi, %rdi
movb $0x61, (%r14)
nop
nop
nop
nop
nop
xor $30192, %rbx
lea addresses_normal_ht+0x976e, %rdx
nop
nop
nop
nop
add %rax, %rax
mov (%rdx), %r10
nop
nop
nop
nop
nop
add %r10, %r10
lea addresses_normal_ht+0x1542e, %rsi
lea addresses_UC_ht+0x836e, %rdi
nop
nop
nop
nop
nop
sub %r14, %r14
mov $9, %rcx
rep movsq
nop
cmp $61098, %rcx
lea addresses_A_ht+0x125ae, %r14
inc %rsi
movups (%r14), %xmm1
vpextrq $0, %xmm1, %rax
nop
nop
nop
nop
nop
xor %rax, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %r8
push %r9
push %rcx
// Store
lea addresses_WT+0x9b6e, %rcx
nop
sub %r15, %r15
mov $0x5152535455565758, %r10
movq %r10, (%rcx)
nop
nop
nop
nop
nop
add $38092, %r10
// Faulty Load
lea addresses_WC+0xd36e, %r10
nop
nop
nop
nop
cmp %r11, %r11
movb (%r10), %cl
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}, '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
*/
|
db "MUSHROOM@" ; species name
db "It scatters poison"
next "spores and throws"
next "powerful punches"
page "while its foe is"
next "hampered by the"
next "inhaled spores.@"
|
; A099767: Number of n-digit palindromes in base n.
; 1,6,12,100,180,2058,3584,52488,90000,1610510,2737152,57921708,97883968,2392031250,4026531840,111612119056,187339329792,5808378560022,9728000000000,333597619564020,557758378619904,20961814674106394,34998666292887552,1430511474609375000,2385723916542054400,105366433978493382942,175557008407444586496,8331630514922384977468,13870610100000000000000,703957859755340577898530,1171146887751672012996608,63295526446801884093890592,105238975735202228461436928,6034421902133970642089843750
mov $1,$0
add $0,1
mov $2,$1
add $2,2
lpb $1
mul $0,$2
sub $1,1
trn $1,1
lpe
|
/*
# Copyright (c) 2014-2016, 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 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 ``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.
*/
#ifndef STUBRENDERIMPL_HPP
#define STUBRENDERIMPL_HPP
#include "Render/RenderImpl.hpp"
namespace nvidiaio
{
class StubRenderImpl :
public Render
{
public:
StubRenderImpl():
Render(nvxio::Render::UNKNOWN_RENDER, "Stub"),
windowWidth(), windowHeight()
{
}
virtual bool open(const std::string& title, uint32_t width, uint32_t height, nvxcu_df_image_e /*format*/)
{
windowHeight = height;
windowWidth = width;
windowTitle = title;
return true;
}
virtual void setOnKeyboardEventCallback(OnKeyboardEventCallback, void *) { }
virtual void setOnMouseEventCallback(OnMouseEventCallback, void *) { }
virtual void putImage(const image_t &) { }
virtual void putTextViewport(const std::string&, const TextBoxStyle &) { }
virtual void putFeatures(const array_t &, const FeatureStyle &) { }
virtual void putFeatures(const array_t &, const array_t &) { }
virtual void putLines(const array_t &, const LineStyle &) { }
virtual void putConvexPolygon(const array_t &, const LineStyle &) { }
virtual void putMotionField(const image_t &, const MotionFieldStyle&){}
virtual void putObjectLocation(const nvxcu_rectangle_t &, const DetectedObjectStyle &) { }
virtual void putCircles(const array_t &, const CircleStyle &) { }
virtual void putArrows(const array_t &, const array_t &, const LineStyle &) { }
virtual bool flush() { return true; }
virtual void close() { }
virtual uint32_t getViewportWidth() const
{
return windowWidth;
}
virtual uint32_t getViewportHeight() const
{
return windowHeight;
}
virtual ~StubRenderImpl()
{
}
protected:
uint32_t windowWidth;
uint32_t windowHeight;
std::string windowTitle;
};
} // namespace nvidiaio
#endif // STUBRENDERIMPL_HPP
|
; A277106: a(n) = 8*3^n - 12.
; 12,60,204,636,1932,5820,17484,52476,157452,472380,1417164,4251516,12754572,38263740,114791244,344373756,1033121292,3099363900,9298091724,27894275196,83682825612,251048476860,753145430604,2259436291836,6778308875532
mov $1,3
pow $1,$0
div $1,2
mul $1,48
add $1,12
mov $0,$1
|
; lzo1y_s1.asm -- lzo1y_decompress_asm
;
; This file is part of the LZO real-time data compression library.
;
; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 2 of
; the License, or (at your option) any later version.
;
; The LZO library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with the LZO library; see the file COPYING.
; If not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;
; Markus F.X.J. Oberhumer
; <markus@oberhumer.com>
; http://www.oberhumer.com/opensource/lzo/
;
; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
%include "asminit.def"
%ifdef NAME1
globalf(NAME1(lzo1y_decompress_asm))
%endif
%ifdef NAME2
globalf(NAME2(lzo1y_decompress_asm))
%endif
%ifdef NAME1
NAME1(lzo1y_decompress_asm):
%endif
%ifdef NAME2
NAME2(lzo1y_decompress_asm):
%endif
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
%ifdef NAME1
globalf_end(NAME1(lzo1y_decompress_asm))
%endif
%ifdef NAME2
globalf_end(NAME2(lzo1y_decompress_asm))
%endif
|
; A030055: a(n) = binomial(2*n+1, n-5).
; 1,13,105,680,3876,20349,100947,480700,2220075,10015005,44352165,193536720,834451800,3562467300,15084504396,63432274896,265182149218,1103068603890,4568648125690,18851684897584,77535155627160,317986441828055,1300853625660225,5309878226480100
mov $1,11
add $1,$0
add $1,$0
bin $1,$0
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld a, 30
ldff(00), a
ld a, 01
ldff(4d), a
stop, 00
ld a, ff
ldff(45), a
ld b, 91
call lwaitly_b
ld hl, fe00
ld d, 10
ld a, d
ld(hl++), a
ld a, 08
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld(hl++), a
inc l
inc l
ld(hl++), a
ld a, 18
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 20
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 28
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 30
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 38
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 40
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, a1
ld(hl++), a
inc l
inc l
ld a, d
ld(hl++), a
ld a, 50
ld(hl++), a
ld a, 40
ldff(41), a
ld a, 02
ldff(ff), a
xor a, a
ldff(0f), a
ei
ld a, 01
ldff(45), a
ld c, 41
ld a, 93
ldff(40), a
.text@1000
lstatint:
nop
.text@10ab
ldff a, (c)
and a, 03
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
/* DHT library
MIT license
written by Adafruit Industries
*/
#include <math.h>
#include "DHT.h"
//#define NAN 0
DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) {
_pin = pin;
_type = type;
_count = count;
firstreading = true;
}
void DHT::begin(void) {
// set up the pins!
pinMode(_pin, INPUT);
digitalWrite(_pin, HIGH);
_lastreadtime = 0;
}
//boolean S == Scale. True == Farenheit; False == Celcius
float DHT::readTemperature(bool S) {
float f;
if (read()) {
switch (_type) {
case DHT11:
f = data[2];
if(S)
f = convertCtoF(f);
return f;
case DHT22:
case DHT21:
f = data[2] & 0x7F;
f *= 256;
f += data[3];
f /= 10;
if (data[2] & 0x80)
f *= -1;
if(S)
f = convertCtoF(f);
return f;
}
}
Serial.print("Read fail");
return NAN;
}
float DHT::convertCtoF(float c) {
return c * 9 / 5 + 32;
}
float DHT::readHumidity(void) {
float f;
if (read()) {
switch (_type) {
case DHT11:
f = data[0];
return f;
case DHT22:
case DHT21:
f = data[0];
f *= 256;
f += data[1];
f /= 10;
return f;
}
}
Serial.print("Read fail");
return NAN;
}
boolean DHT::read(void) {
uint8_t laststate = HIGH;
uint8_t counter = 0;
uint8_t j = 0, i;
unsigned long currenttime;
// pull the pin high and wait 250 milliseconds
digitalWrite(_pin, HIGH);
delay(250);
currenttime = millis();
if (currenttime < _lastreadtime) {
// ie there was a rollover
_lastreadtime = 0;
}
if (!firstreading && ((currenttime - _lastreadtime) < 2000)) {
return true; // return last correct measurement
//delay(2000 - (currenttime - _lastreadtime));
}
firstreading = false;
/*
Serial.print("Currtime: "); Serial.print(currenttime);
Serial.print(" Lasttime: "); Serial.print(_lastreadtime);
*/
_lastreadtime = millis();
data[0] = data[1] = data[2] = data[3] = data[4] = 0;
// now pull it low for ~20 milliseconds
pinMode(_pin, OUTPUT);
digitalWrite(_pin, LOW);
delay(20);
//cli();
digitalWrite(_pin, HIGH);
delayMicroseconds(40);
pinMode(_pin, INPUT);
// read in timings
for ( i=0; i< MAXTIMINGS; i++) {
counter = 0;
while (digitalRead(_pin) == laststate) {
counter++;
delayMicroseconds(1);
if (counter == 255) {
break;
}
}
laststate = digitalRead(_pin);
if (counter == 255) break;
// ignore first 3 transitions
if ((i >= 4) && (i%2 == 0)) {
// shove each bit into the storage bytes
data[j/8] <<= 1;
if (counter > _count)
data[j/8] |= 1;
j++;
}
}
//sei();
/*
Serial.println(j, DEC);
Serial.print(data[0], HEX); Serial.print(", ");
Serial.print(data[1], HEX); Serial.print(", ");
Serial.print(data[2], HEX); Serial.print(", ");
Serial.print(data[3], HEX); Serial.print(", ");
Serial.print(data[4], HEX); Serial.print(" =? ");
Serial.println(data[0] + data[1] + data[2] + data[3], HEX);
*/
// check we read 40 bits and that the checksum matches
if ((j >= 40) &&
(data[4] == ((data[0] + data[1] + data[2] + data[3]) & 0xFF)) ) {
return true;
}
return false;
}
|
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM uint_number_zero:QWORD
COMM uint_number_one:QWORD
_DATA ENDS
msvcjmc SEGMENT
__7B7A869E_ctype@h DB 01H
__457DD326_basetsd@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__1887E595_winnt@h DB 01H
__9FC7C64B_processthreadsapi@h DB 01H
__FA470AEC_memoryapi@h DB 01H
__F37DAFF1_winerror@h DB 01H
__7A450CCC_winbase@h DB 01H
__B4B40122_winioctl@h DB 01H
__86261D59_stralign@h DB 01H
__059414E1_pmc_sint_debug@h DB 01H
__8C95CAB4_test_op_greatestcommondivisor@c DB 01H
msvcjmc ENDS
PUBLIC TEST_GreatestCommonDivisor_I_X
PUBLIC TEST_GreatestCommonDivisor_L_X
PUBLIC TEST_GreatestCommonDivisor_UX_X
PUBLIC TEST_GreatestCommonDivisor_X_I
PUBLIC TEST_GreatestCommonDivisor_X_L
PUBLIC TEST_GreatestCommonDivisor_X_UX
PUBLIC TEST_GreatestCommonDivisor_X_X
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ ; `string'
PUBLIC ??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FK@DEBGJFKO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@ ; `string'
PUBLIC ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ ; `string'
PUBLIC ??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FK@GPIIGGDA@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FM@CNBBCJNO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FK@GIINEDIJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FK@CAMBNOBM@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FM@KKPEGHPO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ ; `string'
PUBLIC ??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
PUBLIC ??_C@_1FK@NKICKOAJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ ; `string'
EXTRN TEST_Assert:PROC
EXTRN FormatTestLabel:PROC
EXTRN FormatTestMesssage:PROC
EXTRN _RTC_CheckStackVars:PROC
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __security_check_cookie:PROC
EXTRN __security_cookie:QWORD
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_I_X DD imagerel $LN14
DD imagerel $LN14+746
DD imagerel $unwind$TEST_GreatestCommonDivisor_I_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_L_X DD imagerel $LN14
DD imagerel $LN14+747
DD imagerel $unwind$TEST_GreatestCommonDivisor_L_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_UX_X DD imagerel $LN17
DD imagerel $LN17+913
DD imagerel $unwind$TEST_GreatestCommonDivisor_UX_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_X_I DD imagerel $LN14
DD imagerel $LN14+746
DD imagerel $unwind$TEST_GreatestCommonDivisor_X_I
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_X_L DD imagerel $LN14
DD imagerel $LN14+747
DD imagerel $unwind$TEST_GreatestCommonDivisor_X_L
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_X_UX DD imagerel $LN17
DD imagerel $LN17+913
DD imagerel $unwind$TEST_GreatestCommonDivisor_X_UX
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TEST_GreatestCommonDivisor_X_X DD imagerel $LN17
DD imagerel $LN17+919
DD imagerel $unwind$TEST_GreatestCommonDivisor_X_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_EQUALS_MEMORY DD imagerel _EQUALS_MEMORY
DD imagerel _EQUALS_MEMORY+198
DD imagerel $unwind$_EQUALS_MEMORY
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_C@_1FK@NKICKOAJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FK@NKICKOAJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_'
DB '0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH
DB 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'X', 00H, ' ', 00H, '('
DB 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H
DB 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@
CONST SEGMENT
??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@ DB 'P'
DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'F', 00H, 'r', 00H, 'o', 00H
DB 'm', 00H, 'B', 00H, 'y', 00H, 't', 00H, 'e', 00H, 'A', 00H, 'r'
DB 00H, 'r', 00H, 'a', 00H, 'y', 00H, 'n0', 0a9H, '_0^', 0b3H, '0'
DB 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH
DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FM@KKPEGHPO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FM@KKPEGHPO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'U', 00H, 'X', 00H, 'n'
DB '0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H
DB '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')'
DB 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'U', 00H, 'X', 00H, ' '
DB 00H, '(', 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H
DB ')', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FK@CAMBNOBM@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FK@CAMBNOBM@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'L', 00H, 'n0', 0a9H, '_'
DB '0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH
DB 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'L', 00H, ' ', 00H, '('
DB 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H
DB 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FK@GIINEDIJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FK@GIINEDIJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'I', 00H, 'n0', 0a9H, '_'
DB '0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH
DB 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'X', 00H, '_', 00H, 'I', 00H, ' ', 00H, '('
DB 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H
DB 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FM@CNBBCJNO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FM@CNBBCJNO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'U', 00H, 'X', 00H, '_', 00H, 'X', 00H, 'n'
DB '0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H
DB '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')'
DB 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'U', 00H, 'X', 00H, '_', 00H, 'X', 00H, ' '
DB 00H, '(', 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H
DB ')', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FK@GPIIGGDA@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FK@GPIIGGDA@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'L', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_'
DB '0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH
DB 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'L', 00H, '_', 00H, 'X', 00H, ' ', 00H, '('
DB 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H
DB 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
CONST SEGMENT
??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ DB 0c7H
DB '0', 0fcH, '0', 0bfH, '0n0', 085H, 'Q', 0b9H, '[L0', 00H, 'N', 0f4H
DB 081H, 'W0j0D0', 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
CONST SEGMENT
??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@ DB 'T'
DB 00H, 'o', 00H, 'B', 00H, 'y', 00H, 't', 00H, 'e', 00H, 'A', 00H
DB 'r', 00H, 'r', 00H, 'a', 00H, 'y', 00H, 'n0', 0a9H, '_0^', 0b3H
DB '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH
DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1FK@DEBGJFKO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1FK@DEBGJFKO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'I', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_'
DB '0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH
DB 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H
DB 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
CONST SEGMENT
??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@ DB 'G'
DB 00H, 'r', 00H, 'e', 00H, 'a', 00H, 't', 00H, 'e', 00H, 's', 00H
DB 't', 00H, 'C', 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'o', 00H, 'n'
DB 00H, 'D', 00H, 'i', 00H, 'v', 00H, 'i', 00H, 's', 00H, 'o', 00H
DB 'r', 00H, '_', 00H, 'I', 00H, '_', 00H, 'X', 00H, ' ', 00H, '('
DB 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H
DB 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
CONST SEGMENT
??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ DB 'F'
DB 00H, 'r', 00H, 'o', 00H, 'm', 00H, 'B', 00H, 'y', 00H, 't', 00H
DB 'e', 00H, 'A', 00H, 'r', 00H, 'r', 00H, 'a', 00H, 'y', 00H, 'n'
DB '0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H
DB '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')'
DB 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_EQUALS_MEMORY DD 025053901H
DD 011d2322H
DD 07016001dH
DD 05015H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_X_X DD 025054a19H
DD 011d2322H
DD 07016007bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 03c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_X_X$rtcName$0 DB 075H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_X$rtcName$1 DB 076H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_X$rtcName$2 DB 077H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_X_X$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 07aH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_X_X$rtcName$4 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 07aH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+14
TEST_GreatestCommonDivisor_X_X$rtcVarDesc DD 01a8H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcName$4
DD 090H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcName$3
DD 068H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcName$0
ORG $+240
TEST_GreatestCommonDivisor_X_X$rtcFrameData DD 05H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_X_X$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_X_UX DD 025054a19H
DD 011d2322H
DD 07016007bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 03c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_X_UX$rtcName$0 DB 075H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_UX$rtcName$1 DB 076H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_UX$rtcName$2 DB 077H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_X_UX$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 07aH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_X_UX$rtcName$4 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 07aH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+14
TEST_GreatestCommonDivisor_X_UX$rtcVarDesc DD 01a8H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcName$4
DD 090H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcName$3
DD 068H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcName$0
ORG $+240
TEST_GreatestCommonDivisor_X_UX$rtcFrameData DD 05H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_X_UX$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_X_L DD 025054a19H
DD 011d2322H
DD 07016005bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 02c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_X_L$rtcName$0 DB 075H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_L$rtcName$1 DB 077H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_L$rtcName$2 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_X_L$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_X_L$rtcVarDesc DD 0188H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_L$rtcName$3
DD 070H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_X_L$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_L$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_L$rtcName$0
ORG $+192
TEST_GreatestCommonDivisor_X_L$rtcFrameData DD 04H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_X_L$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_X_I DD 025054a19H
DD 011d2322H
DD 07016005bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 02c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_X_I$rtcName$0 DB 075H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_I$rtcName$1 DB 077H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_X_I$rtcName$2 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_X_I$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_X_I$rtcVarDesc DD 0188H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_I$rtcName$3
DD 070H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_X_I$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_I$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_X_I$rtcName$0
ORG $+192
TEST_GreatestCommonDivisor_X_I$rtcFrameData DD 04H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_X_I$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_UX_X DD 025054a19H
DD 011d2322H
DD 07016007bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 03c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_UX_X$rtcName$0 DB 075H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_UX_X$rtcName$1 DB 076H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_UX_X$rtcName$2 DB 077H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_UX_X$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_UX_X$rtcName$4 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+14
TEST_GreatestCommonDivisor_UX_X$rtcVarDesc DD 01a8H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcName$4
DD 090H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcName$3
DD 068H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcName$0
ORG $+240
TEST_GreatestCommonDivisor_UX_X$rtcFrameData DD 05H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_UX_X$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_L_X DD 025054a19H
DD 011d2322H
DD 07016005bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 02c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_L_X$rtcName$0 DB 076H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_L_X$rtcName$1 DB 077H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_L_X$rtcName$2 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_L_X$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_L_X$rtcVarDesc DD 0188H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_L_X$rtcName$3
DD 070H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_L_X$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_L_X$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_L_X$rtcName$0
ORG $+192
TEST_GreatestCommonDivisor_L_X$rtcFrameData DD 04H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_L_X$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TEST_GreatestCommonDivisor_I_X DD 025054a19H
DD 011d2322H
DD 07016005bH
DD 05015H
DD imagerel __GSHandlerCheck
DD 02c0H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TEST_GreatestCommonDivisor_I_X$rtcName$0 DB 076H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_I_X$rtcName$1 DB 077H
DB 00H
ORG $+2
TEST_GreatestCommonDivisor_I_X$rtcName$2 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 00H
ORG $+3
TEST_GreatestCommonDivisor_I_X$rtcName$3 DB 061H
DB 063H
DB 074H
DB 075H
DB 061H
DB 06cH
DB 05fH
DB 077H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 073H
DB 069H
DB 07aH
DB 065H
DB 00H
ORG $+6
TEST_GreatestCommonDivisor_I_X$rtcVarDesc DD 0188H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_I_X$rtcName$3
DD 070H
DD 0100H
DQ FLAT:TEST_GreatestCommonDivisor_I_X$rtcName$2
DD 048H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_I_X$rtcName$1
DD 028H
DD 08H
DQ FLAT:TEST_GreatestCommonDivisor_I_X$rtcName$0
ORG $+192
TEST_GreatestCommonDivisor_I_X$rtcFrameData DD 04H
DD 00H
DQ FLAT:TEST_GreatestCommonDivisor_I_X$rtcVarDesc
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\pmc_sint_debug.h
; COMDAT _EQUALS_MEMORY
_TEXT SEGMENT
buffer1$ = 224
count1$ = 232
buffer2$ = 240
count2$ = 248
_EQUALS_MEMORY PROC ; COMDAT
; 140 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__059414E1_pmc_sint_debug@h
call __CheckForDebuggerJustMyCode
; 141 : if (count1 != count2)
mov rax, QWORD PTR count2$[rbp]
cmp QWORD PTR count1$[rbp], rax
je SHORT $LN4@EQUALS_MEM
; 142 : return (-1);
mov eax, -1
jmp SHORT $LN1@EQUALS_MEM
$LN4@EQUALS_MEM:
$LN2@EQUALS_MEM:
; 143 : while (count1 > 0)
cmp QWORD PTR count1$[rbp], 0
jbe SHORT $LN3@EQUALS_MEM
; 144 : {
; 145 : if (*buffer1 != *buffer2)
mov rax, QWORD PTR buffer1$[rbp]
movzx eax, BYTE PTR [rax]
mov rcx, QWORD PTR buffer2$[rbp]
movzx ecx, BYTE PTR [rcx]
cmp eax, ecx
je SHORT $LN5@EQUALS_MEM
; 146 : return (-1);
mov eax, -1
jmp SHORT $LN1@EQUALS_MEM
$LN5@EQUALS_MEM:
; 147 : ++buffer1;
mov rax, QWORD PTR buffer1$[rbp]
inc rax
mov QWORD PTR buffer1$[rbp], rax
; 148 : ++buffer2;
mov rax, QWORD PTR buffer2$[rbp]
inc rax
mov QWORD PTR buffer2$[rbp], rax
; 149 : --count1;
mov rax, QWORD PTR count1$[rbp]
dec rax
mov QWORD PTR count1$[rbp], rax
; 150 : }
jmp SHORT $LN2@EQUALS_MEM
$LN3@EQUALS_MEM:
; 151 : return (0);
xor eax, eax
$LN1@EQUALS_MEM:
; 152 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_EQUALS_MEMORY ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_X_X
_TEXT SEGMENT
u$ = 8
v$ = 40
w$ = 72
actual_z_buf$ = 112
actual_z_buf_size$ = 392
result$ = 420
u_result$ = 452
v_result$ = 484
w_result$ = 516
tv177 = 916
tv162 = 916
tv142 = 916
tv92 = 916
tv74 = 916
tv151 = 920
tv132 = 920
tv82 = 920
tv64 = 920
__$ArrayPad$ = 928
env$ = 976
ep$ = 984
no$ = 992
u_buf$ = 1000
u_buf_size$ = 1008
v_buf$ = 1016
v_buf_size$ = 1024
desired_status$ = 1032
desired_w_buf$ = 1040
desired_w_buf_size$ = 1048
TEST_GreatestCommonDivisor_X_X PROC ; COMDAT
; 173 : {
$LN17:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 984 ; 000003d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 246 ; 000000f6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+1016]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 174 : PMC_HANDLE_SINT u;
; 175 : PMC_HANDLE_SINT v;
; 176 : PMC_HANDLE_UINT w;
; 177 : unsigned char actual_z_buf[256];
; 178 : size_t actual_z_buf_size;
; 179 : PMC_STATUS_CODE result;
; 180 : PMC_STATUS_CODE u_result;
; 181 : PMC_STATUS_CODE v_result;
; 182 : PMC_STATUS_CODE w_result;
; 183 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_X (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"PMC_FromByteArrayの復帰コードが期待通りではない(%d)", u_result));
lea r8, QWORD PTR u$[rbp]
mov rdx, QWORD PTR u_buf_size$[rbp]
mov rcx, QWORD PTR u_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR u_result$[rbp], eax
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN7@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN8@TEST_Great
$LN7@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN8@TEST_Great:
mov edx, DWORD PTR u_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EK@HDEICNAJ@?$AAP?$AAM?$AAC?$AA_?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 184 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_X (%d.%d)", no, 2), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result));
lea r8, QWORD PTR v$[rbp]
mov rdx, QWORD PTR v_buf_size$[rbp]
mov rcx, QWORD PTR v_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR v_result$[rbp], eax
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN9@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN10@TEST_Great
$LN9@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN10@TEST_Great:
mov edx, DWORD PTR v_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 185 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_X (%d.%d)", no, 3), (w_result = ep->GreatestCommonDivisor_X_X(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_X_Xの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1048]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN11@TEST_Great
mov DWORD PTR tv142[rbp], 1
jmp SHORT $LN12@TEST_Great
$LN11@TEST_Great:
mov DWORD PTR tv142[rbp], 0
$LN12@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FK@NKICKOAJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv132[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv132[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv142[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 186 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 187 : {
; 188 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_X (%d.%d)", no, 4), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_z_buf, sizeof(actual_z_buf), &actual_z_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_z_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_z_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN13@TEST_Great
mov DWORD PTR tv162[rbp], 1
jmp SHORT $LN14@TEST_Great
$LN13@TEST_Great:
mov DWORD PTR tv162[rbp], 0
$LN14@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv151[rbp], rax
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv151[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv162[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 189 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_X (%d.%d)", no, 5), _EQUALS_MEMORY(actual_z_buf, actual_z_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_z_buf_size$[rbp]
lea rcx, QWORD PTR actual_z_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN15@TEST_Great
mov DWORD PTR tv177[rbp], 1
jmp SHORT $LN16@TEST_Great
$LN15@TEST_Great:
mov DWORD PTR tv177[rbp], 0
$LN16@TEST_Great:
mov r8d, 5
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@ICGPEMFN@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv177[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 190 : }
; 191 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 192 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 193 : if (v_result == PMC_STATUS_OK)
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 194 : ep->Dispose(v);
mov rcx, QWORD PTR v$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 195 : if (u_result == PMC_STATUS_OK)
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN5@TEST_Great
; 196 : ep->Dispose(u);
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN5@TEST_Great:
; 197 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_X_X$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+952]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_X_X ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_X_UX
_TEXT SEGMENT
u$ = 8
v$ = 40
w$ = 72
actual_z_buf$ = 112
actual_z_buf_size$ = 392
result$ = 420
u_result$ = 452
v_result$ = 484
w_result$ = 516
tv177 = 916
tv162 = 916
tv142 = 916
tv92 = 916
tv74 = 916
tv151 = 920
tv132 = 920
tv82 = 920
tv64 = 920
__$ArrayPad$ = 928
env$ = 976
ep$ = 984
no$ = 992
u_buf$ = 1000
u_buf_size$ = 1008
v_buf$ = 1016
v_buf_size$ = 1024
desired_status$ = 1032
desired_w_buf$ = 1040
desired_w_buf_size$ = 1048
TEST_GreatestCommonDivisor_X_UX PROC ; COMDAT
; 147 : {
$LN17:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 984 ; 000003d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 246 ; 000000f6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+1016]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 148 : PMC_HANDLE_SINT u;
; 149 : PMC_HANDLE_UINT v;
; 150 : PMC_HANDLE_UINT w;
; 151 : unsigned char actual_z_buf[256];
; 152 : size_t actual_z_buf_size;
; 153 : PMC_STATUS_CODE result;
; 154 : PMC_STATUS_CODE u_result;
; 155 : PMC_STATUS_CODE v_result;
; 156 : PMC_STATUS_CODE w_result;
; 157 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_UX (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result));
lea r8, QWORD PTR u$[rbp]
mov rdx, QWORD PTR u_buf_size$[rbp]
mov rcx, QWORD PTR u_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR u_result$[rbp], eax
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN7@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN8@TEST_Great
$LN7@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN8@TEST_Great:
mov edx, DWORD PTR u_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 158 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_UX (%d.%d)", no, 2), (v_result = ep->UINT_ENTRY_POINTS.FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result));
lea r8, QWORD PTR v$[rbp]
mov rdx, QWORD PTR v_buf_size$[rbp]
mov rcx, QWORD PTR v_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+48]
mov DWORD PTR v_result$[rbp], eax
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN9@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN10@TEST_Great
$LN9@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN10@TEST_Great:
mov edx, DWORD PTR v_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 159 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_UX (%d.%d)", no, 3), (w_result = ep->GreatestCommonDivisor_X_UX(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_X_UXの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1040]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN11@TEST_Great
mov DWORD PTR tv142[rbp], 1
jmp SHORT $LN12@TEST_Great
$LN11@TEST_Great:
mov DWORD PTR tv142[rbp], 0
$LN12@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FM@KKPEGHPO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv132[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv132[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv142[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 160 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 161 : {
; 162 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_UX (%d.%d)", no, 4), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_z_buf, sizeof(actual_z_buf), &actual_z_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_z_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_z_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN13@TEST_Great
mov DWORD PTR tv162[rbp], 1
jmp SHORT $LN14@TEST_Great
$LN13@TEST_Great:
mov DWORD PTR tv162[rbp], 0
$LN14@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv151[rbp], rax
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv151[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv162[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 163 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_UX (%d.%d)", no, 5), _EQUALS_MEMORY(actual_z_buf, actual_z_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_z_buf_size$[rbp]
lea rcx, QWORD PTR actual_z_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN15@TEST_Great
mov DWORD PTR tv177[rbp], 1
jmp SHORT $LN16@TEST_Great
$LN15@TEST_Great:
mov DWORD PTR tv177[rbp], 0
$LN16@TEST_Great:
mov r8d, 5
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@LLHOJFEG@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv177[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 164 : }
; 165 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 166 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 167 : if (v_result == PMC_STATUS_OK)
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 168 : ep->UINT_ENTRY_POINTS.Dispose(v);
mov rcx, QWORD PTR v$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN4@TEST_Great:
; 169 : if (u_result == PMC_STATUS_OK)
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN5@TEST_Great
; 170 : ep->Dispose(u);
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN5@TEST_Great:
; 171 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_X_UX$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+952]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_X_UX ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_X_L
_TEXT SEGMENT
u$ = 8
w$ = 40
actual_w_buf$ = 80
actual_w_buf_size$ = 360
result$ = 388
u_result$ = 420
w_result$ = 452
tv159 = 660
tv144 = 660
tv92 = 660
tv74 = 660
tv133 = 664
tv82 = 664
tv64 = 664
__$ArrayPad$ = 672
env$ = 720
ep$ = 728
no$ = 736
u_buf$ = 744
u_buf_size$ = 752
v$ = 760
desired_status$ = 768
desired_w_buf$ = 776
desired_w_buf_size$ = 784
TEST_GreatestCommonDivisor_X_L PROC ; COMDAT
; 125 : {
$LN14:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 728 ; 000002d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 182 ; 000000b6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+760]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 126 : PMC_HANDLE_SINT u;
; 127 : PMC_HANDLE_UINT w;
; 128 : unsigned char actual_w_buf[256];
; 129 : size_t actual_w_buf_size;
; 130 : PMC_STATUS_CODE result;
; 131 : PMC_STATUS_CODE u_result;
; 132 : PMC_STATUS_CODE w_result;
; 133 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_L (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result));
lea r8, QWORD PTR u$[rbp]
mov rdx, QWORD PTR u_buf_size$[rbp]
mov rcx, QWORD PTR u_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR u_result$[rbp], eax
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN6@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN7@TEST_Great
$LN6@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN7@TEST_Great:
mov edx, DWORD PTR u_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 134 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_L (%d.%d)", no, 2), (w_result = ep->GreatestCommonDivisor_X_L(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_X_Lの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1032]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN8@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN9@TEST_Great
$LN8@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN9@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FK@CAMBNOBM@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 135 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 136 : {
; 137 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_L (%d.%d)", no, 3), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_w_buf, sizeof(actual_w_buf), &actual_w_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_w_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_w_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN10@TEST_Great
mov DWORD PTR tv144[rbp], 1
jmp SHORT $LN11@TEST_Great
$LN10@TEST_Great:
mov DWORD PTR tv144[rbp], 0
$LN11@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv133[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv133[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv144[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 138 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_L (%d.%d)", no, 4), _EQUALS_MEMORY(actual_w_buf, actual_w_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_w_buf_size$[rbp]
lea rcx, QWORD PTR actual_w_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN12@TEST_Great
mov DWORD PTR tv159[rbp], 1
jmp SHORT $LN13@TEST_Great
$LN12@TEST_Great:
mov DWORD PTR tv159[rbp], 0
$LN13@TEST_Great:
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@CMEEAMCB@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv159[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 139 : }
; 140 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 141 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 142 : if (u_result == PMC_STATUS_OK)
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 143 : ep->Dispose(u);
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 144 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_X_L$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+696]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_X_L ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_X_I
_TEXT SEGMENT
u$ = 8
w$ = 40
actual_w_buf$ = 80
actual_w_buf_size$ = 360
result$ = 388
u_result$ = 420
w_result$ = 452
tv159 = 660
tv144 = 660
tv92 = 660
tv74 = 660
tv133 = 664
tv82 = 664
tv64 = 664
__$ArrayPad$ = 672
env$ = 720
ep$ = 728
no$ = 736
u_buf$ = 744
u_buf_size$ = 752
v$ = 760
desired_status$ = 768
desired_w_buf$ = 776
desired_w_buf_size$ = 784
TEST_GreatestCommonDivisor_X_I PROC ; COMDAT
; 103 : {
$LN14:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 728 ; 000002d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 182 ; 000000b6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+760]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 104 : PMC_HANDLE_SINT u;
; 105 : PMC_HANDLE_UINT w;
; 106 : unsigned char actual_w_buf[256];
; 107 : size_t actual_w_buf_size;
; 108 : PMC_STATUS_CODE result;
; 109 : PMC_STATUS_CODE u_result;
; 110 : PMC_STATUS_CODE w_result;
; 111 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_I (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result));
lea r8, QWORD PTR u$[rbp]
mov rdx, QWORD PTR u_buf_size$[rbp]
mov rcx, QWORD PTR u_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR u_result$[rbp], eax
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN6@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN7@TEST_Great
$LN6@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN7@TEST_Great:
mov edx, DWORD PTR u_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 112 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_I (%d.%d)", no, 2), (w_result = ep->GreatestCommonDivisor_X_I(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_X_Iの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov edx, DWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1024]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN8@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN9@TEST_Great
$LN8@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN9@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FK@GIINEDIJ@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 113 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 114 : {
; 115 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_I (%d.%d)", no, 3), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_w_buf, sizeof(actual_w_buf), &actual_w_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_w_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_w_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN10@TEST_Great
mov DWORD PTR tv144[rbp], 1
jmp SHORT $LN11@TEST_Great
$LN10@TEST_Great:
mov DWORD PTR tv144[rbp], 0
$LN11@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv133[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv133[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv144[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 116 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_X_I (%d.%d)", no, 4), _EQUALS_MEMORY(actual_w_buf, actual_w_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_w_buf_size$[rbp]
lea rcx, QWORD PTR actual_w_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN12@TEST_Great
mov DWORD PTR tv159[rbp], 1
jmp SHORT $LN13@TEST_Great
$LN12@TEST_Great:
mov DWORD PTR tv159[rbp], 0
$LN13@TEST_Great:
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMONMDO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv159[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 117 : }
; 118 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 119 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 120 : if (u_result == PMC_STATUS_OK)
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 121 : ep->Dispose(u);
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 122 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_X_I$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+696]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_X_I ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_UX_X
_TEXT SEGMENT
u$ = 8
v$ = 40
w$ = 72
actual_w_buf$ = 112
actual_w_buf_size$ = 392
result$ = 420
u_result$ = 452
v_result$ = 484
w_result$ = 516
tv177 = 916
tv162 = 916
tv142 = 916
tv92 = 916
tv74 = 916
tv151 = 920
tv132 = 920
tv82 = 920
tv64 = 920
__$ArrayPad$ = 928
env$ = 976
ep$ = 984
no$ = 992
u_buf$ = 1000
u_buf_size$ = 1008
v_buf$ = 1016
v_buf_size$ = 1024
desired_status$ = 1032
desired_w_buf$ = 1040
desired_w_buf_size$ = 1048
TEST_GreatestCommonDivisor_UX_X PROC ; COMDAT
; 76 : {
$LN17:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 984 ; 000003d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 246 ; 000000f6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+1016]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 77 : PMC_HANDLE_UINT u;
; 78 : PMC_HANDLE_SINT v;
; 79 : PMC_HANDLE_UINT w;
; 80 : unsigned char actual_w_buf[256];
; 81 : size_t actual_w_buf_size;
; 82 : PMC_STATUS_CODE result;
; 83 : PMC_STATUS_CODE u_result;
; 84 : PMC_STATUS_CODE v_result;
; 85 : PMC_STATUS_CODE w_result;
; 86 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_UX_X (%d.%d)", no, 1), (u_result = ep->UINT_ENTRY_POINTS.FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result));
lea r8, QWORD PTR u$[rbp]
mov rdx, QWORD PTR u_buf_size$[rbp]
mov rcx, QWORD PTR u_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+48]
mov DWORD PTR u_result$[rbp], eax
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN7@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN8@TEST_Great
$LN7@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN8@TEST_Great:
mov edx, DWORD PTR u_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 87 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_UX_X (%d.%d)", no, 2), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result));
lea r8, QWORD PTR v$[rbp]
mov rdx, QWORD PTR v_buf_size$[rbp]
mov rcx, QWORD PTR v_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR v_result$[rbp], eax
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN9@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN10@TEST_Great
$LN9@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN10@TEST_Great:
mov edx, DWORD PTR v_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 88 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_UX_X (%d.%d)", no, 3), (w_result = ep->GreatestCommonDivisor_UX_X(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_UX_Xの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1016]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN11@TEST_Great
mov DWORD PTR tv142[rbp], 1
jmp SHORT $LN12@TEST_Great
$LN11@TEST_Great:
mov DWORD PTR tv142[rbp], 0
$LN12@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FM@CNBBCJNO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv132[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv132[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv142[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 89 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 90 : {
; 91 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_UX_X (%d.%d)", no, 4), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_w_buf, sizeof(actual_w_buf), &actual_w_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_w_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_w_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN13@TEST_Great
mov DWORD PTR tv162[rbp], 1
jmp SHORT $LN14@TEST_Great
$LN13@TEST_Great:
mov DWORD PTR tv162[rbp], 0
$LN14@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv151[rbp], rax
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv151[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv162[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 92 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_UX_X (%d.%d)", no, 5), _EQUALS_MEMORY(actual_w_buf, actual_w_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_w_buf_size$[rbp]
lea rcx, QWORD PTR actual_w_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN15@TEST_Great
mov DWORD PTR tv177[rbp], 1
jmp SHORT $LN16@TEST_Great
$LN15@TEST_Great:
mov DWORD PTR tv177[rbp], 0
$LN16@TEST_Great:
mov r8d, 5
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EG@IFNFFAEE@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv177[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 93 : }
; 94 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 95 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 96 : if (v_result == PMC_STATUS_OK)
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 97 : ep->Dispose(v);
mov rcx, QWORD PTR v$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 98 : if (u_result == PMC_STATUS_OK)
cmp DWORD PTR u_result$[rbp], 0
jne SHORT $LN5@TEST_Great
; 99 : ep->UINT_ENTRY_POINTS.Dispose(u);
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN5@TEST_Great:
; 100 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_UX_X$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+952]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_UX_X ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_L_X
_TEXT SEGMENT
v$ = 8
w$ = 40
actual_w_buf$ = 80
actual_w_buf_size$ = 360
result$ = 388
v_result$ = 420
w_result$ = 452
tv159 = 660
tv144 = 660
tv92 = 660
tv74 = 660
tv133 = 664
tv82 = 664
tv64 = 664
__$ArrayPad$ = 672
env$ = 720
ep$ = 728
no$ = 736
u$ = 744
v_buf$ = 752
v_buf_size$ = 760
desired_status$ = 768
desired_w_buf$ = 776
desired_w_buf_size$ = 784
TEST_GreatestCommonDivisor_L_X PROC ; COMDAT
; 54 : {
$LN14:
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 728 ; 000002d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 182 ; 000000b6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+760]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 55 : PMC_HANDLE_SINT v;
; 56 : PMC_HANDLE_UINT w;
; 57 : unsigned char actual_w_buf[256];
; 58 : size_t actual_w_buf_size;
; 59 : PMC_STATUS_CODE result;
; 60 : PMC_STATUS_CODE v_result;
; 61 : PMC_STATUS_CODE w_result;
; 62 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_L_X (%d.%d)", no, 1), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result));
lea r8, QWORD PTR v$[rbp]
mov rdx, QWORD PTR v_buf_size$[rbp]
mov rcx, QWORD PTR v_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR v_result$[rbp], eax
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN6@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN7@TEST_Great
$LN6@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN7@TEST_Great:
mov edx, DWORD PTR v_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 63 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_L_X (%d.%d)", no, 2), (w_result = ep->GreatestCommonDivisor_L_X(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_L_Xの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov rcx, QWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1008]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN8@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN9@TEST_Great
$LN8@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN9@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FK@GPIIGGDA@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 64 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 65 : {
; 66 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_L_X (%d.%d)", no, 3), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_w_buf, sizeof(actual_w_buf), &actual_w_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_w_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_w_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN10@TEST_Great
mov DWORD PTR tv144[rbp], 1
jmp SHORT $LN11@TEST_Great
$LN10@TEST_Great:
mov DWORD PTR tv144[rbp], 0
$LN11@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv133[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv133[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv144[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 67 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_L_X (%d.%d)", no, 4), _EQUALS_MEMORY(actual_w_buf, actual_w_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_w_buf_size$[rbp]
lea rcx, QWORD PTR actual_w_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN12@TEST_Great
mov DWORD PTR tv159[rbp], 1
jmp SHORT $LN13@TEST_Great
$LN12@TEST_Great:
mov DWORD PTR tv159[rbp], 0
$LN13@TEST_Great:
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@JEACKNDP@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv159[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 68 : }
; 69 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 70 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 71 : if (v_result == PMC_STATUS_OK)
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 72 : ep->Dispose(v);
mov rcx, QWORD PTR v$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 73 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_L_X$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+696]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_L_X ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_greatestcommondivisor.c
; COMDAT TEST_GreatestCommonDivisor_I_X
_TEXT SEGMENT
v$ = 8
w$ = 40
actual_w_buf$ = 80
actual_w_buf_size$ = 360
result$ = 388
v_result$ = 420
w_result$ = 452
tv159 = 660
tv144 = 660
tv92 = 660
tv74 = 660
tv133 = 664
tv82 = 664
tv64 = 664
__$ArrayPad$ = 672
env$ = 720
ep$ = 728
no$ = 736
u$ = 744
v_buf$ = 752
v_buf_size$ = 760
desired_status$ = 768
desired_w_buf$ = 776
desired_w_buf_size$ = 784
TEST_GreatestCommonDivisor_I_X PROC ; COMDAT
; 32 : {
$LN14:
mov DWORD PTR [rsp+32], r9d
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 728 ; 000002d8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 182 ; 000000b6H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+760]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__8C95CAB4_test_op_greatestcommondivisor@c
call __CheckForDebuggerJustMyCode
; 33 : PMC_HANDLE_SINT v;
; 34 : PMC_HANDLE_UINT w;
; 35 : unsigned char actual_w_buf[256];
; 36 : size_t actual_w_buf_size;
; 37 : PMC_STATUS_CODE result;
; 38 : PMC_STATUS_CODE v_result;
; 39 : PMC_STATUS_CODE w_result;
; 40 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_I_X (%d.%d)", no, 1), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result));
lea r8, QWORD PTR v$[rbp]
mov rdx, QWORD PTR v_buf_size$[rbp]
mov rcx, QWORD PTR v_buf$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+608]
mov DWORD PTR v_result$[rbp], eax
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN6@TEST_Great
mov DWORD PTR tv74[rbp], 1
jmp SHORT $LN7@TEST_Great
$LN6@TEST_Great:
mov DWORD PTR tv74[rbp], 0
$LN7@TEST_Great:
mov edx, DWORD PTR v_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@
call FormatTestMesssage
mov QWORD PTR tv64[rbp], rax
mov r8d, 1
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv64[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv74[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 41 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_I_X (%d.%d)", no, 2), (w_result = ep->GreatestCommonDivisor_I_X(u, v, &w)) == desired_status, FormatTestMesssage(L"GreatestCommonDivisor_I_Xの復帰コードが期待通りではない(%d)", w_result));
lea r8, QWORD PTR w$[rbp]
mov rdx, QWORD PTR v$[rbp]
mov ecx, DWORD PTR u$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+1000]
mov DWORD PTR w_result$[rbp], eax
mov eax, DWORD PTR desired_status$[rbp]
cmp DWORD PTR w_result$[rbp], eax
jne SHORT $LN8@TEST_Great
mov DWORD PTR tv92[rbp], 1
jmp SHORT $LN9@TEST_Great
$LN8@TEST_Great:
mov DWORD PTR tv92[rbp], 0
$LN9@TEST_Great:
mov edx, DWORD PTR w_result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1FK@DEBGJFKO@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestMesssage
mov QWORD PTR tv82[rbp], rax
mov r8d, 2
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv82[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv92[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 42 : if (desired_status == PMC_STATUS_OK)
cmp DWORD PTR desired_status$[rbp], 0
jne $LN2@TEST_Great
; 43 : {
; 44 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_I_X (%d.%d)", no, 3), (result = ep->UINT_ENTRY_POINTS.ToByteArray(w, actual_w_buf, sizeof(actual_w_buf), &actual_w_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"ToByteArrayの復帰コードが期待通りではない(%d)", result));
lea r9, QWORD PTR actual_w_buf_size$[rbp]
mov r8d, 256 ; 00000100H
lea rdx, QWORD PTR actual_w_buf$[rbp]
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+56]
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
jne SHORT $LN10@TEST_Great
mov DWORD PTR tv144[rbp], 1
jmp SHORT $LN11@TEST_Great
$LN10@TEST_Great:
mov DWORD PTR tv144[rbp], 0
$LN11@TEST_Great:
mov edx, DWORD PTR result$[rbp]
lea rcx, OFFSET FLAT:??_C@_1DO@DOHJEMND@?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ?$AA0?$PP?$LD@
call FormatTestMesssage
mov QWORD PTR tv133[rbp], rax
mov r8d, 3
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
mov rcx, QWORD PTR tv133[rbp]
mov r9, rcx
mov r8d, DWORD PTR tv144[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
; 45 : TEST_Assert(env, FormatTestLabel(L"GreatestCommonDivisor_I_X (%d.%d)", no, 4), _EQUALS_MEMORY(actual_w_buf, actual_w_buf_size, desired_w_buf, desired_w_buf_size) == 0, L"データの内容が一致しない");
mov r9, QWORD PTR desired_w_buf_size$[rbp]
mov r8, QWORD PTR desired_w_buf$[rbp]
mov rdx, QWORD PTR actual_w_buf_size$[rbp]
lea rcx, QWORD PTR actual_w_buf$[rbp]
call _EQUALS_MEMORY
test eax, eax
jne SHORT $LN12@TEST_Great
mov DWORD PTR tv159[rbp], 1
jmp SHORT $LN13@TEST_Great
$LN12@TEST_Great:
mov DWORD PTR tv159[rbp], 0
$LN13@TEST_Great:
mov r8d, 4
mov edx, DWORD PTR no$[rbp]
lea rcx, OFFSET FLAT:??_C@_1EE@HMCBFGEH@?$AAG?$AAr?$AAe?$AAa?$AAt?$AAe?$AAs?$AAt?$AAC?$AAo?$AAm?$AAm?$AAo?$AAn?$AAD@
call FormatTestLabel
lea r9, OFFSET FLAT:??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov r8d, DWORD PTR tv159[rbp]
mov rdx, rax
mov rcx, QWORD PTR env$[rbp]
call TEST_Assert
$LN2@TEST_Great:
; 46 : }
; 47 : if (w_result == PMC_STATUS_OK)
cmp DWORD PTR w_result$[rbp], 0
jne SHORT $LN3@TEST_Great
; 48 : ep->UINT_ENTRY_POINTS.Dispose(w);
mov rcx, QWORD PTR w$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+32]
$LN3@TEST_Great:
; 49 : if (v_result == PMC_STATUS_OK)
cmp DWORD PTR v_result$[rbp], 0
jne SHORT $LN4@TEST_Great
; 50 : ep->Dispose(v);
mov rcx, QWORD PTR v$[rbp]
mov rax, QWORD PTR ep$[rbp]
call QWORD PTR [rax+592]
$LN4@TEST_Great:
; 51 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TEST_GreatestCommonDivisor_I_X$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+696]
pop rdi
pop rbp
ret 0
TEST_GreatestCommonDivisor_I_X ENDP
_TEXT ENDS
END
|
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 4.1.4 #12246 (Mac OS X x86_64)
;--------------------------------------------------------
.module spritesheet_13
.optsdcc -mgbz80
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _spritesheet_13
.globl _spritesheet_13_animations_lookup
.globl _spritesheet_13_animations
.globl _spritesheet_13_metasprites
.globl _spritesheet_13_metasprite_1
.globl _spritesheet_13_metasprite_0
.globl ___bank_spritesheet_13
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _DATA
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _INITIALIZED
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area _DABS (ABS)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area _HOME
.area _GSINIT
.area _GSFINAL
.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area _HOME
.area _HOME
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area _CODE_255
.area _CODE_255
___bank_spritesheet_13 = 0x00ff
_spritesheet_13_metasprite_0:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x02 ; 2
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_13_metasprite_1:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x04 ; 4
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x06 ; 6
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_13_metasprites:
.dw _spritesheet_13_metasprite_0
.dw _spritesheet_13_metasprite_1
_spritesheet_13_animations:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x01 ; 1
.db #0x01 ; 1
_spritesheet_13_animations_lookup:
.dw #0x0000
_spritesheet_13:
.db #0x02 ; 2
.dw _spritesheet_13_metasprites
.dw _spritesheet_13_animations
.dw _spritesheet_13_animations_lookup
.db #0x00 ; 0
.db #0x0f ; 15
.db #0xf8 ; -8
.db #0x07 ; 7
.byte ___bank_spritesheet_13_tiles
.dw _spritesheet_13_tiles
.db #0x00 ; 0
.dw #0x0000
.area _INITIALIZER
.area _CABS (ABS)
|
; A029006: Expansion of 1/((1-x)(1-x^2)(1-x^3)(1-x^12)).
; 1,1,2,3,4,5,7,8,10,12,14,16,20,22,26,30,34,38,44,48,54,60,66,72,81,87,96,105,114,123,135,144,156,168,180,192,208,220,236,252,268,284,304,320,340,360,380,400,425,445
lpb $0
mov $2,$0
sub $0,1
seq $2,25801 ; Expansion of 1/((1-x^2)*(1-x^3)*(1-x^12)).
add $1,$2
lpe
add $1,1
mov $0,$1
|
/*
Smallest K-Length Subsequence With Occurrences of a Letter
https://leetcode.com/problems/smallest-k-length-subsequence-with-occurrences-of-a-letter/
You are given a string s, an integer k, a letter letter, and an integer repetition.
Return the lexicographically smallest subsequence of s of length k that has the letter letter appear at least repetition times. The test cases are generated so that the letter appears in s at least repetition times.
A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
A string a is lexicographically smaller than a string b if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
Example 1:
Input: s = "leet", k = 3, letter = "e", repetition = 1
Output: "eet"
Explanation: There are four subsequences of length 3 that have the letter 'e' appear at least 1 time:
- "lee" (from "leet")
- "let" (from "leet")
- "let" (from "leet")
- "eet" (from "leet")
The lexicographically smallest subsequence among them is "eet".
Example 2:
example-2
Input: s = "leetcode", k = 4, letter = "e", repetition = 2
Output: "ecde"
Explanation: "ecde" is the lexicographically smallest subsequence of length 4 that has the letter "e" appear at least 2 times.
Example 3:
Input: s = "bb", k = 2, letter = "b", repetition = 2
Output: "bb"
Explanation: "bb" is the only subsequence of length 2 that has the letter "b" appear at least 2 times.
Constraints:
1 <= repetition <= k <= s.length <= 5 * 104
s consists of lowercase English letters.
letter is a lowercase English letter, and appears in s at least repetition times.
*/
class Solution {
public:
string smallestSubsequence(string s, int k, char target, int reps) {
int n = s.size(), remain = count(s.begin(), s.end(), target);
string stack;
for(int i = 0; i < n; i++) {
while(!stack.empty() && stack.back() > s[i] && (n - i + stack.length() > k) && (stack.back() != target || remain > reps)) {
if(stack.back() == target) reps++;
stack.pop_back();
}
if(stack.length() < k) {
if(s[i] == target || k - (int)stack.length() > reps) {
stack += s[i];
reps -= s[i] == target;
}
}
remain -= s[i] == target;
}
return stack;
}
}; |
#include <lwpp/file_request.h>
#include <fstream>
#include <lwpp/message.h>
#if !defined(S_ISDIR)
//#define S_ISDIR(m) (((m) & 0170000) == 0040000)
#define S_ISDIR(m) ((m) & _S_IFDIR)
#endif
#if !defined(S_ISREG)
#define S_ISREG(m) (((m) & 0170000) == 0100000)
#endif
#if !defined(S_IXUSR)
#define S_IXUSR 0000100/* execute/search permission, owner */
#endif
namespace lwpp
{
LWFileReqLocal *FileRequest2::multi_frloc = nullptr;
std::vector<std::string> FileRequest2::ret;
typedef pathList::iterator pathIterator;
typedef pathList::const_iterator pathCIterator;
void trimTrail(std::string &path)
{
while (!path.empty())
/*
&&
(
path[path.size() - 1] == '\\' ||
path[path.size() - 1] == '/' ||
path[path.size() - 1] == ':'
))
*/
{
std::string::size_type i = path.find_last_of(fSeps);
if (i != path.size() - 1) return;
path.erase(path.size() - 1); // trailing slash
}
}
const char *DirInfo::GetDirectory(const char* locType)
{
return_dir.clear();
const char *temp = "";
if (locType)
{
temp = const_cast<char *>(globPtr(locType));
}
else
{
temp = const_cast<char *>(globPtr(dirType));
}
if (temp)
{
return_dir += temp;
// append file separator if needed
if (return_dir.find_last_of (fSeps) != (return_dir.length() - 1))
{
return_dir += fSep;
}
return return_dir.c_str();
}
return "";
}
const char *DirInfo::stripPath(const char *fileName)
{
if (dirType == 0) return fileName;
const char *baseDir = globPtr(dirType);
size_t l = strlen(baseDir);
if (strncmp(baseDir, fileName, strlen(baseDir))) return fileName;
if (fileName[l] == fSep) return (fileName + l + 1); // remove trailing slash if present
return fileName + l;
}
void FileName::buildFullName()
{
//fullName.clear();
splitFileName();
fullName = "";
if (useBase)
{
DirInfo di(baseDir);
fullName += di.GetDirectory();
trimTrail(fullName);
fullName += fSep;
// fullName += fSep; di.Getdirectory always returns a proper file separator
}
if (!relativePath.empty())
{
//if(useBase) fullName += fSep;
fullName += relativePath;
fullName += fSep;
}
fullName += fileName;
valid = true;
}
std::string FileName::extractImageExtension(const char *source)
{
std::string src(source);
std::string ext;
std::string::size_type start = src.find_last_of("(");
std::string::size_type end = src.find_last_of(")");
if ((start != std::string::npos) && (end != std::string::npos))
{
// remove extension including the previous separator
ext = src.substr(start + 1, end-start-1);
}
return ext;
}
std::string FileName::extractExtension(const char *source)
{
std::string src(source);
size_t pos = src.find_last_of(".");
if (pos != std::string::npos)
{
return src.substr(pos);
}
return std::string("");
}
/*!
* Replace the file name extension
* @param *ext new extension, including the "." - may be an empty string to remove the extension.
*/
void FileName::setExtension(const char *ext)
{
// find last file separator
std::string::size_type i = fileName.find_last_of(".");
if (i != std::string::npos)
{
++i; // the first character behind fSep
// remove extension including the previous separator
fileName.erase(i - 1, fileName.size() + 1);
}
fileName.append(ext);
i = fullName.find_last_of(".");
if (i != std::string::npos)
{
++i; // the first character behind fSep
// remove extension including the previous separator
fullName.erase(i - 1, fullName.size() + 1);
}
fullName.append(ext);
valid = false;
}
void FileName::stripNumberTrail()
{
std::string::size_type i = fileName.find_last_not_of("0123456789");
if (i != std::string::npos)
{
// remove numbers
fileName.erase(i + 1);
}
}
std::string FileName::getFileName()
{
splitFileName();
#ifdef _DEBUG
//lwpp::dostream dout;
//dout << "FileName::getFileName() - " << fileName << "\n";
#endif
return fileName;
}
std::string FileName::getPath()
{
splitFileName();
return relativePath;
}
std::string FileName::getFullPath()
{
splitFileName();
std::string fullPath = "";
if (useBase)
{
DirInfo di(baseDir);
fullPath += di.GetDirectory();
trimTrail(fullPath);
}
if (!relativePath.empty())
{
if (useBase) fullPath += fSep;
fullPath += relativePath;
}
trimTrail(fullPath);
#ifdef _DEBUG
dout << "FileName::getPath() - " << fullPath << "\n";
#endif
return fullPath;
}
void FileName::splitFileName()
{
#ifdef _DEBUG
//lwpp::dostream dout;
//dout << "FileName::splitFileName()" << "\n";
#endif
DirInfo di(baseDir);
std::string file(fullName);
std::string::size_type i;
// clear all paths
fileName = "";
relativePath = "";
// find last file separator
i = file.find_last_of(fSeps);
// extract the file name
if (i != std::string::npos)
{
//relativePath = file.substr(0, i - 1);
++i; // the first character behind fSep
// get the filename
fileName = file.substr(i, file.size() - i);
// remove filename including the previous separator
file.erase(i - 1, fileName.size() + 1);
}
else // there is no path
{
fileName = file;
file.erase();
}
// first check if the content path is contained at the start of the full name
#ifdef _DEBUG
//std::hex(dout);
//dout << "file: " << file << "\n";
#endif
i = file.find(di.GetDirectory());
if ((i != std::string::npos) && (i == 0))
{
// path found and it is at the beginning of the string
useBase = true;
file = file.erase(0, strlen(di.GetDirectory()));
#ifdef _DEBUG
//dout << "base dir: " << di.GetDirectory() << "\n";
//dout << "base dir found: " << file << " at:" << i << "\n";
#endif
}
else
{
useBase = false;
}
//LWMessage::Info ("After content strip", file);
// whatever is left now should be the relative path
relativePath = file;
// remove leading and trailing slashes
if (useBase)
{
while (relativePath.find_first_of(fSep) == 0)
{
relativePath.erase(0, 1); // leading slash
}
}
trimTrail(relativePath); // trailing file separator
#ifdef _DEBUG
//dout << "FileNameSplit: " << fullName << "\n";
//dout << "basePath: " << di.GetDirectory() << (useBase ? " (used)\n" : " (not used)\n");
//dout << "relativePath: " << relativePath << "\n";
//dout << "fileName: " << fileName << "\n";
#endif
}
std::string FileName::getRelativeName()
{
#ifdef _DEBUG
dout << "getRelativeName (before): " << relName << "\n";
dout << "getRelativeName (Path): " << relativePath << "\n";
dout << "getRelativeName (filename): " << fileName << "\n";
#endif
relName.clear();
if (!relativePath.empty())
{
relName += relativePath;
relName += fSep;
}
relName += fileName;
#ifdef _DEBUG
dout << "getRelativeName: " << relName << "\n";
#endif
return relName;
}
const char *FileName::getRelativeNameC()
{
getRelativeName();
return relName.c_str();
}
/*!
* This function will check if the file actually exists and build the full name accordingly.
* @param *relName a relative or absolute file name
* @return true if the file could be found
*/
bool FileName::setRelativeName(const char *rel)
{
// assume relName is absolute, attempt to open a file
if (Exists(rel))
{
setFullName(rel);
return true;
}
// build a file name assuming relName is relative
DirInfo di(baseDir);
std::string full;
full = di.GetDirectory();
full += fSep;
full += rel;
// attempt to open the file
if (Exists(full))
{
setFullName(full.c_str());
return true;
}
setFullName(rel);
// all attempts failed
return false;
}
//! Read Instance data
LWError FileName::Load(const LoadState &ls )
{
LWError err = 0;
char loadName[1024];
LWLOAD_STR(ls.getState(), loadName, 1024);
#ifdef _DEBUG
dout << "FileName::Load: " << loadName << "\n";
#endif
if (loadName[0] != '\0') // we have a valid filename
{
if (!setRelativeName(loadName))
{
#ifdef _DEBUG
dout << "FileName::Load: File not found" << getRelativeName() << "\n";
#endif
}
}
return err;
}
//! Write Instance data
LWError FileName::Save(const SaveState &ss )
{
LWError err = 0;
LWSAVE_STR(ss.getState(), getRelativeName().c_str());
#ifdef _DEBUG
dout << "FileName::Save: " << getRelativeName() << "\n";
#endif
return err;
}
bool FileName::Exists(const std::string &fileName)
{
/*
#ifdef _WIN32
struct _stat stat_buf;
return (_stat(name, &stat_buf) == 0);
#else
struct stat stat_buf;
return (stat(name, &stat_buf) == 0);
#endif
*/
std::fstream fin;
fin.open(fileName.c_str(),std::ios::in);
bool rc = fin.is_open();
fin.close();
return rc;
}
/*
* Directory
*/
Directory::~Directory()
{
if (directory) closedir(directory);
directory = 0;
}
Directory::Directory(const std::string name)
: directory (0),
entry(0)
{
directory = opendir(name.c_str());
#ifdef _DEBUG_LWPP
lwpp::dostream dout;
dout << "Open directory: " << name << std::endl;
#endif
}
bool Directory::exists(void)
{
return (directory != 0);
}
bool isDirectory(const std::string name)
{
Stat st(name);
return st.isDirectory();
}
const char *Directory::getEntry()
{
if (exists())
{
while ((entry = readdir (directory)) != 0)
{
if (strcmp(entry->d_name, "..") && strcmp(entry->d_name, "." ) )
{
return entry->d_name;
}
}
}
return 0;
}
#if defined(LWPP_PLATFORM_OSX_CFM)
void makeAllDirectories(const char *path)
{
char DirName[1024];
char* p = const_cast<char *>(path);
char* q = DirName;
bool root = true;
while(*p)
{
if (':' == *p)
{
if (root)
{
root = false; // skip root
}
else
{
_mkdir(DirName);
}
}
*q++ = *p++;
*q = '\0';
}
}
std::string getTempPath()
{
std::string result;
FSRef fs;
OSErr err = FSFindFolder(kUserDomain, kTemporaryFolderType, true, &fs);
if (err != noErr)
{
//qWarning() << "error doing FSFindFolder:" << err;
return result;
}
CFURLRef dirURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &fs);
char fsRepr[1024];
if (!CFURLGetFileSystemRepresentation(dirURL, true, (UInt8*) fsRepr, 1024)) {
//qWarning() << "error invoking CFURLGetFileSystemRepresentation";
return result;
}
result = fsRepr;
//result.setPath(QString::fromUtf8(fsRepr));
CFRelease(dirURL);
return result;
}
//! OS specific file requester
OSFileRequest::OSFileRequest (const int reqType, char *title,
const char *fileType, const char *ext, const char *baseName,
const char *path, const char *_baseDirType, int bufLen)
: type(reqType)
{
status = NavGetDefaultDialogCreationOptions(&dialogOptions);
dialogOptions.modality = kWindowModalityAppModal;
dialogOptions.windowTitle = CFStringCreateWithCString(NULL, title, kCFStringEncodingMacRoman);
dialogOptions.saveFileName = CFStringCreateWithCString(NULL, baseName, kCFStringEncodingMacRoman);
if (type == FREQ_LOAD)
{
status = NavCreateGetFileDialog(&dialogOptions, NULL, NULL, NULL, NULL, NULL, &dialog);
}
else if (type == FREQ_SAVE)
{
status = NavCreatePutFileDialog(&dialogOptions, kUnknownType, kUnknownType, NULL, NULL, &dialog);
}
}
OSFileRequest::~OSFileRequest()
{
NavDialogDispose(dialog);
}
bool OSFileRequest::Post(void)
{
status = NavDialogRun(dialog);
NavUserAction action = NavDialogGetUserAction(dialog);
if (( action != kNavUserActionOpen ) && (action != kNavUserActionSaveAs)) return false;
status = NavDialogGetReply(dialog, &replyRecord);
return true;
}
const char *OSFileRequest::getFullName(void)
{
temp_path.clear();
FSRef fileAsFSRef;
status = AEGetNthPtr(&(replyRecord.selection), 1, typeFSRef, NULL, NULL, &fileAsFSRef, sizeof(FSRef), NULL);
CFURLRef url = CFURLCreateFromFSRef(NULL, &fileAsFSRef);
if (url == NULL) return 0;
CFStringRef hfs_path = NULL;
if (type == FREQ_LOAD)
{
hfs_path = CFURLCopyFileSystemPath(url, kCFURLHFSPathStyle);
}
else if (type == FREQ_SAVE)
{
CFURLRef file_url = CFURLCreateCopyAppendingPathComponent(NULL, url, replyRecord.saveFileName, false);
hfs_path = CFURLCopyFileSystemPath(file_url, kCFURLHFSPathStyle);
CFRelease(file_url);
}
char c_path[1024];
CFStringGetCString(hfs_path, c_path, 1024-1, kCFStringEncodingUTF8);
temp_path = c_path;
CFRelease(url);
CFRelease(hfs_path);
return temp_path.c_str();
}
#endif
std::string stripExtension(const char *source)
{
std::string src(source);
return src.substr(0, src.find_last_of("."));
}
std::string trim(const std::string& s, const char *ws)
{
if(s.length() == 0)
return s;
size_t b = s.find_first_not_of(ws);
size_t e = s.find_last_not_of(ws);
if(b == -1) // No non-spaces
return "";
return std::string(s, b, e - b + 1);
}
/*
* Possible file paths:
*
* D:\classic\windows\path\and\file.ext
* result:
* - D:
* - classic
* - windows
* - path
* - and
* \\UNC\based\path\and\file.ext
* result:
* - \
* - UNC
* - based
* - pathb
* - and
* /Volume/On/OSX/and/file.ext
* result:
* - ""
* - Volume
* - On
* - OSX
* - and
*/
pathList splitPath(std::string sourcePath)
{
#ifdef _DEBUG
//lwpp::dostream dout;
//dout << "splitPath (" << sourcePath << ");\n";
#endif
std::deque<std::string> elements;
size_t pos = sourcePath.find_last_of(fSeps);
while (pos != std::string::npos)
{
if ((pos = sourcePath.size()-1) != 0)
{
pos = sourcePath.find_last_of(fSeps);
}
if (pos == 0)
{
#ifdef LWPP_PLATFORM_OSX_UB
#ifdef _DEBUG
//dout << "\"" << sourcePath.substr(1) << "\" ->" << sourcePath << "\n";
//dout << "\" \"\n";
#endif
elements.push_front(sourcePath.substr(1));
elements.push_front("");
#else
#ifdef _DEBUG
//dout << "\"" << sourcePath.substr(0,1) << "\" ->" << sourcePath << "\n";
#endif
elements.push_front(sourcePath.substr(0,1));
#endif
sourcePath.erase(0);
pos = std::string::npos;
}
else if (pos != std::string::npos)
{
#ifdef _DEBUG
//dout << "\"" << sourcePath.substr(pos+1) << "\" ->" << sourcePath << "\n";
#endif
if (!sourcePath.substr(pos+1).empty())
{
elements.push_front(sourcePath.substr(pos+1));
}
sourcePath.erase(pos);
pos = sourcePath.find_last_of(fSeps);
}
}
if (!sourcePath.empty()) elements.push_front(sourcePath);
return elements;
}
pathList splitFullPath(std::string sourcePath, std::string &fileName, std::string &ext)
{
size_t pos = sourcePath.find_last_of(fSeps);
if (pos != std::string::npos)
{
fileName = sourcePath.substr(pos+1);
}
else
{
fileName = sourcePath;
sourcePath.clear();
}
// Strip file name and extension
size_t ePos = fileName.find_last_of(".");
if (ePos != std::string::npos)
{
ext = fileName.substr(ePos+1);
fileName.erase(ePos);
}
if (pos != std::string::npos)
{
sourcePath.erase(pos);
}
return splitPath(sourcePath);
}
std::string makeFullPath(const pathList &path)
{
#ifdef _DEBUG
//lwpp::dostream dout;
//dout << "makeFullPath ();\n";
#endif
std::string fullName;
for (pathCIterator iter = path.begin(); iter != path.end(); ++iter)
{
fullName += *iter;
fullName += fSep;
#ifdef _DEBUG
//dout << ": \"" << *iter << "\" " << fSep << "\n";
#endif
}
#ifdef _DEBUG
//dout << "= \"" << fullName << "\"\n";
#endif
return fullName;
}
std::string makeFullFileName(const pathList &path, const std::string &file, const std::string &ext)
{
return makeFullPath(path) + file + "." + ext;
}
std::string makeRelativeName(pathList basePath, const std::string absFileName)
{
std::string name, ext;
pathList abs = splitFullPath(absFileName, name, ext);
// remove common elements
while ((abs.begin() != abs.end()) &&
(basePath.begin() != basePath.end()) &&
(*basePath.begin() == *abs.begin()))
{
basePath.pop_front();
abs.pop_front();
}
if (basePath.empty())
{
return makeFullFileName(abs, name, ext);
}
else
{
return absFileName;
}
}
std::string makeRelativeName(const std::string basePath, const std::string absFileName)
{
pathList base = splitPath(basePath);
return makeRelativeName(base, absFileName);
}
std::string makeAbsoluteName(pathList basePath, const std::string relFileName)
{
std::string name, ext;
pathList rel = splitFullPath(relFileName, name, ext);
// append the relative path to the absolute path
basePath.insert(basePath.end(), rel.begin(), rel.end());
std::string absName = makeFullFileName(basePath, name, ext);
if (FileName::Exists(absName)) return absName;
return relFileName;
}
std::string makeAbsoluteName(const std::string basePath, const std::string relFileName)
{
pathList base = splitPath(basePath);
return makeAbsoluteName(base, relFileName);
}
struct Stat::statData
{
struct _stat buf;
int result;
};
Stat::Stat(const std::string fName)
: d (new statData)
{
d->result = _stat(fName.c_str(), &d->buf);
}
Stat::~Stat()
{
delete d;
}
bool Stat::isDirectory() const
{
if( d->result == 0 )
{
return (S_ISDIR(d->buf.st_mode) != 0);
}
return false;
}
bool Stat::exists() const
{
return ( d->result == 0 );
}
time_t Stat::getCreateTimeStamp() const
{
return d->buf.st_ctime;
}
time_t Stat::getModifyTimeStamp() const
{
return d->buf.st_mtime;
}
size_t Stat::getFileSize() const
{
return d->buf.st_size;
}
} // namespace lwpp
|
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: User/User
FILE: userC.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
DESCRIPTION:
This file contains C interface routines for the User routines
$Id: userC.asm,v 1.1 97/04/07 11:45:55 newdeal Exp $
------------------------------------------------------------------------------@
SetGeosConvention
C_User segment resource
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardRegisterItem
C DECLARATION: extern Boolean
_far _pascal ClipboardRegisterItem(
TransferBlockID header,
word flags); /* ClipboardItemFlags */
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDREGISTERITEM proc far
C_GetThreeWordArgs bx, ax, cx, dx ;bx=file, ax=block, cx=flags
push bp
mov bp, cx ; bp = flags
call ClipboardRegisterItem
pop bp
mov ax, 0 ; set Boolean return value
jc done ; (carry -> error -> FALSE)
dec ax
done:
ret
CLIPBOARDREGISTERITEM endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardUnregisterItem
C DECLARATION: extern void
_far _pascal ClipboardUnregisterItem(optr owner);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDUNREGISTERITEM proc far
C_GetOneDWordArg cx, dx, ax, bx ;^lcx:dx = owner
call ClipboardUnregisterItem
ret
CLIPBOARDUNREGISTERITEM endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardQueryItem
C DECLARATION: extern void /* ClipboardItemFlags */
_far _pascal ClipboardQueryItem(word flags,
ClipboardQueryArgs _far *retValue);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
ClipboardQueryArgs struct
CQA_numFormats word
CQA_owner optr
CQA_header dword
ClipboardQueryArgs ends
CLIPBOARDQUERYITEM proc far
C_GetThreeWordArgs bx, ax, cx, dx ;bx=flags, ax=seg, cx=off
uses es, di, bp
.enter
mov es, ax ; es:di = args
mov di, cx
mov bp, bx ; bp = flags
call ClipboardQueryItem
mov es:[di].CQA_numFormats, bp
mov es:[di].CQA_owner.handle, cx
mov es:[di].CQA_owner.handle, dx
mov es:[di].CQA_header.high, bx ; VM file handle
mov es:[di].CQA_header.low, ax ; VM block handle
.leave
ret
CLIPBOARDQUERYITEM endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardTestItemFormat
C DECLARATION: extern Boolean
_far _pascal ClipboardTestItemFormat(
TransferBlockID header,
ClipboardItemFormatID format);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDTESTITEMFORMAT proc far header:dword,
format:dword
.enter
mov bx, header.high
mov ax, header.low
mov cx, format.low ; cx <- manuf
mov dx, format.high ; dx <- type
call ClipboardTestItemFormat
mov ax, 0 ; set Boolean return value
jc done ; (carry -> not supported -> FALSE)
dec ax
done:
.leave
ret
CLIPBOARDTESTITEMFORMAT endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardEnumItemFormats
C DECLARATION: extern word
_far _pascal ClipboardEnumItemFormats(
TransferBlockID header,
word maxNumFormats,
ClipboardItemFormatID _far *buffer);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDENUMITEMFORMATS proc far header:dword,
maxNumFormats:word,
buffer:dword
uses es, di
.enter
mov bx, header.high
mov ax, header.low
mov cx, maxNumFormats
mov es, buffer.high
mov di, buffer.low
call ClipboardEnumItemFormats ; cx = formats return
mov_tr ax, cx
.leave
ret
CLIPBOARDENUMITEMFORMATS endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetItemInfo
C DECLARATION: extern dword
_far _pascal ClipboardGetItemInfo(optr owner);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETITEMINFO proc far
C_GetOneDWordArg bx, ax, cx, dx ;bx = VM file, ax = VM block
call ClipboardGetItemInfo ; cx:dx = source ID
mov ax, dx
mov dx, cx ; dx:ax = source ID
ret
CLIPBOARDGETITEMINFO endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardRequestItemFormat
C DECLARATION: extern void
_far _pascal ClipboardRequestItemFormat(
ClipboardItemFormatID format,
TransferBlockID header,
CRequestArgs _far *retValue);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CRequestArgs struct
CRA_file hptr
CRA_data dword
CRA_extra1 word
CRA_extra2 word
CRequestArgs ends
CLIPBOARDREQUESTITEMFORMAT proc far format:dword,
header:dword,
retValue:dword
uses es, di
.enter
mov es, retValue.high ; es:di = args
mov di, retValue.low
mov cx, format.low ; cx = manuf ID
mov dx, format.high ; dx = format
mov bx, header.high ; bx = VM file
mov ax, header.low ; ax = VM block
call ClipboardRequestItemFormat
mov es:[di].CRA_file, bx
movdw es:[di].CRA_data, axbp
mov es:[di].CRA_extra1, cx
mov es:[di].CRA_extra2, dx
.leave
ret
CLIPBOARDREQUESTITEMFORMAT endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardDoneWithItem
C DECLARATION: extern void
_far _pascal ClipboardDoneWithItem(
TransferBlockID header);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDDONEWITHITEM proc far
C_GetOneDWordArg bx, ax, cx, dx ;bx = VM file, ax = VM block
call ClipboardDoneWithItem
ret
CLIPBOARDDONEWITHITEM endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetNormalItemInfo
C DECLARATION: extern TransferBlockID
_far _pascal ClipboardGetNormalItemInfo();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETNORMALITEMINFO proc far
call ClipboardGetNormalItemInfo ; bx:ax = VM file:VM block
mov dx, bx ; dx:ax = VM file:VM block
ret
CLIPBOARDGETNORMALITEMINFO endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetQuickItemInfo
C DECLARATION: extern TransferBlockID
_far _pascal ClipboardGetQuickItemInfo();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETQUICKITEMINFO proc far
call ClipboardGetQuickItemInfo ; bx:ax = VM file:VM block
mov dx, bx ; dx:ax = VM file:VM block
ret
CLIPBOARDGETQUICKITEMINFO endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetUndoItemInfo
C DECLARATION: extern TransferBlockID
_far _pascal ClipboardGetUndoItemInfo();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETUNDOITEMINFO proc far
call ClipboardGetUndoItemInfo ; bx:ax = VM file:VM block
mov dx, bx ; dx:ax = VM file:VM block
ret
CLIPBOARDGETUNDOITEMINFO endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetClipboardFile
C DECLARATION: extern VMFileHandle
_far _pascal ClipboardGetClipboardFile();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETCLIPBOARDFILE proc far
call ClipboardGetClipboardFile ; bx = VM file
mov ax, bx ; ax = VM file
ret
CLIPBOARDGETCLIPBOARDFILE endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardAddToNotificationList
C DECLARATION: extern void
_far _pascal ClipboardAddToNotificationList(optr notificationOD);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDADDTONOTIFICATIONLIST proc far
C_GetOneDWordArg cx, dx, ax, bx ;^lcx:dx = optr
call ClipboardAddToNotificationList
ret
CLIPBOARDADDTONOTIFICATIONLIST endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardRemoveFromNotificationList
C DECLARATION: extern Boolean
_far _pascal ClipboardRemoveFromNotificationList(
optr notificationOD);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDREMOVEFROMNOTIFICATIONLIST proc far
C_GetOneDWordArg cx, dx, ax, bx ;^lcx:dx = optr
call ClipboardRemoveFromNotificationList
mov ax, 0 ; set Boolean return value
jc done ; (carry set -> not found -> FALSE)
dec ax
done:
ret
CLIPBOARDREMOVEFROMNOTIFICATIONLIST endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardRemoteSend
C DECLARATION: extern Boolean
_far _pascal ClipboardRemoteSend();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ISR 1/93 Initial version
------------------------------------------------------------------------------@
CLIPBOARDREMOTESEND proc far
clr ax
call ClipboardRemoteSend
jnc exit
dec ax
exit:
ret
CLIPBOARDREMOTESEND endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardRemoteReceive
C DECLARATION: extern Boolean
_far _pascal ClipboardRemoteReceive();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ISR 1/93 Initial version
------------------------------------------------------------------------------@
CLIPBOARDREMOTERECEIVE proc far
clr ax
call ClipboardRemoteReceive
jnc exit
dec ax
exit:
ret
CLIPBOARDREMOTERECEIVE endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardStartQuickTransfer
C DECLARATION: extern Boolean
_far _pascal ClipboardStartQuickTransfer(
ClipboardQuickTransferFlags flags,
ClipboardQuickTransferFeedback initialCursor,
word mouseXPos, word mouseYPos,
ClipboardQuickTransferRegionInfo _far *regionParams,
optr notificationOD);
Note: "regionParams" and its fields *cannot* be
pointing into the XIP movable code resource.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDSTARTQUICKTRANSFER proc far flags:word,
initialCursor:word,
mouseXPos:word, mouseYPos:word,
regionParams:dword,
notificationOD:dword
uses ds, si, es, di
.enter
if FULL_EXECUTE_IN_PLACE
;
; Make sure the fptr passed in is valid
;
EC < pushdw bxsi >
EC < movdw bxsi, regionParams >
EC < call ECAssertValidFarPointerXIP >
EC < popdw bxsi >
endif
sub sp, size ClipboardQuickTransferRegionInfo
tst regionParams.high
jz noRegionParams
mov ds, regionParams.high
mov si, regionParams.low
segmov es, ss
mov di, sp
mov cx, size ClipboardQuickTransferRegionInfo
rep movsb
noRegionParams:
mov si, flags
mov ax, initialCursor
mov cx, mouseXPos
mov dx, mouseYPos
mov bx, notificationOD.high
mov di, notificationOD.low
call ClipboardStartQuickTransfer
mov ax, 0 ; set Boolean return value
jc done ; (carry set -> error -> FALSE)
dec ax
done:
add sp, size ClipboardQuickTransferRegionInfo
.leave
ret
CLIPBOARDSTARTQUICKTRANSFER endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardGetQuickTransferStatus
C DECLARATION: extern Boolean
_far _pascal ClipboardGetQuickTransferStatus();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDGETQUICKTRANSFERSTATUS proc far
call ClipboardGetQuickTransferStatus
mov ax, 0 ; set Boolean return value
jz done ; not in progress
dec ax ; else, in progress
done:
ret
CLIPBOARDGETQUICKTRANSFERSTATUS endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardSetQuickTransferFeedback
C DECLARATION: extern void
_far _pascal ClipboardSetQuickTransferFeedback(
ClipboardQuickTransferFeedback cursor,
word buttonFlags);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDSETQUICKTRANSFERFEEDBACK proc far
C_GetTwoWordArgs ax, bx, cx, dx ;ax = cursor, bx = flags
push bp
mov bh, bl ; We need flags in high byte
clr bl
mov bp, bx ; bp = button flags (UIFA_*) << 8
call ClipboardSetQuickTransferFeedback
pop bp
ret
CLIPBOARDSETQUICKTRANSFERFEEDBACK endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardEndQuickTransfer
C DECLARATION: extern void
_far _pascal ClipboardEndQuickTransfer(
ClipboardQuickNotifyFlags flags);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDENDQUICKTRANSFER proc far
C_GetOneWordArg bx, cx, dx ;bx = flags
push bp
mov bp, bx ; bp = ClipboardQuickNotifyFlags
call ClipboardEndQuickTransfer
pop bp
ret
CLIPBOARDENDQUICKTRANSFER endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardAbortQuickTransfer
C DECLARATION: extern void
_far _pascal ClipboardAbortQuickTransfer();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDABORTQUICKTRANSFER proc far
call ClipboardAbortQuickTransfer
ret
CLIPBOARDABORTQUICKTRANSFER endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardClearQuickTransferNotification
C DECLARATION: extern void
_far _pascal ClipboardClearQuickTransferNotification(
optr notificationOD);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDCLEARQUICKTRANSFERNOTIFICATION proc far
C_GetOneDWordArg bx, dx, ax, cx ;^lbx:dx = optr
push di
mov di, dx ; ^lbx:di = optr
call ClipboardClearQuickTransferNotification
pop di
ret
CLIPBOARDCLEARQUICKTRANSFERNOTIFICATION endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: ClipboardHandleEndMoveCopy
C DECLARATION: extern dword
_far _pascal ClipboardHandleEndMoveCopy(word activeGrab,
word uifa,
Boolean checkQTInProgress);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/91 Initial version
------------------------------------------------------------------------------@
CLIPBOARDHANDLEENDMOVECOPY proc far
C_GetThreeWordArgs bx, dx, ax, cx ; bx = activeGrab
; dx = uifa
; ax = checkQTInProgress
mov bp, dx ; bp = UIFunctionsActive flags
tst ax
jz haveBoolean ; carry clear if FALSE
stc ; else, carry clear (TRUE)
haveBoolean:
call ClipboardHandleEndMoveCopy ; ax = MSG_META_END_MOVE_COPY or
; MSG_META_END_OTHER
mov dx, bp ; dx = UIFunctionsActive flags
ret
CLIPBOARDHANDLEENDMOVECOPY endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: UserDoDialog
C DECLARATION: extern word
_far _pascal UserDoDialog(optr dialogBox);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
tony 9/91 Initial version
------------------------------------------------------------------------------@
USERDODIALOG proc far
C_GetOneDWordArg bx, ax, cx, dx ;^lbx:ax = optr
push si
mov_trash si, ax
call UserDoDialog
pop si
ret
USERDODIALOG endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: UserCreateDialog
C DECLARATION: extern optr
_far _pascal UserCreateDialog(optr dialogBox);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 9/92 Initial version
------------------------------------------------------------------------------@
USERCREATEDIALOG proc far
C_GetOneDWordArg bx, ax, cx, dx ;^lbx:ax = optr
push si
mov_trash si, ax
call UserCreateDialog
mov_trash dx, bx
mov_trash ax, si
pop si
ret
USERCREATEDIALOG endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: UserDestroyDialog
C DECLARATION: extern void
_far _pascal UserDestroyDialog(optr dialogBox);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 9/92 Initial version
------------------------------------------------------------------------------@
USERDESTROYDIALOG proc far
C_GetOneDWordArg bx, ax, cx, dx ;^lbx:ax = optr
push si
mov_trash si, ax
call UserDestroyDialog
pop si
ret
USERDESTROYDIALOG endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: UserDiskRestore
C DECLARATION: extern word
_pascal UserDiskRestore(void *savedDiskData,
word *diskHandlePtr);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/92 Initial version
------------------------------------------------------------------------------@
USERDISKRESTORE proc far savedData:fptr,
diskHandlePtr:fptr.word
uses ds, si
.enter
lds si, ss:[savedData] ; ds:si <- data
call UserDiskRestore
lds si, ss:[diskHandlePtr]
mov ds:[si], ax ; store disk handle/error
jc done ; if error, return error code
; as value of function
clr ax ; else return 0, to signal
; restore ok.
done:
.leave
ret
USERDISKRESTORE endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: FlowAlterHierarchicalGrab
C DECLARATION: extern Segment
FlowAlterHierarchicalGrab(optr objectOptr,
Message gainedMessage,
word offsetToMasterInstance,
word offsetToHierarchicalGrab,
optr objectToBeGivenExclusive,
HierarchicalFlags flags);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
anna 5/8/92 Initial version
------------------------------------------------------------------------------@
FLOWALTERHIERARCHICALGRAB proc far objectOptr:optr,
gainedMessage:word,
offsetToMasterInstance:word,
offsetToHierarchicalGrab:word,
objectToBeGivenExclusive:dword,
flags:word
uses ds, si, di
.enter
movdw bxsi, objectOptr
call MemDerefDS
mov ax, gainedMessage
mov bx, offsetToMasterInstance
mov di, offsetToHierarchicalGrab
mov cx, objectToBeGivenExclusive.high
mov dx, objectToBeGivenExclusive.low
mov bp, flags
call FlowAlterHierarchicalGrab
mov ax, ds ; updated segment
.leave
ret
FLOWALTERHIERARCHICALGRAB endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: FlowUpdateHierarchicalGrab
C DECLARATION: extern Segment
FlowUpdateHierarchicalGrab(optr objectOptr,
Message gainedMessage,
word offsetToMasterInstance,
word offsetToHierarchicalGrab,
Message updateMessage);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
anna 5/8/92 Initial version
doug 8/92 Modified for API change
------------------------------------------------------------------------------@
FLOWUPDATEHIERARCHICALGRAB proc far objectOptr:dword,
gainedMessage:word,
offsetToMasterInstance:word,
offsetToHierarchicalGrab:word,
updateMessage:word
uses ds, si, di, bp
.enter
movdw bxsi, objectOptr
call MemDerefDS ; *ds:si = instance data
mov ax, updateMessage
mov bx, offsetToMasterInstance
mov di, offsetToHierarchicalGrab
mov bp, gainedMessage
call FlowUpdateHierarchicalGrab
mov ax, ds ; updated segment
.leave
ret
FLOWUPDATEHIERARCHICALGRAB endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: FlowDispatchSendOnOrDestroyClassedEvent
C DECLARATION:
extern Boolean /* XXX */
FlowDispatchSendOnOrDestroyClassedEvent(
MessageReturnValues *retvals,
optr objectOptr,
Message messageToSend,
EventHandle classedEvent,
word otherData,
optr objectToSendTo,
MessageFlags flags);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
anna 5/8/92 Initial version
------------------------------------------------------------------------------@
FLOWDISPATCHSENDONORDESTROYCLASSEDEVENT proc far retvals:fptr,
objectOptr:optr,
messageToSend:word,
classedEvent:word,
otherData:word,
objectToSendTo:optr,
flags:word
uses ds, si, di, es
.enter
movdw bxsi, objectOptr
call MemDerefDS
mov ax, messageToSend
mov cx, classedEvent
mov dx, otherData
mov di, flags
mov bx, objectToSendTo.high
mov bp, objectToSendTo.low
call FlowDispatchSendOnOrDestroyClassedEvent
jnc noDestination
cmp di, mask MF_CALL ; see if return values should
; be stuffed
jne destinationFound
les di, retvals ; stuff return values
stosw
mov_tr ax, bp
stosw
mov_tr ax, cx
stosw
mov_tr ax, dx
stosw
destinationFound:
mov ax, -1
jmp done
noDestination:
mov ax, 0
done:
.leave
ret
FLOWDISPATCHSENDONORDESTROYCLASSEDEVENT endp
if FULL_EXECUTE_IN_PLACE
C_User ends
UserCStubXIP segment resource
endif
COMMENT @----------------------------------------------------------------------
C FUNCTION: FlowCheckKbdShortcut
This version of FlowCheckKbdShortcut() returns a -1 if
the key was not found in the table, or the offset into
the table if it was found.
C DECLARATION: extern word
FlowCheckKbdShortcut(KeyboardShortcut *shortcutTable,
word numEntriesInTable,
word character,
word flags,
word state)
Note: "shortuctTable" *can* be pointing to the movable XIP
code resource.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jdashe 2/20/93 Initial version
------------------------------------------------------------------------------@
FLOWCHECKKBDSHORTCUT proc far shortcutTable:fptr,
numEntriesInTable:word,
character:word,
flags:word,
state:word
uses ds, si, di, bp
.enter
lds si, shortcutTable ; ds:si <- pointer to a
; shortcut table
mov ax, numEntriesInTable
mov cx, character
mov dx, flags
mov bp, state
call FlowCheckKbdShortcut
mov ax, si ; assume the key was found
jc done ; jump if it was found.
mov ax, -1 ; signal: the key was not
; found in the table.
done:
.leave
ret
FLOWCHECKKBDSHORTCUT endp
if FULL_EXECUTE_IN_PLACE
UserCStubXIP ends
C_User segment resource
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERREGISTERFORTEXTCONTEXT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION void _pascal VisTextRegisterForContext(optr obj);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERREGISTERFORTEXTCONTEXT:far
USERREGISTERFORTEXTCONTEXT proc far
C_GetTwoWordArgs cx, dx, ax, bx
call UserRegisterForTextContext
ret
USERREGISTERFORTEXTCONTEXT endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERUNREGISTERFORTEXTCONTEXT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION void _pascal VisTextRegisterForContext(optr obj);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERUNREGISTERFORTEXTCONTEXT:far
USERUNREGISTERFORTEXTCONTEXT proc far
C_GetTwoWordArgs cx, dx, ax, bx
call UserUnregisterForTextContext
ret
USERUNREGISTERFORTEXTCONTEXT endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERCREATEINKDESTINATIONINFO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION: extern MemHandle _pascal UserCreateInkDestinationInfo(
optr dest, GState gs, word brushSize, void *gestureCallback);
Note: "gestureCallback" must be vfptr for XIP.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERCREATEINKDESTINATIONINFO:far
USERCREATEINKDESTINATIONINFO proc far destOD:optr,
gstate:hptr,
brushSize:word,
callback:fptr
uses di, bp
.enter
movdw cxdx, destOD
mov ax, brushSize
movdw bxdi, callback
mov bp, gstate
call UserCreateInkDestinationInfo
mov_tr ax, bp ;AX <- InkDestinationInfo structure
.leave
ret
USERCREATEINKDESTINATIONINFO endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERGETINITFILECATEGORY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION void _pascal VisTextRegisterForContext(optr obj);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERGETINITFILECATEGORY:far
USERGETINITFILECATEGORY proc far
C_GetOneDWordArg ax, bx, cx, dx
push ds, si
mov ds, ax
mov si, bx
call UserGetInitFileCategory
pop ds, si
ret
USERGETINITFILECATEGORY endp
if FULL_EXECUTE_IN_PLACE
C_User ends
UserCStubXIP segment resource
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERLOADAPPLICATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION:
extern GeodeHandle _pascal UserLoadApplication(
AppLaunchFlags alf,
Message attachMethod,
MemHandle appLaunchBlock,
char *filename,
StandardPath sp,
GeodeLoadError *err);
Note: "filename" *can* be pointing to the movable XIP
code resource.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERLOADAPPLICATION:far
USERLOADAPPLICATION proc far alf:word,
attachMethod:word,
appLaunchBlock:hptr,
filename:fptr,
sPath:word,
err:fptr
uses bx, cx, dx, ds, si
.enter
mov cx, alf
mov ah, cl
mov cx, attachMethod
mov dx, appLaunchBlock
lds si, filename
mov bx, sPath
call UserLoadApplication
jc error
mov ax, bx
exit:
.leave
ret
error:
lds si, err
mov ds:[si], ax
mov ax, -1
jmp exit
USERLOADAPPLICATION endp
if FULL_EXECUTE_IN_PLACE
UserCStubXIP ends
C_User segment resource
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERALLOCOBJBLOCK
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate an object block.
CALLED BY: Global.
PASS: ThreadHandle handle = Handle of thread to run block
(0 for current thread).
RETURN: MemHandle = Handle of created object block.
DESTROYED: BX.
SIDE EFFECTS:
Requires: ????
Asserts: ????
CHECKS: None.
PSEUDO CODE/STRATEGY:
Pass all of the work off on UserAllocObjBlock.
KNOWN DEFECTS/CAVEATS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
JDM 93.04.13 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERALLOCOBJBLOCK:far
USERALLOCOBJBLOCK proc far threadHandle:word
.enter
; Make UserAllocObjBlock do all of the real work.
mov bx, threadHandle
call UserAllocObjBlock ; BX == new block handle.
mov_trash ax, bx ; AX = new block handle.
.leave
ret
USERALLOCOBJBLOCK endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERENCRYPTPASSWORD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION:
extern Boolean _pascal UserEncryptPassword(const char *string,
char *dest);
Note: The fptr *cannot* be pointing to the movable XIP code
resource.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
tony 4/26/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERENCRYPTPASSWORD:far
USERENCRYPTPASSWORD proc far source:fptr.char, dest:fptr.char
uses si, di, ds, es
.enter
lds si, source
les di, dest
clr ax
call UserEncryptPassword
jnc done
dec ax
done:
.leave
ret
USERENCRYPTPASSWORD endp
COMMENT @----------------------------------------------------------------------
C FUNCTION: UserGetRecentDocFileName()
Open the most-recently-opened-doc file, read its content into
memory block and return the block handle, locked address of
the DocumentArray, and the index of first element.
It's a circular array.
C DECLARATION: extern void
_far _pascal ();
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
edwin 11/98 Initial version
------------------------------------------------------------------------------@
global USERGETRECENTDOCFILENAME:far
USERGETRECENTDOCFILENAME proc far mh:fptr.word,
start:fptr.word,
buffer:fptr.char
uses ax, cx, ds, di, es, si
.enter
push bp
call UserGetRecentDocFileName
mov ax, bp
pop bp
; bp = memory handle
; es:di = memory address
;
lds si, mh
mov ds:[si], ax ; memory block handle
lds si, start
clr ax
mov al, es:[di]
mov ds:[si], ax ; counter
lds si, buffer
inc di ; skip the first byte of counter
movdw ds:[si], esdi ; address of DocumentArray
.leave
ret
USERGETRECENTDOCFILENAME endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USERCREATEICONTEXTMONIKER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C DECLARATION: extern optr
_pascal UserCreateIconTextMoniker(optr textMoniker,
optr iconMoniker,
Handle destinationBlock,
word spacing,
CreateIconTextMonikerFlags flags);
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
joon 3/12/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global USERCREATEICONTEXTMONIKER:far
USERCREATEICONTEXTMONIKER proc far \
params:CreateIconTextMonikerParams
ForceRef params
popdw bxcx ; bxcx = return address
call UserCreateIconTextMoniker
pushdw bxcx ; restore retuen address
ret @ArgSize
USERCREATEICONTEXTMONIKER endp
C_User ends
SetDefaultConvention
|
[bits 16]
print_si_16:
pusha
mov ah,0x0e ;This is the higher byte of the ax register
print_16_loop:
; mov al,[si]
; inc si
lodsb ;Performs the function of the previous two shits
cmp al,0
je print_16_end
int 0x10
jmp print_16_loop
print_16_end:
; mov al,0x0A ;Enter
; int 0x10
; mov al,0x0D ;Carriage return
; int 0x10
popa
ret
print_hex_bx:
pusha
mov ah,0x0e
; mov al,10
; int 0x10
; mov al,13
; int 0x10
mov al,'0'
int 0x10
mov al,'x'
int 0x10
mov cx,4
.loop:
mov ax,bx
and ax,0xf000
shr ax,12
cmp ax,9
jg .print_hex_letter
add ax,0x30 ;ascii encoding for numbers
jmp .print_hex_conv_end
.print_hex_letter:
add ax,55 ;ascii encoding for numbers
.print_hex_conv_end:
mov ah,0x0e ;Printing routine
int 0x10
shl bx,4
loop .loop
popa
ret
get_cursor_16:
;pusha can't use this becuase we expect a return vlaue in bx
push dx
push ax
mov al, 0x0f ;Refer to the index register table port mapping for CRT (low byte)
mov dx, 0x3d4 ; port number CRT index
out dx,al ;Write 0x0f in port 0x3D4 --- note that the port registers are 1 byte in size
mov dx,0x3d5 ;port number CRT data
in al,dx ;Store the low byte in al -- Hardware forced to use al
mov bl,al
mov al, 0x0e ;Refer to the index register table port mapping for CRT (high byte)
mov dx, 0x3d4 ; port number CRT index
out dx,al ;Write 0x0f in port 0x3D4 --- note that the port registers are 1 byte in size
mov dx,0x3d5 ;port number CRT data
in al,dx ;Store the high byte in al -- Hardware forced to use al
mov bh,al ;Store the high byte in bh
pop ax
pop dx
ret
|
; A041027: Denominators of continued fraction convergents to sqrt(18).
; Submitted by Jon Maiga
; 1,4,33,136,1121,4620,38081,156944,1293633,5331476,43945441,181113240,1492851361,6152518684,50713000833,209004522016,1722749176961,7100001229860,58522759015841,241191037293224,1988051057361633,8193395266739756,67535213191279681,278334248031858480,2294209197446147521,9455171037816448564,77935577499977736033,321197481037727392696,2647515425801796877601,10911259184244914903100,89937588899761116102401,370661614783289379312704,3055230507166076150604033,12591583643447593981728836
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,2
mul $2,8
lpe
mov $0,$2
div $0,8
|
;
; Spectrum C Library
;
; Print character to the screen in either 32/64 col mode
;
; We will corrupt any register
;
; Scrolling is now achieved by calling ROM3 routine 3582
;
; We print over 24 lines at 64 columns
;
; djm 3/3/2000
;
;
; $Id: fputc_cons.asm,v 1.9 2012/08/01 21:13:29 dom Exp $
;
XLIB fputc_cons
XREF call_rom3
;
; Entry: a= char to print
;
.fputc_cons
ld hl,2
add hl,sp
ld a,(hl)
ex af,af'
ld a,(flags)
and a
jp z,putit_out1 ;no parameters pending
; Set up so dump into params so first param is at highest posn
ld l,a
ld h,0
ld de,params-1
add hl,de
dec a
ld (flags),a
ex af,af'
ld (hl),a
ex af,af'
and a
ret nz
ld hl,(flagrout)
jp (hl)
.putit_out1
ex af,af'
bit 7,a
jr z,putit_out2
; deal with UDGs here
sub 128
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
.udgaddr ld de,65368
add hl,de
jp print32_entry
.putit_out2
cp 32
.print1
jp nc,print64
; Control characters
and 31
add a,a ;x2
ld l,a
ld h,0
ld de,code_table
add hl,de
ld e,(hl)
inc hl
ld d,(hl)
ld hl,(chrloc) ;most of them will need the position
push de
ret
;Normal print routine...
;Exit with carry set if OK..
.print64
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
ld de,font-256
add hl,de
exx
;Get screen address in hl from
;64 column position in bc
ld bc,(chrloc)
srl c
ex af,af'
ld a,b
and 248
add a,64
ld h,a
ld a,b
and 7
rrca
rrca
rrca
add a,c
ld l,a
ex af,af'
ld a,240
jr c,gotpos
ld a,15
.gotpos ld c,a
exx
cpl
ld c,a
;c=char mask, hl=char addr
;c'=scr mask, hl'=scr addr
ld b,8
.char1 ld a,(hl)
.invers1 defb 0
and c
inc hl
exx ; screen
ld b,a
ld a,(hl)
and c
or b
ld (hl),a
inc h
exx
djnz char1
exx
ld a,h
dec a
rrca
rrca
rrca
and 3
or 88
ld h,a
ld a,(attr)
ld (hl),a
.cbak ld hl,(chrloc)
inc l
.posncheck
bit 6,l
jr z,char4
.cbak1 ld l,0
inc h
ld a,h
cp 24
jr nz,char4
call scrollup
ld hl,23*256
.char4 ld (chrloc),hl
ret
; 32 column print routine..quick 'n' dirty..we take
; x posn and divide by two to get our real position
.print32
sub 32 ;subtract 32 to get space = 0
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
.fontaddr
ld bc,15616
add hl,bc
.print32_entry
ld bc,(chrloc)
srl c
ex af,af'
ld a,b
and 248
add a,64
ld d,a
ld a,b
and 7
rrca
rrca
rrca
add a,c
ld e,a
; Screen posn in de, now get font
ex af,af
ld b,8
.loop32
ld a,(hl)
.invers2 defb 0
ld (de),a
inc d ;down screen row
inc hl
djnz loop32
ld a,d
dec a
rrca
rrca
rrca
and 3
or 88
ld d,a
ld a,(attr)
ld (de),a
ld hl,(chrloc)
inc l
inc l
jp posncheck
; Ooops..ain't written this yet!
; We should scroll the screen up one character here
; Blanking the bottom row..
.scrollup
call call_rom3
defw 3582
ret
; This nastily inefficient table is the code table for the routines
; Done this way for future! Expansion
.code_table
defw noop ; 0 - NUL
defw switch ; 1 - SOH
defw setfont32 ; 2
defw setudg ; 3
defw noop ; 4
defw noop ; 5
defw noop ; 6
defw noop ; 7 - BEL
defw left ; 8 - BS
defw right ; 9 - HT
defw down ;10 - LF
defw up ;11 - UP
defw cls ;12 = FF (and HOME)
defw cr ;13 - CR (+NL)
defw noop ;14
defw noop ;15
defw setink ;16 - ink
defw setpaper ;17 - paper
defw setflash ;18 - flash
defw setbright ;19 - bright
defw setinverse ;20 - inverse
defw noop ;21 - over
defw setposn ;22
defw noop ;23
defw noop ;24
defw noop ;25
defw noop ;26
defw noop ;27
defw noop ;28
defw noop ;29
defw noop ;30
defw noop ;31
; And now the magic routines
; No operation
.noop
ret
; Move print position left
.left
ld a,l
and a
jr nz,doleft
ld l,63
jr up
.doleft
dec l
.left2 nop
ld (chrloc),hl
ret
;Move print position right
.right
ld a,l
cp 63
ret z
inc l
.right2 nop
ld (chrloc),hl
ret
;Move print position up
.up
ld a,h
and a
ret z
dec h
ld (chrloc),hl
ret
;Move print position down
.down
ld a,h
cp 23
ret z
inc h
ld (chrloc),hl
ret
; Clear screen and move to home
.cls
ld hl,16384
ld de,16385
ld bc,6144
ld (hl),l
ldir
ld a,(attr)
ld (hl),a
ld bc,767
ldir
ld hl,0
ld (chrloc),hl
ret
;Move to new line
.cr
ld a,h
cp 23
jr nz,cr_1
call scrollup
ld h,22
.cr_1
inc h
ld l,0
ld (chrloc),hl
ret
; Set attributes etc
.doinverse
ld a,(params)
ld b,47 ;cpl
rrca
jr c,doinverse1
ld b,0 ;nop
.doinverse1
ld a,b
ld (invers1),a
ld (invers2),a
ret
.dobright
ld hl,attr
ld a,(params)
rrca
jr c,dobright1
res 6,(hl)
ret
.dobright1
set 6,(hl)
ret
.doflash
ld hl,attr
ld a,(params)
rrca
jr c,doflash1
res 7,(hl)
ret
.doflash1
set 7,(hl)
ret
.dopaper
ld hl,attr
ld a,(hl)
and @11000111
ld c,a
ld a,(params)
rlca
rlca
rlca
and @00111000
or c
ld (hl),a
ret
.doink
ld hl,attr
ld a,(hl)
and @11111000
ld c,a
ld a,(params)
and 7 ;doesn't matter what chars were used..
or c
ld (hl),a
ret
.dofont ld hl,(params)
ld (fontaddr+1),hl
ret
.doudg ld hl,(params)
ld (udgaddr+1),hl
ret
.setfont32
ld hl,dofont
ld a,2
jr setparams
.setudg
ld hl,doudg
ld a,2
jr setparams
.setinverse
ld hl,doinverse
jr setink1
.setbright
ld hl,dobright
jr setink1
.setflash
ld hl,doflash
jr setink1
.setpaper
ld hl,dopaper
jr setink1
.setink ld hl,doink
.setink1
ld a,1 ;number to expect
.setparams
ld (flags),a
ld (flagrout),hl
ret
; Set xy position
; Code 22,y,x (as per ZX)
.setposn
ld a,2 ;number to expect
ld hl,doposn
jr setparams
; Setting the position
; We only care
.doposn
ld hl,(params)
ld de,$2020
and a
sbc hl,de
ld a,(left2)
and a ; are we in 32 columns mode ?
jr z,nomult ; if not, do not double
rl l
.nomult
ld a,h ;y position
cp 24
ret nc
bit 6,l ;is x > 64
ret nz
ld (chrloc),hl
ret
; Switch between 64 & 32 column text
.switch
ld a,1
ld (flags),a
ld hl,doswitch
ld (flagrout),hl
ret
.doswitch
xor a
ld (left2),a
ld (right2),a
ld a,(params)
ld hl,print64
ld (print1+1),hl
cp 64
ret z
ld a,$2d
ld (left2),a
dec a
ld (right2),a
ld hl,print32
ld (print1+1),hl
ret
; Variables
; Because we're on a Spectrum we can scatter statics all over the place!
.chrloc
defw 0
; Attribute to use
.attr defb 56
; Flags..used for incoming bit sequences
.flags
defb 0
; Routine to jump to when we have all the parameters
.flagrout
defw 0
; Buffer for reading in parameters - 5 should be enuff ATM?
.params
defs 5
; The font
.font
BINARY "stdio/spectrum/font64.bin"
|
//===- unittests/Basic/DiagnosticTest.cpp -- Diagnostic engine tests ------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticError.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "gtest/gtest.h"
using namespace llvm;
using namespace clang;
namespace {
// Check that DiagnosticErrorTrap works with SuppressAllDiagnostics.
TEST(DiagnosticTest, suppressAndTrap) {
DiagnosticsEngine Diags(new DiagnosticIDs(),
new DiagnosticOptions,
new IgnoringDiagConsumer());
Diags.setSuppressAllDiagnostics(true);
{
DiagnosticErrorTrap trap(Diags);
// Diag that would set UncompilableErrorOccurred and ErrorOccurred.
Diags.Report(diag::err_target_unknown_triple) << "unknown";
// Diag that would set UnrecoverableErrorOccurred and ErrorOccurred.
Diags.Report(diag::err_cannot_open_file) << "file" << "error";
// Diag that would set FatalErrorOccurred
// (via non-note following a fatal error).
Diags.Report(diag::warn_mt_message) << "warning";
EXPECT_TRUE(trap.hasErrorOccurred());
EXPECT_TRUE(trap.hasUnrecoverableErrorOccurred());
}
EXPECT_FALSE(Diags.hasErrorOccurred());
EXPECT_FALSE(Diags.hasFatalErrorOccurred());
EXPECT_FALSE(Diags.hasUncompilableErrorOccurred());
EXPECT_FALSE(Diags.hasUnrecoverableErrorOccurred());
}
// Check that FatalsAsError works as intended
TEST(DiagnosticTest, fatalsAsError) {
for (unsigned FatalsAsError = 0; FatalsAsError != 2; ++FatalsAsError) {
DiagnosticsEngine Diags(new DiagnosticIDs(),
new DiagnosticOptions,
new IgnoringDiagConsumer());
Diags.setFatalsAsError(FatalsAsError);
// Diag that would set UnrecoverableErrorOccurred and ErrorOccurred.
Diags.Report(diag::err_cannot_open_file) << "file" << "error";
// Diag that would set FatalErrorOccurred
// (via non-note following a fatal error).
Diags.Report(diag::warn_mt_message) << "warning";
EXPECT_TRUE(Diags.hasErrorOccurred());
EXPECT_EQ(Diags.hasFatalErrorOccurred(), FatalsAsError ? 0u : 1u);
EXPECT_TRUE(Diags.hasUncompilableErrorOccurred());
EXPECT_TRUE(Diags.hasUnrecoverableErrorOccurred());
// The warning should be emitted and counted only if we're not suppressing
// after fatal errors.
EXPECT_EQ(Diags.getNumWarnings(), FatalsAsError);
}
}
TEST(DiagnosticTest, diagnosticError) {
DiagnosticsEngine Diags(new DiagnosticIDs(), new DiagnosticOptions,
new IgnoringDiagConsumer());
PartialDiagnostic::StorageAllocator Alloc;
llvm::Expected<std::pair<int, int>> Value = DiagnosticError::create(
SourceLocation(), PartialDiagnostic(diag::err_cannot_open_file, Alloc)
<< "file"
<< "error");
ASSERT_TRUE(!Value);
llvm::Error Err = Value.takeError();
Optional<PartialDiagnosticAt> ErrDiag = DiagnosticError::take(Err);
llvm::cantFail(std::move(Err));
ASSERT_FALSE(!ErrDiag);
EXPECT_EQ(ErrDiag->first, SourceLocation());
EXPECT_EQ(ErrDiag->second.getDiagID(), diag::err_cannot_open_file);
Value = std::make_pair(20, 1);
ASSERT_FALSE(!Value);
EXPECT_EQ(*Value, std::make_pair(20, 1));
EXPECT_EQ(Value->first, 20);
}
}
|
#include "pi4home/defines.h"
#ifdef USE_LIGHT
#include "pi4home/light/light_traits.h"
PI4HOME_NAMESPACE_BEGIN
namespace light {
LightTraits::LightTraits() : brightness_(false), rgb_(false), rgb_white_value_(false), color_temperature_(false) {}
LightTraits::LightTraits(bool brightness, bool rgb, bool rgb_white_value, bool color_temperature)
: brightness_(brightness), rgb_(rgb), rgb_white_value_(rgb_white_value), color_temperature_(color_temperature) {}
bool LightTraits::has_brightness() const { return this->brightness_; }
bool LightTraits::has_rgb() const { return this->rgb_; }
bool LightTraits::has_rgb_white_value() const { return this->rgb_white_value_; }
bool LightTraits::has_color_temperature() const { return this->color_temperature_; }
float LightTraits::get_min_mireds() const { return this->min_mireds_; }
float LightTraits::get_max_mireds() const { return this->max_mireds_; }
void LightTraits::set_min_mireds(float min_mireds) { this->min_mireds_ = min_mireds; }
void LightTraits::set_max_mireds(float max_mireds) { this->max_mireds_ = max_mireds; }
} // namespace light
PI4HOME_NAMESPACE_END
#endif // USE_LIGHT
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GMSampleView.h"
#include "SkData.h"
GMSampleView::GMSampleView(GM* gm) : fShowSize(false), fGM(gm) {}
GMSampleView::~GMSampleView() {
delete fGM;
}
SkEvent* GMSampleView::NewShowSizeEvt(bool doShowSize) {
SkEvent* evt = new SkEvent("GMSampleView::showSize");
evt->setFast32(doShowSize);
return evt;
}
bool GMSampleView::onQuery(SkEvent* evt) {
if (SampleCode::TitleQ(*evt)) {
SkString name("GM:");
name.append(fGM->getName());
SampleCode::TitleR(evt, name.c_str());
return true;
}
SkUnichar uni;
if (SampleCode::CharQ(*evt, &uni)) {
if (fGM->handleKey(uni)) {
this->inval(nullptr);
return true;
}
}
return this->INHERITED::onQuery(evt);
}
bool GMSampleView::onEvent(const SkEvent& evt) {
if (evt.isType("GMSampleView::showSize")) {
fShowSize = SkToBool(evt.getFast32());
return true;
}
return this->INHERITED::onEvent(evt);
}
#include "SkPicture.h"
static sk_sp<SkPicture> round_trip_serialize(SkPicture* src) {
return SkPicture::MakeFromData(src->serialize().get());
}
#include "SkPictureRecorder.h"
void GMSampleView::onDrawContent(SkCanvas* canvas) {
SkPictureRecorder recorder;
SkCanvas* origCanvas = canvas;
if (false) {
SkISize size = fGM->getISize();
canvas = recorder.beginRecording(SkRect::MakeIWH(size.width(), size.height()));
}
{
SkAutoCanvasRestore acr(canvas, fShowSize);
fGM->drawContent(canvas);
}
if (origCanvas != canvas) {
sk_sp<SkPicture> pic = recorder.finishRecordingAsPicture();
if (false) {
pic = round_trip_serialize(pic.get());
}
origCanvas->drawPicture(pic);
canvas = origCanvas;
}
if (fShowSize) {
SkISize size = fGM->getISize();
SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()),
SkIntToScalar(size.height()));
SkPaint paint;
paint.setColor(0x40FF8833);
canvas->drawRect(r, paint);
}
}
void GMSampleView::onDrawBackground(SkCanvas* canvas) {
fGM->drawBackground(canvas);
}
bool GMSampleView::onAnimate(const SkAnimTimer& timer) {
return fGM->animate(timer);
}
|
// TestDlg.cpp : implementation file
//
#include "stdafx.h"
#include "WndResizerApp.h"
#include "TestDlg.h"
// CTestDlg dialog
IMPLEMENT_DYNAMIC(CTestDlg, CDialog)
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDlg::IDD, pParent)
{
}
CTestDlg::~CTestDlg()
{
}
void CTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_WM_PAINT()
END_MESSAGE_MAP()
// CTestDlg message handlers
BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
BOOL bOk = FALSE;
bOk = m_resizer.Hook(this);
ASSERT( bOk);
m_resizer.SetAutoHandlePaint(FALSE);
m_resizer.SetShowResizeGrip(TRUE);
bOk = m_resizer.InvokeOnResized();
ASSERT( bOk);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CTestDlg::OnPaint()
{
TRACE("CTestDlg::OnPaint()\n");
CPaintDC dc(this); // device context for painting
CRect rect(10, 20, 60, 60);
CBrush brush(RGB(0,0,0));
dc.FillRect(rect, &brush);
m_resizer.Draw(&dc);
}
|
; A230403: a(n) = the largest k such that (k+1)! divides n; the number of trailing zeros in the factorial base representation of n (A007623(n)).
; 0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,4,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,2,0,1,0,1,0,4,0,1,0,1,0,2,0,1,0,1
mov $9,$0
mov $11,2
lpb $11,1
clr $0,9
mov $0,$9
sub $11,1
add $0,$11
mov $2,1
lpb $0,1
add $2,1
div $0,$2
add $7,$0
lpe
mov $1,$7
mov $12,$11
lpb $12,1
mov $10,$1
sub $12,1
lpe
lpe
lpb $9,1
mov $9,0
sub $10,$1
lpe
mov $1,$10
|
Route8Gate_Script:
call EnableAutoTextBoxDrawing
ld hl, Route8Gate_ScriptPointers
ld a, [wRoute8GateCurScript]
jp CallFunctionInTable
Route8Gate_ScriptPointers:
dw Route8GateScript0
dw Route8GateScript1
Route8GateScript_1e1d7:
ld hl, wd730
set 7, [hl]
ld a, $10
ld [wSimulatedJoypadStatesEnd], a
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
xor a
ld [wSpriteStateData2 + $06], a
ld [wOverrideSimulatedJoypadStatesMask], a
ret
Route8GateScript0:
ld a, [wd728]
bit 6, a
ret nz
ld hl, CoordsData_1e22c
call ArePlayerCoordsInArray
ret nc
ld a, PLAYER_DIR_LEFT
ld [wPlayerMovingDirection], a
xor a
ld [hJoyHeld], a
callba RemoveGuardDrink
ld a, [$ffdb]
and a
jr nz, .asm_1e220
ld a, $2
ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Route8GateScript_1e1d7
ld a, $1
ld [wRoute8GateCurScript], a
ret
.asm_1e220
ld hl, wd728
set 6, [hl]
ld a, $3
ld [hSpriteIndexOrTextID], a
jp DisplayTextID
CoordsData_1e22c:
db 3,2
db 4,2
db $ff
Route8GateScript1:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
xor a
ld [wJoyIgnore], a
ld [wRoute8GateCurScript], a
ret
Route8Gate_TextPointers:
dw Route8GateText1
dw Route8GateText2
dw Route8GateText3
|
; void __CALLEE__ sp1_InsertCharStruct_callee(struct sp1_update *u, struct sp1_cs *cs)
; 01.2008 aralbrec, Sprite Pack v3.0
; ts2068 hi-res version
XLIB sp1_InsertCharStruct_callee
XDEF ASMDISP_SP1_INSERTCHARSTRUCT_CALLEE
LIB SP1AddSprChar
.sp1_InsertCharStruct_callee
pop hl
pop de
ex (sp),hl
ex de,hl
.asmentry
; hl = struct sp1_cs *
; de = struct sp1_update *
inc hl
inc hl
ld (hl),d ; store sp1_update into sp1_cs.update
inc hl
ld (hl),e
inc hl
ld a,(hl) ; a = plane
inc hl ; hl = & sp1_cs.type
bit 7,(hl) ; is it occluding type?
ex de,hl
jr z, notoccluding
inc (hl) ; increase # occluding sprites in update struct
.notoccluding
inc de
ld c,e
ld b,d ; bc = & sp1_cs.ss_draw
inc hl
inc hl
inc hl ; hl = & sp1_update.slist
jp SP1AddSprChar
DEFC ASMDISP_SP1_INSERTCHARSTRUCT_CALLEE = asmentry - sp1_InsertCharStruct_callee
|
; A157335: Expansion of 1/( (1+x)*(1-7*x+x^2) ).
; 1,6,42,287,1968,13488,92449,633654,4343130,29768255,204034656,1398474336,9585285697,65698525542,450304393098,3086432226143,21154721189904,144996616103184,993821591532385,6811754524623510,46688460080832186,320007466041201791,2193363802207580352,15033539149411860672,103041410243675444353,706256332556316249798,4840752917650538304234,33179014090997451879839,227412345719331624854640,1558707405944323922102640,10683539495890935829863841,73226069065292226886944246,501898943961154652378745882,3440066538662790339764276927,23578566826678377725971192608,161609901248085853742034071328,1107690741909922598468267306689,7592225292121372335535837075494,52037886302939683750282592221770,356672978828456413916442308476895,2444672965496255213664813567116496,16756037779645330081737252661338576,114847591492021055358495955062253537,787177102664502057427734432774436182
add $0,1
seq $0,295774 ; a(n) is the minimum size of a restricted planar additive basis for the square [0,2n]^2.
sub $0,1
seq $0,1911 ; a(n) = Fibonacci(n+3) - 2.
div $0,9
add $0,1
|
PROCESSOR 6502
; Push true onto stack
MAC ptrue ; @push
lda #$FF
IF !FPUSH
pha
ENDIF
ENDM
; Push false onto stack
MAC pfalse ; @push
lda #$00
IF !FPUSH
pha
ENDIF
ENDM
; Push immediate byte onto stack
MAC pbyte ; @push
lda #{1}
IF !FPUSH
pha
ENDIF
ENDM
; Push byte variable onto stack
MAC pbytevar ; @push
lda {1}
IF !FPUSH
pha
ENDIF
ENDM
; Push dynamic byte variable onto stack
MAC pdynbytevar ; @push
ldy #{1}
lda (RC),y
IF !FPUSH
pha
ENDIF
ENDM
; Pull byte on stack to variable
MAC plbytevar ; @pull
IF !FPULL
pla
ENDIF
sta {1}
ENDM
; Pull dynamic byte on stack to variable
MAC pldynbytevar ; @pull
IF !FPULL
pla
ENDIF
ldy #{1}
sta (RC),y
ENDM
; Push byte of an array onto stack
; (indexed by a word)
MAC pbytearray ; @pull @push
getaddr {1}
; Load and push
ldy #0
lda (R0),y
IF !FPUSH
pha
ENDIF
ENDM
; Push byte of an array onto stack
; (indexed by a byte)
MAC pbytearrayfast ; @pull @push
IF !FPULL
pla
ENDIF
tax
lda {1},x
IF !FPUSH
pha
ENDIF
ENDM
; Push byte of a dynamic array onto stack
; (indexed by a byte)
; Variable name (offset) in {1}
MAC pdynbytearrayfast ; @pull @push
getdynaddr
ldy #{1}
lda (R0),y
IF !FPUSH
pha
ENDIF
ENDM
; Pull byte off of stack and store in array
; (indexed by a word)
MAC plbytearray ; @pull
getaddr {1}
pla
ldy #0
sta (R0),y
ENDM
; Pull byte off of stack and store in array
; (indexed by a byte)
MAC plbytearrayfast ; @pull
IF !FPULL
pla
ENDIF
tax
pla
sta {1},x
ENDM
; Pull byte off of stack and store in dynamic array
; (indexed by a byte)
MAC pldynbytearrayfast ; @pull
getdynaddr
ldy #{1}
pla
sta (R0),y
ENDM
; Push relative byte variable (e.g this.something)
MAC prelativebytevar ; @push
ldy #{1}
lda (TH),y
IF !FPUSH
pha
ENDIF
ENDM
; Pull byte value and store in relative byte variable
; (e.g this.something)
MAC plrelativebytevar ; @pull
IF !FPULL
pla
ENDIF
ldy #{1}
sta (TH),y
ENDM |
;===============================================================================
; Copyright 2015-2020 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.
; Big Number Operations
;
; Content:
; cpSqrAdc_BNU_school()
;
;
%include "asmdefs.inc"
%include "ia_32e.inc"
%include "pcpbnumulschool.inc"
%include "pcpbnusqrschool.inc"
%include "pcpvariant.inc"
%if (_ADCOX_NI_ENABLING_ == _FEATURE_OFF_) || (_ADCOX_NI_ENABLING_ == _FEATURE_TICKTOCK_)
%if (_IPP32E >= _IPP32E_M7) && (_IPP32E < _IPP32E_L9)
; acc:a1 = src * mem + a1
; clobbers rax, rdx
%macro MULADD0 4.nolist
%xdefine %%acc %1
%xdefine %%a1 %2
%xdefine %%src %3
%xdefine %%mem %4
mov rax, %%mem
mul %%src
xor %%acc, %%acc
add %%a1, rax
adc %%acc, rdx
%endmacro
; acc:a1 = src * mem + a1 + acc
; clobbers rax, rdx
%macro MULADD 4.nolist
%xdefine %%acc %1
%xdefine %%a1 %2
%xdefine %%src %3
%xdefine %%mem %4
mov rax, %%mem
mul %%src
add %%a1, rax
adc rdx, 0
add %%a1, %%acc
adc rdx, 0
mov %%acc, rdx
%endmacro
; acc:a1 = src * mem + a1
; clobbers rax, rdx
%macro MULADD1 4.nolist
%xdefine %%acc %1
%xdefine %%a1 %2
%xdefine %%src %3
%xdefine %%mem %4
mov rax, %%mem
mul %%src
add %%a1, rax
adc rdx, 0
mov %%acc, rdx
%endmacro
; Macro to allow us to do an adc as an adc_0/add pair
%macro adc2 2.nolist
%xdefine %%a1 %1
%xdefine %%a2 %2
%if 1
adc %%a1, %%a2
%else
adc %%a2, 0
add %%a1, %%a2
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This version does the first half of the off-diagonal terms, then adds
; in the first half of the diagonal terms, then does the second half.
; This is to avoid the writing and reading of the off-diagonal terms to mem.
; Due to extra overhead in the arithmetic, this may or may not be faster
; than the simple version (which follows)
;
; Input in memory [pA] and also in x7...x0
; Uses all argument registers plus rax and rdx
;
%macro SQR_512 13.nolist
%xdefine %%pDst %1
%xdefine %%pA %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
;; ------------------
;; first pass 01...07
;; ------------------
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
MULADD1 %%x3, %%x2, %%A, %%x3
MULADD1 %%x4, %%x3, %%A, %%x4
MULADD1 %%x5, %%x4, %%A, %%x5
MULADD1 %%x6, %%x5, %%A, %%x6
MULADD1 %%x7, %%x6, %%A, %%x7
;; ------------------
;; second pass 12...16
;; ------------------
mov %%A, [%%pA + 8*1]
xor %%x8, %%x8
mov rax, [%%pA + 8*2]
mul %%A
add %%x2, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x3, %%A, [%%pA + 8*3]
MULADD %%t0, %%x4, %%A, [%%pA + 8*4]
MULADD %%t0, %%x5, %%A, [%%pA + 8*5]
MULADD %%t0, %%x6, %%A, [%%pA + 8*6]
add %%x7, %%t0
adc %%x8, 0
;; ------------------
;; third pass 23...25
;; ------------------
mov %%A, [%%pA + 8*2]
mov rax, [%%pA + 8*3]
mul %%A
add %%x4, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x5, %%A, [%%pA + 8*4]
MULADD %%t0, %%x6, %%A, [%%pA + 8*5]
add %%x7, %%t0
adc %%x8, 0
;; ------------------
;; fourth pass 34
;; ------------------
mov rax, [%%pA + 8*3]
mul qword [%%pA + 8*4]
add %%x6, rax
adc rdx, 0
add %%x7, rdx
adc %%x8, 0
;; --- double x0...x6
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, %%x5
adc %%x6, %%x6
adc %%A, 0
mov rax, [%%pA + 8*0]
mul rax
mov [%%pDst + 8*0], rax
mov %%t0, rdx
mov rax, [%%pA + 8*1]
mul rax
add %%x0, %%t0
adc %%x1, rax
mov [%%pDst + 8*1], %%x0
adc rdx, 0
mov [%%pDst + 8*2], %%x1
mov %%t0, rdx
mov rax, [%%pA + 8*2]
mul rax
mov %%x0, rax
mov %%x1, rdx
mov rax, [%%pA + 8*3]
mul rax
add %%x2, %%t0
adc %%x3, %%x0
mov [%%pDst + 8*3], %%x2
adc2 %%x4, %%x1
mov [%%pDst + 8*4], %%x3
adc %%x5, rax
mov [%%pDst + 8*5], %%x4
adc2 %%x6, rdx
mov [%%pDst + 8*6], %%x5
adc %%A, 0
mov [%%pDst + 8*7], %%x6
;; ------------------
;; second pass 17
;; ------------------
mov rax, [%%pA + 8*1]
xor %%x0, %%x0
mul qword [%%pA + 8*7]
add %%x7, rax
adc rdx, 0
add %%x8, rdx
adc %%x0, 0
;; ------------------
;; third pass 26...27
;; ------------------
mov %%x6, [%%pA + 8*2]
mov rax, [%%pA + 8*6]
mul %%x6
add %%x7, rax
adc rdx, 0
add %%x8, rdx
adc %%x0, 0
mov rax, [%%pA + 8*7]
xor %%x1, %%x1
mul %%x6
add %%x8, rax
adc rdx, 0
add %%x0, rdx
adc %%x1, 0
;; ------------------
;; fourth pass 35...37
;; ------------------
mov %%x6, [%%pA + 8*3]
mov rax, [%%pA + 8*5]
mul %%x6
add %%x7, rax
adc rdx, 0
add %%x8, rdx
adc %%x0, 0
adc %%x1, 0
mov rax, [%%pA + 8*6]
mul %%x6
add %%x8, rax
adc rdx, 0
add %%x0, rdx
adc %%x1, 0
mov rax, [%%pA + 8*7]
mul %%x6
add %%x0, rax
adc rdx, 0
add %%x1, rdx
;; carry out should be 0
;; ------------------
;; f%ifth pass 45...47
;; ------------------
mov %%x6, [%%pA + 8*4]
mov rax, [%%pA + 8*5]
mul %%x6
add %%x8, rax
adc rdx, 0
mov %%x2, rdx
MULADD %%x2, %%x0, %%x6, [%%pA + 8*6]
MULADD %%x2, %%x1, %%x6, [%%pA + 8*7]
;; ------------------
;; sixth pass 56...57 & seventh pass 67
;; ------------------
mov %%x6, [%%pA + 8*5]
mov rax, [%%pA + 8*6]
mul %%x6
add %%x1, rax
adc rdx, 0
mov %%x3, rdx
MULADD %%x3, %%x2, %%x6, [%%pA + 8*7]
mov rax, [%%pA + 8*6]
mul qword [%%pA + 8*7]
add %%x3, rax
adc rdx, 0
mov %%x4, rdx
;; --- double x7, x8, x0, ..., x4
xor %%x5, %%x5
add %%x7, %%x7
adc %%x8, %%x8
adc %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, 0
mov rax, [%%pA + 8*4]
mul rax
add rax, %%A
adc rdx, 0
add rax, %%x7
adc rdx, 0
mov [%%pDst + 8*8], rax
mov %%A, rdx
mov rax, [%%pA + 8*5]
mul rax
add %%x8, %%A
adc %%x0, rax
mov [%%pDst + 8*9], %%x8
adc rdx, 0
mov [%%pDst + 8*10], %%x0
mov %%A, rdx
mov rax, [%%pA + 8*6]
mul rax
mov %%x7, rax
mov %%x8, rdx
mov rax, [%%pA + 8*7]
mul rax
add %%x1, %%A
adc %%x2, %%x7
mov [%%pDst + 8*11], %%x1
adc2 %%x3, %%x8
mov [%%pDst + 8*12], %%x2
adc %%x4, rax
mov [%%pDst + 8*13], %%x3
adc2 %%x5, rdx
mov [%%pDst + 8*14], %%x4
mov [%%pDst + 8*15], %%x5
%endmacro
%macro SQR_448 13.nolist
%xdefine %%rDst %1
%xdefine %%rSrc %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
;; ------------------
;; first pass 01...06
;; ------------------
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
MULADD1 %%x3, %%x2, %%A, %%x3
MULADD1 %%x4, %%x3, %%A, %%x4
MULADD1 %%x5, %%x4, %%A, %%x5
MULADD1 %%x6, %%x5, %%A, %%x6
;; ------------------
;; second pass 12...16
;; ------------------
mov %%A, [%%rSrc + sizeof(qword)*1]
mov rax, [%%rSrc+ sizeof(qword)*2]
mul %%A
add %%x2, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x3, %%A, [%%rSrc + sizeof(qword)*3]
MULADD %%t0, %%x4, %%A, [%%rSrc + sizeof(qword)*4]
MULADD %%t0, %%x5, %%A, [%%rSrc + sizeof(qword)*5]
MULADD %%t0, %%x6, %%A, [%%rSrc + sizeof(qword)*6]
mov %%x7, %%t0
;; ------------------
;; third pass 23...25
;; ------------------
mov %%A, [%%rSrc + sizeof(qword)*2]
xor %%x8, %%x8
mov rax, [%%rSrc + sizeof(qword)*3]
mul %%A
add %%x4, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x5, %%A, [%%rSrc+ sizeof(qword)*4]
MULADD %%t0, %%x6, %%A, [%%rSrc+ sizeof(qword)*5]
add %%x7, %%t0
adc %%x8, 0
;; ------------------
;; fourth pass 34
;; ------------------
mov rax, [%%rSrc + sizeof(qword)*3]
mul qword [%%rSrc + sizeof(qword)*4]
add %%x6, rax
adc rdx, 0
add %%x7, rdx
adc %%x8, 0
mov rax, [%%rSrc + sizeof(qword)*0]
;; --- double x0...x6
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, %%x5
adc %%x6, %%x6
adc %%A, 0
mul rax ; a[0]^2
mov [%%rDst + sizeof(qword)*0], rax
mov rax, [%%rSrc + sizeof(qword)*1]
mov %%t0, rdx
mul rax ; a[1]^2
add %%x0, %%t0
adc %%x1, rax
mov rax, [%%rSrc + sizeof(qword)*2]
mov [%%rDst + sizeof(qword)*1], %%x0
adc rdx, 0
mov [%%rDst + sizeof(qword)*2], %%x1
mov %%t0, rdx
mul rax ; a[2]^2
add %%x2, %%t0
adc %%x3, rax
mov rax, [%%rSrc + sizeof(qword)*3]
mov [%%rDst + sizeof(qword)*3], %%x2
adc rdx, 0
mov [%%rDst + sizeof(qword)*4], %%x3
mov %%t0, rdx
mul rax ; a[3]^2
add %%x4, %%t0
adc %%x5, rax
mov [%%rDst + sizeof(qword)*5], %%x4
adc %%x6, rdx
mov [%%rDst + sizeof(qword)*6], %%x5
adc %%A, 0
mov [%%rDst + sizeof(qword)*7], %%x6
;; ------------------
;; third pass complete 26
;; ------------------
mov rax, [%%rSrc + sizeof(qword)*2]
xor %%x0, %%x0
mul qword [%%rSrc + sizeof(qword)*6]
add %%x7, rax
adc rdx, 0
add %%x8, rdx
adc %%x0, 0
;; ------------------
;; forth pass complete 35...36
;; ------------------
mov %%x6, [%%rSrc + sizeof(qword)*3]
mov rax, [%%rSrc+ sizeof(qword)*5]
mul %%x6
add %%x7, rax
mov rax, [%%rSrc + sizeof(qword)*6]
adc %%x8, rdx
adc %%x0, 0
mul %%x6
add %%x8, rax
adc %%x0, rdx
;; ------------------
;; f%ifth pass 45...46
;; ------------------
mov %%x6, [%%rSrc + sizeof(qword)*4]
xor %%x1, %%x1
mov rax, [%%rSrc + sizeof(qword)*5]
mul %%x6
add %%x8, rax
mov rax, [%%rSrc + sizeof(qword)*6]
adc %%x0, rdx
adc %%x1, 0
mul %%x6
add %%x0, rax
adc %%x1, rdx
;; ------------------
;; six pass 56
;; ------------------
mov %%x6, [%%rSrc + sizeof(qword)*5]
xor %%x2, %%x2
mov rax, [%%rSrc + sizeof(qword)*6]
mul %%x6
add %%x1, rax
adc %%x2, rdx
mov rax, [%%rSrc + sizeof(qword)*4]
;; --- double x7, x8, x0, x1, x2
xor %%x3, %%x3
add %%x7, %%x7
adc %%x8, %%x8
adc %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, 0
mul rax ; a[4]^2
add %%x7, %%A
adc rdx, 0
xor %%A, %%A
add %%x7, rax
mov rax, [%%rSrc + sizeof(qword)*5]
adc %%x8, rdx
mov [%%rDst+ sizeof(qword)*8], %%x7
adc %%A, 0
mov [%%rDst + sizeof(qword)*9], %%x8
mul rax ; a[5]^2
add %%x0, %%A
adc rdx, 0
xor %%A, %%A
add %%x0, rax
mov rax, [%%rSrc + sizeof(qword)*6]
adc %%x1, rdx
mov [%%rDst + sizeof(qword)*10], %%x0
adc %%A, 0
mov [%%rDst + sizeof(qword)*11], %%x1
mul rax ; a[6]^2
add %%x2, %%A
adc rdx, 0
add %%x2, rax
adc rdx, %%x3
mov [%%rDst + sizeof(qword)*12], %%x2
mov [%%rDst + sizeof(qword)*13], rdx
%endmacro
%macro SQR_384 13.nolist
%xdefine %%rDst %1
%xdefine %%rSrc %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
MULADD1 %%x3, %%x2, %%A, %%x3
MULADD1 %%x4, %%x3, %%A, %%x4
MULADD1 %%x5, %%x4, %%A, %%x5
mov %%A, qword [%%rSrc+ sizeof(qword)*1]
mov rax, qword [%%rSrc+ sizeof(qword)*2]
mul %%A
add %%x2, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x3, %%A, [%%rSrc + sizeof(qword)*3]
MULADD %%t0, %%x4, %%A, [%%rSrc + sizeof(qword)*4]
MULADD %%t0, %%x5, %%A, [%%rSrc + sizeof(qword)*5]
mov %%x6, %%t0
mov %%A, qword [%%rSrc+ sizeof(qword)*2]
mov rax, qword [%%rSrc+ sizeof(qword)*3]
mul %%A
add %%x4, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x5, %%A, [%%rSrc + sizeof(qword)*4]
MULADD %%t0, %%x6, %%A, [%%rSrc + sizeof(qword)*5]
mov %%x7, %%t0
mov %%A, qword [%%rSrc+ sizeof(qword)*3]
mov rax, qword [%%rSrc+ sizeof(qword)*4]
mul %%A
xor %%x8, %%x8
add %%x6, rax
mov rax, qword [%%rSrc+ sizeof(qword)*5]
adc %%x7, rdx
adc %%x8, 0
mul %%A
mov %%A, qword [%%rSrc+ sizeof(qword)*4]
add %%x7, rax
mov rax, qword [%%rSrc+ sizeof(qword)*5]
adc %%x8, rdx
mul %%A
xor %%t0, %%t0
add %%x8, rax
adc %%t0, rdx
mov rax, [%%rSrc + sizeof(qword)*0]
;; --- double x0...x7,x8,t0
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, %%x5
adc %%x6, %%x6
adc %%x7, %%x7
adc %%x8, %%x8
adc %%t0, %%t0
adc %%A, 0
mov qword [rsp], %%A
mul rax
mov [%%rDst + sizeof(qword)*0], rax
mov rax, [%%rSrc + sizeof(qword)*1] ; a[1]
mov %%A, rdx
mul rax
add %%x0, %%A
adc %%x1, rax
mov rax, [%%rSrc + sizeof(qword)*2] ; a[2]
mov [%%rDst + sizeof(qword)*1], %%x0
adc rdx, 0
mov [%%rDst + sizeof(qword)*2], %%x1
mov %%A, rdx
mul rax
add %%x2, %%A
adc %%x3, rax
mov rax, [%%rSrc + sizeof(qword)*3] ; a[3]
mov [%%rDst + sizeof(qword)*3], %%x2
adc rdx, 0
mov [%%rDst + sizeof(qword)*4], %%x3
mov %%A, rdx
mul rax
add %%x4, %%A
adc %%x5, rax
mov rax, [%%rSrc + sizeof(qword)*4] ; a[4]
mov [%%rDst + sizeof(qword)*5], %%x4
adc rdx, 0
mov [%%rDst + sizeof(qword)*6], %%x5
mov %%A, rdx
mul rax
add %%x6, %%A
adc %%x7, rax
mov rax, [%%rSrc + sizeof(qword)*5] ; a[5]
mov [%%rDst + sizeof(qword)*7], %%x6
adc rdx, 0
mov [%%rDst + sizeof(qword)*8], %%x7
mov %%A, rdx
mul rax
add %%x8, %%A
adc %%t0, rax
mov [%%rDst + sizeof(qword)*9], %%x8
adc rdx, qword [rsp]
mov [%%rDst + sizeof(qword)*10], %%t0
mov [%%rDst + sizeof(qword)*11], rdx
%endmacro
%macro SQR_320 13.nolist
%xdefine %%rDst %1
%xdefine %%rSrc %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
MULADD1 %%x3, %%x2, %%A, %%x3
MULADD1 %%x4, %%x3, %%A, %%x4
mov %%A, qword [%%rSrc+ sizeof(qword)*1]
mov rax, qword [%%rSrc+ sizeof(qword)*2]
mul %%A
add %%x2, rax
adc rdx, 0
mov %%t0, rdx
MULADD %%t0, %%x3, %%A, [%%rSrc + sizeof(qword)*3]
MULADD %%t0, %%x4, %%A, [%%rSrc + sizeof(qword)*4]
mov %%x5, %%t0
mov %%A, qword [%%rSrc+ sizeof(qword)*2]
mov rax, qword [%%rSrc+ sizeof(qword)*3]
mul %%A
xor %%x6, %%x6
add %%x4, rax
mov rax, qword [%%rSrc+ sizeof(qword)*4]
adc %%x5, rdx
adc %%x6, 0
mul %%A
mov %%A, qword [%%rSrc+ sizeof(qword)*3]
add %%x5, rax
mov rax, qword [%%rSrc+ sizeof(qword)*4]
adc %%x6, rdx
mul %%A
xor %%x7, %%x7
add %%x6, rax
adc %%x7, rdx
mov rax, [%%rSrc + sizeof(qword)*0]
;; --- double x0...x5
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, %%x5
adc %%x6, %%x6
adc %%x7, %%x7
adc %%A, 0
mul rax
mov [%%rDst + sizeof(qword)*0], rax
mov rax, [%%rSrc + sizeof(qword)*1]
mov %%t0, rdx
mul rax
add %%x0, %%t0
adc %%x1, rax
mov rax, [%%rSrc + sizeof(qword)*2]
mov [%%rDst + sizeof(qword)*1], %%x0
adc rdx, 0
mov [%%rDst + sizeof(qword)*2], %%x1
mov %%t0, rdx
mul rax
add %%x2, %%t0
adc %%x3, rax
mov rax, [%%rSrc + sizeof(qword)*3]
mov [%%rDst + sizeof(qword)*3], %%x2
adc rdx, 0
mov [%%rDst + sizeof(qword)*4], %%x3
mov %%t0, rdx
mul rax
add %%x4, %%t0
adc %%x5, rax
mov rax, [%%rSrc + sizeof(qword)*4]
mov [%%rDst + sizeof(qword)*5], %%x4
adc rdx, 0
mov [%%rDst + sizeof(qword)*6], %%x5
mov %%t0, rdx
mul rax
add %%x6, %%t0
adc %%x7, rax
mov [%%rDst + sizeof(qword)*7], %%x6
adc rdx, 0
mov [%%rDst + sizeof(qword)*8], %%x7
add rdx, %%A
mov [%%rDst + sizeof(qword)*9], rdx
%endmacro
%macro SQR_256 13.nolist
%xdefine %%rDst %1
%xdefine %%rSrc %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
;; ------------------
;; first pass 01...03
;; ------------------
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
MULADD1 %%x3, %%x2, %%A, %%x3
;; ------------------
;; second pass 12, 13
;; ------------------
mov %%A, qword [%%rSrc+ sizeof(qword)*1]
mov rax, qword [%%rSrc+ sizeof(qword)*2]
mul %%A
xor %%x4, %%x4
add %%x2, rax
mov rax, qword [%%rSrc+ sizeof(qword)*3]
adc %%x3, rdx
adc %%x4, 0
mul %%A
mov %%A, qword [%%rSrc+ sizeof(qword)*2]
add %%x3, rax
mov rax, qword [%%rSrc+ sizeof(qword)*3]
adc %%x4, rdx
;; ------------------
;; third pass 23
;; ------------------
mul %%A
xor %%x5, %%x5
add %%x4, rax
adc %%x5, rdx
mov rax, [%%rSrc + sizeof(qword)*0]
;; --- double x0...x5
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%x4, %%x4
adc %%x5, %%x5
adc %%A, 0
mul rax
mov [%%rDst + sizeof(qword)*0], rax
mov rax, [%%rSrc + sizeof(qword)*1]
mov %%t0, rdx
mul rax
add %%x0, %%t0
adc %%x1, rax
mov rax, [%%rSrc + sizeof(qword)*2]
mov [%%rDst + sizeof(qword)*1], %%x0
adc rdx, 0
mov [%%rDst + sizeof(qword)*2], %%x1
mov %%t0, rdx
mul rax
add %%x2, %%t0
adc %%x3, rax
mov rax, [%%rSrc + sizeof(qword)*3]
mov [%%rDst + sizeof(qword)*3], %%x2
adc rdx, 0
mov [%%rDst + sizeof(qword)*4], %%x3
mov %%t0, rdx
mul rax
add %%x4, %%t0
adc %%x5, rax
mov [%%rDst + sizeof(qword)*5], %%x4
adc rdx, 0
mov [%%rDst + sizeof(qword)*6], %%x5
add rdx, %%A
mov [%%rDst + sizeof(qword)*7], rdx
%endmacro
%macro SQR_192 13.nolist
%xdefine %%rDst %1
%xdefine %%rSrc %2
%xdefine %%x7 %3
%xdefine %%x6 %4
%xdefine %%x5 %5
%xdefine %%x4 %6
%xdefine %%x3 %7
%xdefine %%x2 %8
%xdefine %%x1 %9
%xdefine %%x0 %10
%xdefine %%A %11
%xdefine %%x8 %12
%xdefine %%t0 %13
mov %%A, %%x0
mov rax, %%x1
mul %%A
mov %%x0, rax
mov %%x1, rdx
MULADD1 %%x2, %%x1, %%A, %%x2
mov rax, qword [%%rSrc+ sizeof(qword)*1]
mul qword [%%rSrc+ sizeof(qword)*2]
xor %%x3, %%x3
add %%x2, rax
adc %%x3, rdx
xor %%A, %%A
add %%x0, %%x0
adc %%x1, %%x1
adc %%x2, %%x2
adc %%x3, %%x3
adc %%A, %%A
mov rax, qword [%%rSrc+ sizeof(qword)*0]
mul rax
mov %%x4, rax
mov %%x5, rdx
mov rax, qword [%%rSrc+ sizeof(qword)*1]
mul rax
mov %%x6, rax
mov %%x7, rdx
mov rax, qword [%%rSrc+ sizeof(qword)*2]
mul rax
mov qword [%%rDst+sizeof(qword)*0], %%x4
add %%x5, %%x0
mov qword [%%rDst+sizeof(qword)*1], %%x5
adc %%x6, %%x1
mov qword [%%rDst+sizeof(qword)*2], %%x6
adc %%x7, %%x2
mov qword [%%rDst+sizeof(qword)*3], %%x7
adc rax, %%x3
mov qword [%%rDst+sizeof(qword)*4], rax
adc rdx, %%A
mov qword [%%rDst+sizeof(qword)*5], rdx
%endmacro
segment .text align=IPP_ALIGN_FACTOR
;*************************************************************
;* Ipp64u cpSqrAdc_BNU_school(Ipp64u* pR;
;* const Ipp64u* pA, int aSize)
;* returns pR[aSize+aSize-1]
;*
;*************************************************************
align IPP_ALIGN_FACTOR
IPPASM cpSqrAdc_BNU_school,PUBLIC
%assign LOCAL_FRAME (3*sizeof(qword))
USES_GPR rbx,rbp,rsi,rdi,r12,r13,r14,r15
USES_XMM
COMP_ABI 3
;;
;; assignment
%xdefine rDst rdi
%xdefine rSrc rsi
%xdefine srcL rdx
%xdefine A rcx
%xdefine x0 r8
%xdefine x1 r9
%xdefine x2 r10
%xdefine x3 r11
%xdefine x4 r12
%xdefine x5 r13
%xdefine x6 r14
%xdefine x7 r15
%xdefine x8 rbx
%xdefine t0 rbp
cmp edx, 4
jg .more_then_4
cmp edx, 3
jg .SQR4
je .SQR3
jp .SQR2
align IPP_ALIGN_FACTOR
.SQR1: ;; len=1
mov rax, qword [rsi] ; eax = a
mul rax ; eax = rL edx = rH
mov qword [rdi], rax ;
mov rax, rdx ;
mov qword [rdi+8], rdx ;
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR2: ;; len=2
mov rax, qword [rsi] ; a[0]
mul qword [rsi+sizeof(qword)*1] ; a[0]*a[1]
xor A, A
mov x2, rax
mov x3, rdx
mov rax, qword [rsi] ; a[0]
mul rax ; (x1:x0) = a[1]^2
add x2, x2 ; (A:x3:x2) = 2*a[0]*a[1]
adc x3, x3
adc A, 0
mov x0, rax
mov x1, rdx
mov rax, qword [rsi+sizeof(qword)*1]; a[1]
mul rax ; (rdx:rax) = a[1]^2
mov qword [rdi+sizeof(qword)*0], x0
add x1, x2
mov qword [rdi+sizeof(qword)*1], x1
adc rax, x3
mov qword [rdi+sizeof(qword)*2], rax
adc rdx, A
mov qword [rdi+sizeof(qword)*3], rdx
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR3: ;; len=3
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
SQR_192 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR4: ;; len=4
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
mov x3, [rSrc+ sizeof(qword)*3]
SQR_256 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.more_then_4:
cmp edx, 8
jg .general_case
cmp edx, 7
jg .SQR8
je .SQR7
jp .SQR6
align IPP_ALIGN_FACTOR
.SQR5: ;; len=5
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
mov x3, [rSrc+ sizeof(qword)*3]
mov x4, [rSrc+ sizeof(qword)*4]
SQR_320 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR6: ;; len=6
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
mov x3, [rSrc+ sizeof(qword)*3]
mov x4, [rSrc+ sizeof(qword)*4]
mov x5, [rSrc+ sizeof(qword)*5]
SQR_384 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR7: ;; len=7
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
mov x3, [rSrc+ sizeof(qword)*3]
mov x4, [rSrc+ sizeof(qword)*4]
mov x5, [rSrc+ sizeof(qword)*5]
mov x6, [rSrc+ sizeof(qword)*6]
SQR_448 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
align IPP_ALIGN_FACTOR
.SQR8: ;; len=8
mov x0, [rSrc+ sizeof(qword)*0]
mov x1, [rSrc+ sizeof(qword)*1]
mov x2, [rSrc+ sizeof(qword)*2]
mov x3, [rSrc+ sizeof(qword)*3]
mov x4, [rSrc+ sizeof(qword)*4]
mov x5, [rSrc+ sizeof(qword)*5]
mov x6, [rSrc+ sizeof(qword)*6]
mov x7, [rSrc+ sizeof(qword)*7]
SQR_512 rDst, rSrc, x7, x6, x5, x4, x3, x2, x1, x0, A, x8, t0
mov rax, rdx
REST_XMM
REST_GPR
ret
;********** lenSrcA > 8 **************************************
align IPP_ALIGN_FACTOR
.general_case:
;;
;; stack structure:
%assign pDst 0
%assign pSrc pDst+sizeof(qword)
%assign len pSrc+sizeof(qword)
;;
;; assignment
%xdefine B0 r10 ; a[i], a[i+1]
%xdefine B1 r11
%xdefine T0 r12 ; temporary
%xdefine T1 r13
%xdefine T2 r14
%xdefine T3 r15
%xdefine idx rcx ; indexs
%xdefine idxt rbx
%xdefine rSrc rsi
%xdefine rDst rdi
movsxd rdx, edx ; expand length
mov [rsp+pDst], rdi ; save parameters
mov [rsp+pSrc], rsi
mov [rsp+len], rdx
mov r8, rdx
mov rax, dword 2
mov rbx, dword 1
test r8, 1
cmove rax, rbx ; delta = len&1? 2:1
sub rdx, rax ; len -= delta
lea rsi, [rsi+rax*sizeof(qword)] ; A' = A+delta
lea rdi, [rdi+rax*sizeof(qword)] ; R' = R+delta
lea rsi, [rsi+rdx*sizeof(qword)-4*sizeof(qword)] ; rsi = &A'[len-4]
lea rdi, [rdi+rdx*sizeof(qword)-4*sizeof(qword)] ; rdi = &R'[len-4]
mov idx, dword 4 ; init
sub idx, rdx ; negative index
test r8, 1
jnz .init_odd_len_operation
;********** odd number of passes (multiply only) *********************
.init_even_len_operation:
mov B0, qword [rsi+idx*sizeof(qword)-sizeof(qword)] ; B0 = a[0]
mov rax, qword [rsi+idx*sizeof(qword)] ; a[1]
xor T0, T0
cmp idx, 0
jge .skip_mul1
mov idxt, idx
MULx1 rdi, rsi, idxt, B0, T0, T1, T2, T3
.skip_mul1:
cmp idxt, 1
jne .fin_mulx1_3 ; idx=3 (effective len=4n+1)
; .fin_mulx1_1 ; idx=1 (effective len=4n+3)
.fin_mulx1_1:
sMULx1_4N_3_ELOG rdi, rsi, {add idx,2}, B0, T0,T1,T2,T3
jmp .odd_pass_pairs
.fin_mulx1_3:
sMULx1_4N_1_ELOG rdi, rsi, {add idx,2}, B0, T0,T1,T2,T3
jmp .even_pass_pairs
;********** even number of passes (multiply only) *********************
.init_odd_len_operation:
mov B0, qword [rsi+idx*sizeof(qword)-2*sizeof(qword)] ; a[0] and a[1]
mov B1, qword [rsi+idx*sizeof(qword)-sizeof(qword)]
mov rax, B1 ; a[0]*a[1]
mul B0
mov qword [rdi+idx*sizeof(qword)-sizeof(qword)], rax
mov rax, qword [rsi+idx*sizeof(qword)] ; a[2]
mov T0, rdx
mul B0 ; a[0]*a[2]
xor T1, T1
xor T2, T2
add T0, rax
mov rax, qword [rsi+idx*sizeof(qword)] ; a[2]
adc T1, rdx
cmp idx, 0
jge .skip_mul_nx2
mov idxt, idx
MULx2 rdi, rsi, idxt, B0,B1, T0,T1,T2,T3
.skip_mul_nx2:
cmp idxt, 1
jnz .fin_mul2x_3 ; idx=3 (effective len=4n+3)
; .fin_mul2x_1 ; idx=1 (effective len=4n+1)
.fin_mul2x_1:
sMULx2_4N_3_ELOG rdi, rsi, {add idx,2}, B0,B1, T0,T1,T2,T3
add rdi, 2*sizeof(qword)
jmp .odd_pass_pairs
.fin_mul2x_3:
sMULx2_4N_1_ELOG rdi, rsi, {add idx,2}, B0,B1, T0,T1,T2,T3
add rdi, 2*sizeof(qword)
align IPP_ALIGN_FACTOR
.even_pass_pairs:
sMLAx2_PLOG {rdi+idx*sizeof(qword)}, {rsi+idx*sizeof(qword)}, B0,B1, T0,T1,T2,T3
cmp idx, 0
jge .skip1
mov idxt, idx
MLAx2 rdi, rsi, idxt, B0,B1, T0,T1,T2,T3
.skip1:
sMLAx2_4N_3_ELOG rdi, rsi, {add idx,2}, B0,B1, T0,T1,T2,T3
add rdi, 2*sizeof(qword)
.odd_pass_pairs:
sMLAx2_PLOG {rdi+idx*sizeof(qword)}, {rsi+idx*sizeof(qword)}, B0,B1, T0,T1,T2,T3
cmp idx, 0
jge .skip2
mov idxt, idx
MLAx2 rdi, rsi, idxt, B0,B1, T0,T1,T2,T3
.skip2:
sMLAx2_4N_1_ELOG rdi, rsi, {add idx,2}, B0,B1, T0,T1,T2,T3
add rdi, 2*sizeof(qword)
cmp idx, 4
jl .even_pass_pairs
.add_diag:
mov rdi, [rsp+pDst] ; restore parameters
mov rsi, [rsp+pSrc]
mov rcx, [rsp+len]
xor idxt, idxt
xor T0, T0
xor T1, T1
lea rax, [rdi+rcx*sizeof(qword)]
lea rsi, [rsi+rcx*sizeof(qword)]
mov qword [rdi], T0 ; r[0] = 0
mov qword [rax+rcx*sizeof(qword)-sizeof(qword)], T0 ; r[2*len-1] = 0
neg rcx
align IPP_ALIGN_FACTOR
.add_diag_loop:
mov rax, qword [rsi+rcx*sizeof(qword)] ; a[i]
mul rax
mov T2, qword [rdi] ; r[2*i]
mov T3, qword [rdi+sizeof(qword)] ; r[2*i+1]
add T0, 1
adc T2, T2
adc T3, T3
sbb T0, T0
add T1, 1
adc T2, rax
adc T3, rdx
sbb T1, T1
mov qword [rdi], T2
mov qword [rdi+sizeof(qword)], T3
add rdi, sizeof(qword)*2
add rcx, 1
jnz .add_diag_loop
mov rax, T3 ; r[2*len-1]
REST_XMM
REST_GPR
ret
ENDFUNC cpSqrAdc_BNU_school
%endif
%endif ;; _ADCOX_NI_ENABLING_
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x211a, %r12
nop
nop
nop
nop
nop
dec %r9
mov (%r12), %si
nop
nop
sub %r13, %r13
lea addresses_UC_ht+0x97aa, %rsi
lea addresses_WC_ht+0x1916a, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
and %rbp, %rbp
mov $64, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp $38162, %rdi
lea addresses_normal_ht+0x1402, %r13
nop
nop
add $11390, %rsi
movb $0x61, (%r13)
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WT_ht+0x17aea, %rbp
nop
nop
nop
nop
and $56291, %r13
movups (%rbp), %xmm5
vpextrq $1, %xmm5, %rcx
nop
nop
nop
nop
nop
cmp $31496, %r9
lea addresses_normal_ht+0x17eba, %r9
nop
nop
nop
cmp $26666, %rbp
movb (%r9), %cl
nop
nop
nop
nop
nop
add $19319, %r13
lea addresses_WT_ht+0x47ea, %r12
nop
nop
nop
xor %rsi, %rsi
mov (%r12), %rbp
nop
nop
nop
cmp $3350, %r13
lea addresses_UC_ht+0xb46a, %rsi
lea addresses_UC_ht+0x1ab6a, %rdi
sub $7114, %r9
mov $1, %rcx
rep movsq
nop
cmp $38707, %rbp
lea addresses_WC_ht+0x1d92a, %r9
nop
nop
nop
sub %rbp, %rbp
movw $0x6162, (%r9)
nop
nop
sub %r9, %r9
lea addresses_UC_ht+0x1d742, %rbp
nop
nop
cmp $61879, %r9
mov $0x6162636465666768, %rcx
movq %rcx, (%rbp)
and $38383, %rbp
lea addresses_normal_ht+0x606a, %rsi
nop
nop
nop
cmp $59491, %rbp
mov (%rsi), %r9
nop
nop
and %rbp, %rbp
lea addresses_UC_ht+0x1b9ba, %rbp
nop
inc %r9
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %r12
nop
nop
nop
nop
xor %r9, %r9
lea addresses_D_ht+0x10d6a, %rsi
clflush (%rsi)
sub $6945, %rcx
mov (%rsi), %r12d
nop
nop
nop
nop
nop
lfence
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rcx
push %rdi
// Store
lea addresses_normal+0x1dc7e, %rdi
nop
xor %r8, %r8
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
movups %xmm0, (%rdi)
xor $62041, %r9
// Faulty Load
lea addresses_UC+0x1cd6a, %r8
nop
nop
nop
sub %rcx, %rcx
mov (%r8), %r13w
lea oracles, %rcx
and $0xff, %r13
shlq $12, %r13
mov (%rcx,%r13,1), %r13
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_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
*/
|
; Test alignment of individual data items under resize pass not making changes
IDEAL
SEGMENT MAIN
ASSUME CS:MAIN,DS:MAIN
ORG 100h
start:
int 20h
jmp _over ; guess 2 bytes, finally 3 bytes
ALIGN 4 ; guess 0 bytes, finally 3 bytes of padding
_val DW 1234h
ALIGN 16
_over: mov di, OFFSET _val
int 20h
ENDS MAIN
END start
|
; A036124: a(n) = 2^n mod 37.
; 1,2,4,8,16,32,27,17,34,31,25,13,26,15,30,23,9,18,36,35,33,29,21,5,10,20,3,6,12,24,11,22,7,14,28,19,1,2,4,8,16,32,27,17,34,31,25,13,26,15,30,23,9,18,36,35,33,29,21,5,10,20,3,6,12,24,11,22,7,14,28,19,1,2,4,8,16,32,27,17,34,31,25,13,26,15,30,23,9,18,36,35,33,29,21,5,10,20,3,6
mov $1,1
mov $2,$0
lpb $2
mul $1,2
mod $1,37
sub $2,1
lpe
mov $0,$1
|
; A080584: A run of 3*2^n 0's followed by a run of 3*2^n 1's, for n=0, 1, 2, ...
; 0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
div $0,3
lpb $0
div $0,2
sub $0,1
lpe
mov $1,$0
|
delay equ 5_000
org 0x0100 ; the 256-bytes prefix is used by DOS;
SECTION MBR align=16
; vstart and org only change shift addresses of tags
; cannot place spaces between arguments and their parameters.
initial:
mov ax, 0xb800 ; Jump instructions and other segment registers stay still.
mov gs, ax ; point es to the display memory segment
; for a .com program on DOS, no need to set cs/ds/es/ss and sp(if no stack specifed)
; cs = ds = es = ss = PSP, sp = first byte avaliable in the tail of the 64K segment
; ip = 0x0100
mov byte[char], 'A'
mov word[x], 2
mov word[y], 0
mov word[movex], 1
mov word[movey], 1
mov word[count + 4], 0
jmp showName ; print out author information
printLoop:
dec word[count]
jnz printLoop
mov word[count], delay
dec word[count + 2]
jnz printLoop
mov word[count], delay
mov word[count + 2], delay
inc word[count + 4]
mov ax, 100
sub ax, [count + 4]
jz clearScreen ; only print 100 times
mov ax, 11 ; a samller region to display
sub ax, [y] ; check boundary for all four directions.
jnz BottomNotReached
mov word[movey], -1
BottomNotReached:
mov ax, [y]
sub ax, 0
jnz CeilNotReached
mov word[movey], 1
CeilNotReached:
mov ax, 39 ; left half of the screen;
sub ax, [x]
jnz RightNotReached
mov word[movex], -1
RightNotReached:
mov ax, [x]
sub ax, 0
jnz LeftNotReached
mov word[movex], 1
LeftNotReached:
mov ax, [x]
add ax, [movex]
mov [x], ax ; compute new coordinate x
mov ax, [y]
add ax, [movey]
mov [y], ax ; compute new coordinate y
mov ax, [y]
sub ax, 0
jg checkPassed1 ; check y
mov ax, [x]
sub ax, [infoLen]
jge checkPassed1 ; check x
jmp printLoop ; Skip if area of personal information is touched
checkPassed1:
call showChar
jmp printLoop
showName:
xor di, di ; set the intial index register
printNameLoop:
mov ax, [y + 2]
imul ax, 80
add ax, [x + 2] ; set the offset to fit a smaller region
add ax, di ; set the first postion
imul ax, 2
mov bx, ax ; double the index
mov al, [AuthorInfo + di]
mov ah, 0x0c ; set the character and its RGB color
mov [gs:bx], ax ; move into display memory
inc di
cmp [infoLen], di
jnz printNameLoop
jmp printLoop
showChar:
mov ax, [y]
imul ax, 80
add ax, [x]
imul ax, 2
mov bx, ax
mov al, [char]
mov ah, 0x0F
mov [gs:bx], ax
ret ; return to the caller
clearScreen:
mov word[x], 0
mov word[y], 0
mov byte[char], ' '
printSpaceLoop:
mov ax, 12
sub ax, [y]
jnz checkPassed2
push ds
xor ax, ax
push ax
retf ; return control to DOS
checkPassed2:
call showChar
mov ax, 39
sub ax, [x]
jz nextLine
inc word[x]
jmp printSpaceLoop
nextLine:
mov word[x], 0
inc word[y]
jmp printSpaceLoop
data:
AuthorInfo db "Jing Lan, 18340085"
infoLen dw $-AuthorInfo
char db 'A'
x dw 2, 0
y dw 0, 0
movex dw 1
movey dw 1
count dw delay, delay, 0 |
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Proc
FILE: procManager.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 2/89 Initial version
DESCRIPTION:
This file assembles the Process/ module of the UserInterface.
$Id: procManager.asm,v 1.1 97/04/07 11:44:03 newdeal Exp $
------------------------------------------------------------------------------@
_Proc = 1
;-----------------------------------------------------------------------------
; Include common definitions
;-----------------------------------------------------------------------------
include uiGeode.def
include dbase.def
include Objects/gEditCC.def
include sem.def
include Internal/objInt.def
include Internal/geodeStr.def
DecodeProtocol
;-----------------------------------------------------------------------------
; Include definitions for this module
;-----------------------------------------------------------------------------
include procMacro.def
include procConstant.def
include procVariable.def
;-----------------------------------------------------------------------------
; Include code
;-----------------------------------------------------------------------------
include procClass.asm
include procUtils.asm
include procUndo.asm
end
|
; 硬盘相关常量
DISK_CMD_READ equ 0x20
DISK_LBA_MODE equ 0xe0
DISK_MASTER equ 0x00
PRI_DATA_PORT equ 0x01f0
PRI_SEC_COUNT_PORT equ 0x01f2
PRI_LBA_LOW_PORT equ 0x01f3
PRI_LBA_MID_PORT equ 0x01f4
PRI_LBA_HIGH_PORT equ 0x01f5
PRI_DEVICE_PORT equ 0x01f6
PRI_STAT_CMD_PORT equ 0x01f7
; 内核相关常量
KERNEL_ELF_FILE_BEGIN_SECTOR equ 0x64 ;100
KERNEL_ELF_FILE_SECTORS equ 0xff ;255,即硬盘
KERNEL_ELF_FILE_ADDR equ 0x00050000
; 等待硬盘不忙的宏
%macro wait_hd 0
.wait_disk :
mov edx, PRI_STAT_CMD_PORT
in al, dx
nop
nop
and al, 0x88
cmp al, 0x08
jnz .wait_disk ;不忙,且硬盘已准备好数据传输
%endmacro |
/*
* Copyright (c) 2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, 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.
*/
L0:
(W&~f0.1)jmpi L400
L16:
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0x44EB100:ud
mov (1|M0) r16.2<1>:ud 0xE000:ud
mov (1|M0) r25.2<1>:f r10.2<0;1,0>:f
mov (8|M0) r17.0<1>:ud r25.0<8;8,1>:ud
send (1|M0) r112:uw r16:ub 0x2 a0.0
mov (16|M0) r120.0<1>:uw r114.0<16;16,1>:uw
mov (16|M0) r121.0<1>:uw r115.0<16;16,1>:uw
mov (8|M0) r17.0<1>:ud r25.0<8;8,1>:ud
add (1|M0) a0.0<1>:ud r23.5<0;1,0>:ud 0x44EC101:ud
mov (1|M0) r16.2<1>:ud 0x5000:ud
mov (1|M0) r17.2<1>:f r10.2<0;1,0>:f
mov (1|M0) r17.3<1>:f r10.4<0;1,0>:f
send (1|M0) r116:uw r16:ub 0x2 a0.0
mov (1|M0) r17.2<1>:f r10.2<0;1,0>:f
mov (1|M0) r17.3<1>:f r10.7<0;1,0>:f
send (1|M0) r124:uw r16:ub 0x2 a0.0
mov (16|M0) r114.0<1>:uw 0xFFFF:uw
mov (16|M0) r115.0<1>:uw 0xFFFF:uw
mov (16|M0) r122.0<1>:uw 0xFFFF:uw
mov (16|M0) r123.0<1>:uw 0xFFFF:uw
mov (1|M0) a0.8<1>:uw 0xE00:uw
mov (1|M0) a0.9<1>:uw 0xE80:uw
mov (1|M0) a0.10<1>:uw 0xEC0:uw
add (4|M0) a0.12<1>:uw a0.8<4;4,1>:uw 0x100:uw
L400:
nop
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xea6f, %rsi
lea addresses_A_ht+0x2b6f, %rdi
nop
nop
nop
nop
nop
cmp %rax, %rax
mov $78, %rcx
rep movsw
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_WC_ht+0x121bf, %rbp
add $4626, %r11
movw $0x6162, (%rbp)
nop
nop
nop
nop
sub $14395, %rax
lea addresses_UC_ht+0x1856f, %rsi
lea addresses_normal_ht+0x1716f, %rdi
nop
nop
nop
nop
xor %rbx, %rbx
mov $110, %rcx
rep movsq
nop
nop
nop
add $44927, %r12
lea addresses_WC_ht+0x16ff7, %r12
nop
nop
and $7419, %rsi
movb (%r12), %r11b
nop
nop
and $48057, %rax
lea addresses_normal_ht+0xb36f, %rsi
lea addresses_normal_ht+0x7bff, %rdi
nop
nop
nop
nop
nop
dec %rax
mov $28, %rcx
rep movsq
nop
sub $65090, %rcx
lea addresses_A_ht+0x11b6f, %rsi
nop
nop
nop
nop
add %rbp, %rbp
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_UC_ht+0x1edff, %rsi
lea addresses_D_ht+0x1e04b, %rdi
nop
nop
and $9478, %rax
mov $107, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp $27262, %rsi
lea addresses_WC_ht+0x11915, %r12
nop
nop
add $60488, %rax
movb $0x61, (%r12)
nop
nop
and $42148, %r12
lea addresses_normal_ht+0x1b96f, %rsi
lea addresses_UC_ht+0x1336f, %rdi
nop
nop
nop
nop
nop
inc %rax
mov $123, %rcx
rep movsb
nop
nop
nop
xor $7964, %rbp
lea addresses_normal_ht+0x15167, %r11
nop
nop
nop
nop
nop
inc %rax
vmovups (%r11), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r12
nop
nop
sub %rax, %rax
lea addresses_UC_ht+0xceaf, %rsi
lea addresses_WT_ht+0x9d6f, %rdi
nop
nop
nop
dec %rax
mov $30, %rcx
rep movsw
nop
nop
nop
add %r11, %r11
lea addresses_UC_ht+0xbf6f, %rcx
clflush (%rcx)
nop
nop
cmp %rsi, %rsi
movb $0x61, (%rcx)
nop
nop
nop
nop
nop
add $48573, %rax
lea addresses_normal_ht+0x16f6f, %rax
nop
nop
nop
nop
and $36087, %r12
vmovups (%rax), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %rdi
nop
nop
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0xfc07, %rdi
nop
xor %rbp, %rbp
movl $0x61626364, (%rdi)
nop
nop
nop
nop
sub %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_WT+0xa16f, %rdx
nop
nop
nop
and $517, %r9
mov $0x5152535455565758, %rax
movq %rax, (%rdx)
dec %r8
// Store
lea addresses_WT+0xe605, %r11
nop
nop
nop
nop
add $60200, %rbp
movl $0x51525354, (%r11)
nop
nop
add $50816, %rax
// Store
lea addresses_D+0x1ffef, %rbp
nop
cmp %r9, %r9
movw $0x5152, (%rbp)
nop
cmp $63251, %r9
// Load
lea addresses_UC+0x1230f, %r8
nop
nop
nop
and $17244, %rbp
movb (%r8), %al
nop
nop
and $21281, %r9
// Store
lea addresses_A+0xd76f, %r11
nop
nop
nop
nop
nop
xor %r8, %r8
movb $0x51, (%r11)
nop
nop
nop
nop
nop
dec %r9
// Store
lea addresses_normal+0x696f, %rdx
nop
nop
nop
nop
xor $14640, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
movups %xmm1, (%rdx)
nop
cmp %r11, %r11
// Faulty Load
mov $0x2f913e000000016f, %r8
add $32523, %r9
mov (%r8), %edx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'00': 1613, '58': 58}
00 00 58 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 58 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 58 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 58 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 58 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
%ifdef CONFIG
{
"RegData": {
"RAX": "0x414243444546B848"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0x4142434445464748
mov [rdx + 8 * 0], rax
mov rax, 0x5152535455565758
mov [rdx + 8 * 1], rax
not byte [rdx + 8 * 0 + 1]
mov rax, [rdx + 8 * 0]
hlt
|
; A040418: Continued fraction for sqrt(439).
; Submitted by Jamie Morken(s1)
; 20,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19,1,40,1,19
gcd $0,262156
mul $0,42
mod $0,13
mov $1,$0
div $1,5
mul $1,15
add $0,$1
sub $0,2
|
; lzo1x_s1.asm -- lzo1x_decompress_asm
;
; This file is part of the LZO real-time data compression library.
;
; Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 2 of
; the License, or (at your option) any later version.
;
; The LZO library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with the LZO library; see the file COPYING.
; If not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;
; Markus F.X.J. Oberhumer
; <markus@oberhumer.com>
; http://www.oberhumer.com/opensource/lzo/
;
; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
include asminit.def
public _lzo1x_decompress_asm
_lzo1x_decompress_asm:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
end
|
; ===============================================================
; Dec 2013
; ===============================================================
;
; char *strncat(char * restrict s1, const char * restrict s2, size_t n)
;
; Append at most n chars from string s2 to the end of string s1,
; return s1. s1 is always terminated with a 0.
;
; The maximum length of s1 will be strlen(s1) + n + 1
;
; ===============================================================
SECTION code_clib
SECTION code_string
PUBLIC asm_strncat
PUBLIC asm0_strncat
EXTERN __str_locate_nul
asm_strncat:
; enter : hl = char *s2 = src
; de = char *s1 = dst
; bc = size_t n
;
; exit : hl = char *s1 = dst
; de = ptr in s1 to terminating 0
; carry set if all of s2 not appended
;
; uses : af, bc, de, hl
ld a,b
or c
jr z, zero_n
asm0_strncat:
push de ; save dst
ex de,hl
call __str_locate_nul ; a = 0
ex de,hl
loop: ; append src to dst
cp (hl)
jr z, done
ldi
jp pe, loop
scf
done: ; terminate dst
ld (de),a
pop hl
ret
zero_n:
ld l,e
ld h,d
scf
ret
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %rbx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1a95a, %r15
add $43535, %rsi
movl $0x61626364, (%r15)
nop
nop
nop
nop
nop
and $33991, %r15
lea addresses_WC_ht+0x1cbcf, %rdi
nop
nop
nop
nop
nop
sub %rdx, %rdx
movw $0x6162, (%rdi)
nop
nop
and %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
// Load
lea addresses_A+0xbd70, %rbp
nop
nop
add $27007, %rbx
mov (%rbp), %r8d
nop
nop
nop
nop
cmp $46319, %r15
// Store
lea addresses_normal+0xc1bc, %r8
nop
nop
dec %r15
movl $0x51525354, (%r8)
nop
cmp $22814, %r8
// Load
lea addresses_WT+0x2930, %rdi
nop
and $42752, %r10
mov (%rdi), %r15d
nop
nop
and $1493, %r8
// Faulty Load
lea addresses_US+0x930, %r10
nop
nop
dec %rcx
movb (%r10), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'00': 747}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
; A070820: Difference between n-th prime and the value of commutator[phi,gpf] = commutator[A000010, A006530] at the same prime argument.
; 2,3,3,4,6,4,3,4,12,8,6,4,6,8,24,14,30,6,12,8,4,14,42,12,4,6,18,54,4,8,8,14,18,24,38,6,14,4,84,44,90,6,20,4,8,12,8,38,114,20,30,18,6,6,3,132,68,6,24,8,48,74,18,32,14,80,12,8,174,30,12,180,62,32,8,192,98,12,6,18,20,8,44,4,74,18,8,20,24,12,234,240,4,8,84,252,128,14,30,6
seq $0,40 ; The prime numbers.
sub $0,2
seq $0,6530 ; Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.
add $0,1
|
; A106435: a(n) = 3*a(n-1) + 3*a(n-2), a(0)=0, a(1)=3.
; 0,3,9,36,135,513,1944,7371,27945,105948,401679,1522881,5773680,21889683,82990089,314639316,1192888215,4522582593,17146412424,65006985051,246460192425,934401532428,3542585174559,13430960120961,50920635886560,193054788022563,731926271727369,2774943179249796
lpb $0
sub $0,1
mov $1,$0
cal $1,238923 ; Number of (n+1) X (1+1) 0..3 arrays with no element greater than all horizontal neighbors or equal to all vertical neighbors.
mov $0,0
mul $1,2
lpe
div $1,24
mul $1,3
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xae2c, %r12
nop
and $48407, %r13
mov $0x6162636465666768, %r14
movq %r14, %xmm7
movups %xmm7, (%r12)
nop
nop
and %rdx, %rdx
lea addresses_WC_ht+0x9259, %rsi
lea addresses_WC_ht+0x922c, %rdi
nop
nop
nop
nop
nop
sub %r11, %r11
mov $15, %rcx
rep movsl
sub %r13, %r13
lea addresses_A_ht+0x13aac, %rdi
nop
nop
nop
nop
and $29124, %r13
mov (%rdi), %dx
nop
nop
nop
nop
nop
sub $44790, %rcx
lea addresses_normal_ht+0x144ec, %rsi
lea addresses_WC_ht+0x197ca, %rdi
nop
add %r13, %r13
mov $127, %rcx
rep movsb
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_WT_ht+0x1d62c, %rsi
lea addresses_normal_ht+0x1182c, %rdi
xor $21068, %r14
mov $61, %rcx
rep movsw
add %r14, %r14
lea addresses_A_ht+0x1529c, %rdi
cmp $13192, %rdx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm4
vmovups %ymm4, (%rdi)
nop
nop
nop
xor $19424, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %rbp
push %rsi
// Faulty Load
lea addresses_WC+0x3e2c, %r14
nop
nop
nop
nop
and $30679, %r10
vmovups (%r14), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %rsi
lea oracles, %r10
and $0xff, %rsi
shlq $12, %rsi
mov (%r10,%rsi,1), %rsi
pop %rsi
pop %rbp
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
// Copyright (c) 2009 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 <fcntl.h>
#include <freetype/ftoutln.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "opentype-sanitiser.h"
#include "ots-memory-stream.h"
namespace {
void DumpBitmap(const FT_Bitmap *bitmap) {
for (int i = 0; i < bitmap->rows * bitmap->width; ++i) {
if (bitmap->buffer[i] > 192) {
std::fprintf(stderr, "#");
} else if (bitmap->buffer[i] > 128) {
std::fprintf(stderr, "*");
} else if (bitmap->buffer[i] > 64) {
std::fprintf(stderr, "+");
} else if (bitmap->buffer[i] > 32) {
std::fprintf(stderr, ".");
} else {
std::fprintf(stderr, " ");
}
if ((i + 1) % bitmap->width == 0) {
std::fprintf(stderr, "\n");
}
}
}
int CompareBitmaps(const FT_Bitmap *orig, const FT_Bitmap *trans) {
int ret = 0;
if (orig->width == trans->width &&
orig->rows == trans->rows) {
for (int i = 0; i < orig->rows * orig->width; ++i) {
if (orig->buffer[i] != trans->buffer[i]) {
std::fprintf(stderr, "bitmap data doesn't match!\n");
ret = 1;
break;
}
}
} else {
std::fprintf(stderr, "bitmap metrics doesn't match! (%d, %d), (%d, %d)\n",
orig->width, orig->rows, trans->width, trans->rows);
ret = 1;
}
if (ret) {
std::fprintf(stderr, "EXPECTED:\n");
DumpBitmap(orig);
std::fprintf(stderr, "\nACTUAL:\n");
DumpBitmap(trans);
std::fprintf(stderr, "\n\n");
}
delete[] orig->buffer;
delete[] trans->buffer;
return ret;
}
int GetBitmap(FT_Library library, FT_Outline *outline, FT_Bitmap *bitmap) {
FT_BBox bbox;
FT_Outline_Get_CBox(outline, &bbox);
bbox.xMin &= ~63;
bbox.yMin &= ~63;
bbox.xMax = (bbox.xMax + 63) & ~63;
bbox.yMax = (bbox.yMax + 63) & ~63;
FT_Outline_Translate(outline, -bbox.xMin, -bbox.yMin);
const int w = (bbox.xMax - bbox.xMin) >> 6;
const int h = (bbox.yMax - bbox.yMin) >> 6;
if (w == 0 || h == 0) {
return -1; // white space
}
if (w < 0 || h < 0) {
std::fprintf(stderr, "bad width/height\n");
return 1; // error
}
uint8_t *buf = new uint8_t[w * h];
std::memset(buf, 0x0, w * h);
bitmap->width = w;
bitmap->rows = h;
bitmap->pitch = w;
bitmap->buffer = buf;
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
bitmap->num_grays = 256;
if (FT_Outline_Get_Bitmap(library, outline, bitmap)) {
std::fprintf(stderr, "can't get outline\n");
delete[] buf;
return 1; // error.
}
return 0;
}
int LoadChar(FT_Face face, bool use_bitmap, int pt, FT_ULong c) {
static const int kDpi = 72;
FT_Matrix matrix;
matrix.xx = matrix.yy = 1 << 16;
matrix.xy = matrix.yx = 0 << 16;
FT_Int32 flags = FT_LOAD_DEFAULT | FT_LOAD_TARGET_NORMAL;
if (!use_bitmap) {
// Since the transcoder drops embedded bitmaps from the transcoded one,
// we have to use FT_LOAD_NO_BITMAP flag for the original face.
flags |= FT_LOAD_NO_BITMAP;
}
FT_Error error = FT_Set_Char_Size(face, pt * (1 << 6), 0, kDpi, 0);
if (error) {
std::fprintf(stderr, "Failed to set the char size!\n");
return 1;
}
FT_Set_Transform(face, &matrix, 0);
error = FT_Load_Char(face, c, flags);
if (error) return -1; // no such glyf in the font.
if (face->glyph->format != FT_GLYPH_FORMAT_OUTLINE) {
std::fprintf(stderr, "bad format\n");
return 1;
}
return 0;
}
int LoadCharThenCompare(FT_Library library,
FT_Face orig_face, FT_Face trans_face,
int pt, FT_ULong c) {
FT_Bitmap orig_bitmap, trans_bitmap;
// Load original bitmap.
int ret = LoadChar(orig_face, false, pt, c);
if (ret) return ret; // 1: error, -1: no such glyph
FT_Outline *outline = &orig_face->glyph->outline;
ret = GetBitmap(library, outline, &orig_bitmap);
if (ret) return ret; // white space?
// Load transformed bitmap.
ret = LoadChar(trans_face, true, pt, c);
if (ret == -1) {
std::fprintf(stderr, "the glyph is not found on the transcoded font\n");
}
if (ret) return 1; // -1 should be treated as error.
outline = &trans_face->glyph->outline;
ret = GetBitmap(library, outline, &trans_bitmap);
if (ret) return ret; // white space?
return CompareBitmaps(&orig_bitmap, &trans_bitmap);
}
int SideBySide(FT_Library library, const char *file_name,
uint8_t *orig_font, size_t orig_len,
uint8_t *trans_font, size_t trans_len) {
FT_Face orig_face;
FT_Error error
= FT_New_Memory_Face(library, orig_font, orig_len, 0, &orig_face);
if (error) {
std::fprintf(stderr, "Failed to open the original font: %s!\n", file_name);
return 1;
}
FT_Face trans_face;
error = FT_New_Memory_Face(library, trans_font, trans_len, 0, &trans_face);
if (error) {
std::fprintf(stderr, "Failed to open the transcoded font: %s!\n",
file_name);
return 1;
}
static const int kPts[] = {100, 20, 18, 16, 12, 10, 8}; // pt
static const size_t kPtsLen = sizeof(kPts) / sizeof(kPts[0]);
static const int kUnicodeRanges[] = {
0x0020, 0x007E, // Basic Latin (ASCII)
0x00A1, 0x017F, // Latin-1
0x1100, 0x11FF, // Hangul
0x3040, 0x309F, // Japanese HIRAGANA letters
0x3130, 0x318F, // Hangul
0x4E00, 0x4F00, // CJK Kanji/Hanja
0xAC00, 0xAD00, // Hangul
};
static const size_t kUnicodeRangesLen
= sizeof(kUnicodeRanges) / sizeof(kUnicodeRanges[0]);
for (size_t i = 0; i < kPtsLen; ++i) {
for (size_t j = 0; j < kUnicodeRangesLen; j += 2) {
for (int k = 0; k <= kUnicodeRanges[j + 1] - kUnicodeRanges[j]; ++k) {
int ret = LoadCharThenCompare(library, orig_face, trans_face,
kPts[i],
kUnicodeRanges[j] + k);
if (ret > 0) {
std::fprintf(stderr, "Glyph mismatch! (file: %s, U+%04x, %dpt)!\n",
file_name, kUnicodeRanges[j] + k, kPts[i]);
return 1;
}
}
}
}
return 0;
}
} // namespace
int main(int argc, char **argv) {
ots::DisableDebugOutput(); // turn off ERROR and WARNING outputs.
if (argc != 2) {
std::fprintf(stderr, "Usage: %s ttf_or_otf_filename\n", argv[0]);
return 1;
}
// load the font to memory.
const int fd = ::open(argv[1], O_RDONLY);
if (fd < 0) {
::perror("open");
return 1;
}
struct stat st;
::fstat(fd, &st);
const off_t orig_len = st.st_size;
uint8_t *orig_font = new uint8_t[orig_len];
if (::read(fd, orig_font, orig_len) != orig_len) {
std::fprintf(stderr, "Failed to read file!\n");
return 1;
}
::close(fd);
// check if FreeType2 can open the original font.
FT_Library library;
FT_Error error = FT_Init_FreeType(&library);
if (error) {
std::fprintf(stderr, "Failed to initialize FreeType2!\n");
return 1;
}
FT_Face dummy;
error = FT_New_Memory_Face(library, orig_font, orig_len, 0, &dummy);
if (error) {
std::fprintf(stderr, "Failed to open the original font with FT2! %s\n",
argv[1]);
return 1;
}
// transcode the original font.
static const size_t kPadLen = 20 * 1024;
uint8_t *trans_font = new uint8_t[orig_len + kPadLen];
ots::MemoryStream output(trans_font, orig_len + kPadLen);
bool result = ots::Process(&output, orig_font, orig_len);
if (!result) {
std::fprintf(stderr, "Failed to sanitise file! %s\n", argv[1]);
return 1;
}
const size_t trans_len = output.Tell();
// perform side-by-side tests.
return SideBySide(library, argv[1],
orig_font, orig_len,
trans_font, trans_len);
}
|
// InOutTempBuffer.cpp
#include "StdAfx.h"
#include "InOutTempBuffer.h"
#include "../../Common/Defs.h"
// #include "Windows/Defs.h"
#include "StreamUtils.h"
using namespace NWindows;
using namespace NFile;
using namespace NDirectory;
static UInt32 kTmpBufferMemorySize = (1 << 20);
static LPCTSTR kTempFilePrefixString = TEXT("iot");
CInOutTempBuffer::CInOutTempBuffer():
_buffer(NULL)
{
}
void CInOutTempBuffer::Create()
{
_buffer = new Byte[kTmpBufferMemorySize];
}
CInOutTempBuffer::~CInOutTempBuffer()
{
delete []_buffer;
}
void CInOutTempBuffer::InitWriting()
{
_bufferPosition = 0;
_tmpFileCreated = false;
_fileSize = 0;
}
bool CInOutTempBuffer::WriteToFile(const void *data, UInt32 size)
{
if (size == 0)
return true;
if(!_tmpFileCreated)
{
CSysString tempDirPath;
if(!MyGetTempPath(tempDirPath))
return false;
if (_tempFile.Create(tempDirPath, kTempFilePrefixString, _tmpFileName) == 0)
return false;
// _outFile.SetOpenCreationDispositionCreateAlways();
if(!_outFile.Create(_tmpFileName, true))
return false;
_tmpFileCreated = true;
}
UInt32 processedSize;
if(!_outFile.Write(data, size, processedSize))
return false;
_fileSize += processedSize;
return (processedSize == size);
}
bool CInOutTempBuffer::FlushWrite()
{
return _outFile.Close();
}
bool CInOutTempBuffer::Write(const void *data, UInt32 size)
{
if(_bufferPosition < kTmpBufferMemorySize)
{
UInt32 curSize = MyMin(kTmpBufferMemorySize - _bufferPosition, size);
memmove(_buffer + _bufferPosition, (const Byte *)data, curSize);
_bufferPosition += curSize;
size -= curSize;
data = ((const Byte *)data) + curSize;
_fileSize += curSize;
}
return WriteToFile(data, size);
}
bool CInOutTempBuffer::InitReading()
{
_currentPositionInBuffer = 0;
if(_tmpFileCreated)
return _inFile.Open(_tmpFileName);
return true;
}
HRESULT CInOutTempBuffer::WriteToStream(ISequentialOutStream *stream)
{
if (_currentPositionInBuffer < _bufferPosition)
{
UInt32 sizeToWrite = _bufferPosition - _currentPositionInBuffer;
RINOK(WriteStream(stream, _buffer + _currentPositionInBuffer, sizeToWrite, NULL));
_currentPositionInBuffer += sizeToWrite;
}
if (!_tmpFileCreated)
return true;
for (;;)
{
UInt32 localProcessedSize;
if (!_inFile.ReadPart(_buffer, kTmpBufferMemorySize, localProcessedSize))
return E_FAIL;
if (localProcessedSize == 0)
return S_OK;
RINOK(WriteStream(stream, _buffer, localProcessedSize, NULL));
}
}
STDMETHODIMP CSequentialOutTempBufferImp::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
if (!_buffer->Write(data, size))
{
if (processedSize != NULL)
*processedSize = 0;
return E_FAIL;
}
if (processedSize != NULL)
*processedSize = size;
return S_OK;
}
|
; A069205: a(n) = Sum_{k=1..n} 2^bigomega(k).
; 1,3,5,9,11,15,17,25,29,33,35,43,45,49,53,69,71,79,81,89,93,97,99,115,119,123,131,139,141,149,151,183,187,191,195,211,213,217,221,237,239,247,249,257,265,269,271,303,307,315,319,327,329,345,349,365,369,373,375,391,393,397,405,469,473,481,483,491,495,503,505,537,539,543,551,559,563,571,573,605,621,625,627,643,647,651,655,671,673,689,693,701,705,709,713,777,779,787,795,811,813,821,823,839,847,851,853,885,887,895,899,931,933,941,945,953,961,965,969,1001,1005,1009,1013,1021,1029,1045,1047,1175,1179,1187,1189,1205,1209,1213,1229,1245,1247,1255,1257,1273,1277,1281,1285,1349,1353,1357,1365,1373,1375,1391,1393,1409,1417,1425,1429,1445,1447,1451,1455,1519,1523,1555,1557,1565,1573,1577,1579,1611,1615,1623,1631,1639,1641,1649,1657,1689,1693,1697,1699,1731,1733,1741,1745,1761,1765,1773,1777,1785,1801,1809,1811,1939,1941,1945,1953,1969,1971,1987,1989,2021,2025,2029,2033,2049,2053,2057,2065,2097,2101,2117,2119,2127,2131,2135,2139,2203,2207,2211,2215,2231,2235,2243,2245,2309,2325,2329,2331,2347,2349,2357,2365,2381,2383,2399,2403,2411,2415,2423,2425,2489,2491,2499,2531,2539,2547,2555,2559,2575,2579,2595
mov $27,$0
mov $29,$0
add $29,1
lpb $29
clr $0,27
mov $0,$27
sub $29,1
sub $0,$29
cal $0,61142 ; Replace each prime factor of n with 2: a(n) = 2^bigomega(n), where bigomega = A001222, number of prime factors counted with multiplicity.
add $0,7
add $3,$0
mov $1,$3
sub $1,7
add $28,$1
lpe
mov $1,$28
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x126ab, %rsi
lea addresses_D_ht+0x317f, %rdi
nop
nop
nop
nop
nop
sub %r14, %r14
mov $69, %rcx
rep movsw
nop
nop
nop
and $64483, %r13
lea addresses_A_ht+0x1b2ab, %rsi
lea addresses_A_ht+0x13423, %rdi
cmp %r9, %r9
mov $32, %rcx
rep movsq
and $39684, %r14
lea addresses_A_ht+0x10ceb, %r13
nop
nop
add %r10, %r10
movb $0x61, (%r13)
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0xa32b, %r10
nop
nop
nop
nop
nop
dec %rsi
movb $0x61, (%r10)
nop
nop
cmp $9514, %r9
lea addresses_WT_ht+0x1aaab, %rsi
lea addresses_A_ht+0x134ab, %rdi
nop
cmp %r9, %r9
mov $4, %rcx
rep movsl
nop
nop
nop
dec %rsi
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_D+0x12ab, %rdi
nop
nop
nop
xor %rbp, %rbp
mov (%rdi), %rcx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}, 'dst': {'same': True, 'type': 'addresses_A_ht', 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
#include "cdotc/Sema/Template.h"
#include "cdotc/AST/Decl.h"
#include "cdotc/AST/Expression.h"
#include "cdotc/Basic/NestedNameSpecifier.h"
#include "cdotc/IL/Constants.h"
#include "cdotc/ILGen/ILGenPass.h"
#include "cdotc/Diagnostics/Diagnostics.h"
#include "cdotc/Query/QueryContext.h"
#include "cdotc/Sema/SemaPass.h"
using std::string;
using namespace cdot::support;
using namespace cdot::diag;
using namespace cdot::ast;
namespace cdot {
namespace sema {
static bool isDependentType(TemplateParamDecl *Param, QualType type)
{
assert(!type->isReferenceType() && "tried to use reference as template argument!");
if (!type) {
return false;
}
if (type->isDependentType() || type->containsAssociatedType()
|| type->containsTypeVariable()
|| type->containsTemplateParamType()) {
return true;
}
auto &QC = Param->getASTCtx().CI.getQueryContext();
ProtocolDecl *Result;
if (QC.ContainsProtocolWithAssociatedTypes(Result, type)) {
return false;
}
if (Result) {
return true;
}
bool ContainsTemplate;
if (QC.ContainsTemplate(ContainsTemplate, type)) {
return false;
}
return ContainsTemplate;
}
TemplateArgument::TemplateArgument(TemplateParamDecl* Param,
QualType type,
SourceLocation loc) noexcept
: IsType(true), IsVariadic(false), IsNull(false),
Dependent(isDependentType(Param, type)),
Frozen(false), Runtime(false),
ManuallySpecifiedVariadicArgs(0), Param(Param),
Type(type->getCanonicalType()), Loc(loc)
{
}
TemplateArgument::TemplateArgument(TemplateParamDecl* Param, StaticExpr* Expr,
SourceLocation loc) noexcept
: IsType(false), IsVariadic(false), IsNull(false),
Dependent(Expr && Expr->isDependent()), Frozen(false), Runtime(false),
ManuallySpecifiedVariadicArgs(0), Param(Param), Expr(Expr), Loc(loc)
{
}
TemplateArgument::TemplateArgument(TemplateParamDecl* Param, bool isType,
std::vector<TemplateArgument>&& variadicArgs,
SourceLocation loc)
: IsType(isType), IsVariadic(true), IsNull(false), Dependent(false),
Frozen(false), Runtime(false), ManuallySpecifiedVariadicArgs(0),
Param(Param), VariadicArgs(move(variadicArgs)), Loc(loc)
{
for (auto& VA : this->VariadicArgs) {
if (VA.Dependent) {
Dependent = true;
break;
}
}
}
TemplateArgument::TemplateArgument(TemplateArgument&& other) noexcept
: IsType(other.IsType), IsVariadic(other.IsVariadic), IsNull(other.IsNull),
Dependent(other.Dependent), Frozen(false), Runtime(other.Runtime),
ManuallySpecifiedVariadicArgs(other.ManuallySpecifiedVariadicArgs),
Param(other.Param), Loc(other.Loc)
{
if (IsVariadic) {
new (&VariadicArgs)
std::vector<TemplateArgument>(move(other.VariadicArgs));
}
else if (IsType) {
Type = other.Type;
}
else {
Expr = other.Expr;
}
}
TemplateArgument::~TemplateArgument() { destroyValue(); }
TemplateArgument& TemplateArgument::operator=(TemplateArgument&& other) noexcept
{
destroyValue();
new (this) TemplateArgument(move(other));
return *this;
}
void TemplateArgument::destroyValue()
{
if (IsNull)
return;
if (IsVariadic) {
for (auto& VA : VariadicArgs)
VA.destroyValue();
VariadicArgs.~vector();
}
}
QualType TemplateArgument::getValueType() const
{
assert(isValue());
return Param->getValueType();
}
il::Constant* TemplateArgument::getValue() const
{
assert(isValue() && "not a value template argument");
return Expr ? Expr->getEvaluatedExpr() : nullptr;
}
void TemplateArgument::freeze()
{
assert(isVariadic());
Frozen = true;
ManuallySpecifiedVariadicArgs = (unsigned)VariadicArgs.size();
}
bool TemplateArgument::isStillDependent() const { return Dependent; }
TemplateArgument TemplateArgument::clone(bool Canonicalize, bool Freeze,
ast::TemplateParamDecl* P) const
{
if (!P)
P = getParam();
TemplateArgument Result;
if (isNull()) {
Result = TemplateArgument();
}
else if (isVariadic()) {
std::vector<TemplateArgument> args;
for (auto& VA : getVariadicArgs())
args.emplace_back(VA.clone(Canonicalize));
Result = TemplateArgument(P, isType(), move(args), getLoc());
}
else if (isType()) {
Result = TemplateArgument(
P, Canonicalize ? getType() : getNonCanonicalType(), getLoc());
}
else {
Result = TemplateArgument(P, getValueExpr(), getLoc());
}
if (Freeze && Result.isVariadic())
Result.freeze();
Result.Runtime = Runtime;
return Result;
}
bool TemplateArgument::operator==(const TemplateArgument& RHS) const
{
if (isVariadic()) {
if (!RHS.isVariadic()) {
return false;
}
unsigned N1 = VariadicArgs.size();
unsigned N2 = RHS.VariadicArgs.size();
if (N1 != N2) {
return false;
}
for (unsigned i = 0; i < N1; ++i) {
if (VariadicArgs[i] != RHS.VariadicArgs[i]) {
return false;
}
}
return true;
}
if (isType()) {
if (!RHS.isType()) {
return false;
}
return getType() == RHS.getType();
}
return getValueExpr() == RHS.getValueExpr();
}
std::string TemplateArgument::toString() const
{
if (isNull()) {
return "<null>";
}
if (isVariadic()) {
string s = "(";
size_t i = 0;
for (auto& VA : VariadicArgs) {
if (i != 0)
s += ", ";
s += VA.toString();
++i;
}
s += ")";
return s;
}
if (isType()) {
return getNonCanonicalType()->toString();
}
std::string str;
llvm::raw_string_ostream OS(str);
OS << *getValue();
return OS.str();
}
void TemplateArgument::Profile(llvm::FoldingSetNodeID& ID,
bool Canonicalize) const
{
uint8_t Flags = IsType | (IsVariadic << 1) | (IsNull << 2);
ID.AddInteger(Flags);
ID.AddPointer(getParam());
if (isNull()) {
return;
}
if (isVariadic()) {
ID.AddInteger(getVariadicArgs().size());
for (auto& VA : getVariadicArgs()) {
VA.Profile(ID, Canonicalize);
}
}
else if (isType()) {
if (Canonicalize) {
ID.AddPointer(getType().getAsOpaquePtr());
}
else {
ID.AddPointer(getNonCanonicalType().getAsOpaquePtr());
}
}
else {
ID.AddPointer(getValue());
}
}
class TemplateArgListImpl {
public:
TemplateArgListImpl(SemaPass& SP, NamedDecl* Template,
llvm::ArrayRef<Expression*> templateArgs,
SourceLocation loc)
: SP(SP), ListLoc(loc), Template(Template), StillDependent(false),
HasRuntimeParam(false), HadError(false),
FullyInferred(templateArgs.empty()), PartiallyInferred(false)
{
insertEmptyParams();
if (!templateArgs.empty()) {
resolveWithParameters(templateArgs);
}
else {
inferFromContext();
}
}
TemplateArgListImpl(SemaPass& SP, llvm::ArrayRef<Expression*> templateArgs,
SourceLocation loc)
: SP(SP), ListLoc(loc), StillDependent(false), HasRuntimeParam(false),
HadError(false), FullyInferred(templateArgs.empty()),
PartiallyInferred(false)
{
}
TemplateArgListImpl(SemaPass &S,
FinalTemplateArgumentList &FinalList,
SourceLocation loc)
: SP(S), ListLoc(loc), StillDependent(FinalList.isStillDependent()),
HasRuntimeParam(false), HadError(false), FullyInferred(false),
PartiallyInferred(false)
{
ResolvedArgs.reserve(FinalList.size());
for (auto &TA : FinalList) {
ResolvedArgs.emplace_back(TA.clone());
}
Template = cast<NamedDecl>(ResolvedArgs.front().Param->getDeclContext());
}
void insertEmptyParams()
{
auto Params = getParameters();
ResolvedArgs.resize(Params.size());
size_t idx = 0;
for (auto& Param : Params) {
if (Param->isVariadic()) {
new (&ResolvedArgs[idx])
TemplateArgument(Param, Param->isTypeName(), {});
}
else {
ResolvedArgs[idx].Param = Param;
}
++idx;
}
}
void resolveWithParameters(llvm::ArrayRef<Expression*> OriginalArgs)
{
size_t i = 0;
auto parameters = getParameters();
bool variadic = false;
for (auto* E : OriginalArgs) {
if (E->isDependent()) {
StillDependent = true;
break;
}
}
for (auto& P : parameters) {
if (i >= OriginalArgs.size())
break;
if (P->isVariadic()) {
std::vector<TemplateArgument> variadicArgs;
while (i < OriginalArgs.size()) {
auto& TA = OriginalArgs[i];
auto& Out = variadicArgs.emplace_back();
if (!makeSingleArgument(P, Out, TA)) {
variadicArgs.pop_back();
return;
}
++i;
}
variadic = true;
auto numVariadics = (unsigned)variadicArgs.size();
SourceLocation loc = numVariadics ? variadicArgs.front().getLoc()
: P->getSourceLoc();
auto Idx = getIndexFor(P);
auto& VA = ResolvedArgs[Idx];
assert(VA.isVariadic() && "incorrect initial template argument");
assert(VA.getVariadicArgs().empty() && "duplicate variadic arg");
VA.VariadicArgs = move(variadicArgs);
VA.Loc = loc;
VA.freeze();
break;
}
auto& TA = OriginalArgs[i];
if (!makeSingleArgument(P, ResolvedArgs[i], TA))
return;
++i;
}
if (OriginalArgs.size() > parameters.size() && !variadic) {
return Res.setHasTooManyTemplateArgs(OriginalArgs.size(),
parameters.size());
}
if (parameters.size() == ResolvedArgs.size())
return;
for (auto& P : parameters) {
if (auto V = P->getDefaultValue()) {
if (getIndexFor(P) == string::npos) {
if (P->isTypeName()) {
emplace(P, P, V->getExprType(), P->getSourceLoc());
}
else {
emplace(P, P, cast<StaticExpr>(V), P->getSourceLoc());
}
}
}
}
}
void checkCovariance(TemplateParamDecl* P, QualType Ty)
{
if (SP.QC.PrepareDeclInterface(P))
return;
bool IsCovariant;
if (SP.QC.IsCovariant(IsCovariant, Ty, P->getCovariance()) || IsCovariant)
return;
Res.setCovarianceError(Ty, P);
}
TemplateParamDecl* getRuntimeParameter(Expression* E)
{
if (E->isDependent())
return nullptr;
auto* Ident = dyn_cast<IdentifierRefExpr>(E);
if (Ident && Ident->getKind() == IdentifierKind::TemplateParam)
return Ident->getTemplateParam();
return nullptr;
}
void checkDependentType(QualType T)
{
if (T->isDependentType() || T->containsAssociatedType()
|| T->containsTemplateParamType()) {
StillDependent = true;
}
}
bool setParamValue(TemplateParamDecl* P, TemplateArgument&& NewVal)
{
auto Idx = getIndexFor(P);
assert(Idx != -1 && "bad template parameter");
auto& Val = ResolvedArgs[Idx];
if (!Val.isNull()
&& (!Val.isVariadic() && !Val.isFrozen()
&& Val.getVariadicArgs().empty())) {
if (Val != NewVal) {
Res.setHasConflict(Val.getType(), P);
return true;
}
return false;
}
if (P->isVariadic()) {
if (!NewVal.isVariadic()) {
Res.setHasIncompatibleKind(0, P);
return true;
}
}
if (P->isTypeName()) {
if (!NewVal.isType()) {
Res.setHasIncompatibleKind(0, P);
return true;
}
if (NewVal.isVariadic()) {
for (auto& VA : NewVal.getVariadicArgs()) {
checkCovariance(P, VA.getType());
checkDependentType(VA.getType());
}
}
else {
checkCovariance(P, NewVal.getType());
checkDependentType(NewVal.getType());
}
}
Val = move(NewVal);
return false;
}
bool makeSingleArgument(TemplateParamDecl* P, TemplateArgument& Out,
Expression* TA)
{
auto res = SP.visitExpr(TA);
if (!res) {
HadError = true;
return false;
}
auto ty = res.get()->getExprType();
if (isa<TypeExpr>(res.get()) || ty->isErrorType()) {
ty = ty->removeMetaType();
if (!P->isTypeName()) {
Res.setHasIncompatibleKind(0, P);
Out = TemplateArgument(P, nullptr, TA->getSourceLoc());
return false;
}
checkCovariance(P, ty);
checkDependentType(ty);
StillDependent |= isDependentType(P, ty);
Out = TemplateArgument(P, ty, TA->getSourceLoc());
}
else if (ty->isMetaType()) {
if (!P->isTypeName()) {
Res.setHasIncompatibleKind(0, P);
Out = TemplateArgument(P, nullptr, TA->getSourceLoc());
return false;
}
QualType RealTy = cast<MetaType>(ty)->getUnderlyingType();
checkCovariance(P, RealTy);
checkDependentType(RealTy);
StillDependent |= isDependentType(P, RealTy);
Out = TemplateArgument(P, RealTy, TA->getSourceLoc());
}
else {
if (P->isTypeName()) {
Res.setHasIncompatibleKind(1, P);
Out = TemplateArgument(P, SP.getContext().getErrorTy(),
TA->getSourceLoc());
return false;
}
auto StatExp = StaticExpr::Create(SP.getContext(), TA);
auto SemaResult = SP.visitExpr(StatExp);
if (!SemaResult) {
HadError = true;
Out = TemplateArgument(P, nullptr, TA->getSourceLoc());
return false;
}
ty = StatExp->getExprType();
if (ty->isDependentType()) {
StillDependent = true;
}
else if (StatExp->getExprType()->getCanonicalType()
!= P->getValueType()->getCanonicalType()) {
Res.setHasIncompatibleType(StatExp->getExprType(), P);
Out = TemplateArgument(P, nullptr, TA->getSourceLoc());
return false;
}
StatExp = cast<StaticExpr>(SemaResult.get());
Out = TemplateArgument(P, StatExp, StatExp->getSourceLoc());
}
return true;
}
void copyFromList(const TemplateArgList& list)
{
auto it = list.begin();
auto end = list.end();
auto param_it = getParameters().begin();
for (; it != end; ++it) {
if (!it->isNull()) {
auto& Param = *param_it++;
emplace(Param, it->clone());
}
}
}
void copyFromList(const FinalTemplateArgumentList& list)
{
auto it = list.begin();
auto end = list.end();
auto param_it = getParameters().begin();
for (; it != end; ++it) {
if (!it->isNull()) {
auto& Param = *param_it++;
emplace(Param, it->clone());
}
}
}
TemplateArgument* getNamedArg(DeclarationName Name)
{
auto idx = getIndexFor(Name);
if (idx == string::npos)
return nullptr;
return &ResolvedArgs[idx];
}
TemplateArgument* getArgForParam(TemplateParamDecl* P)
{
auto idx = getIndexFor(P);
if (idx == string::npos)
return nullptr;
return &ResolvedArgs[idx];
}
bool inferFromReturnType(QualType contextualType, QualType returnType,
bool IsLastVariadicParam);
void inferFromArgList(llvm::ArrayRef<QualType> givenArgs,
llvm::ArrayRef<FuncArgDecl*> neededArgs);
bool checkSingleCompatibility(TemplateArgument& TA,
TemplateParamDecl* const& TP, size_t idx,
bool ignoreVariadic = false);
void checkCompatibility();
bool isStillDependent() const { return StillDependent; }
llvm::ArrayRef<TemplateParamDecl*> getParameters() const
{
if (!Template)
return {};
return Template->getTemplateParams();
}
bool insert(TemplateArgument&& arg)
{
auto Param = arg.getParam();
StillDependent |= arg.isStillDependent();
return emplace(Param, move(arg)).second;
}
size_t getIndexFor(DeclarationName Name)
{
size_t idx = 0;
for (auto& param : getParameters()) {
if (param->getDeclName() == Name)
return idx;
++idx;
}
return string::npos;
}
size_t getIndexFor(TemplateParamDecl* Param)
{
size_t idx = 0;
for (auto& param : getParameters()) {
if (param == Param)
return idx;
++idx;
}
return string::npos;
}
friend class TemplateArgList;
private:
SemaPass& SP;
llvm::SmallVector<TemplateArgument, 0> ResolvedArgs;
SourceLocation ListLoc;
NamedDecl* Template = nullptr;
bool StillDependent : 1;
bool HasRuntimeParam : 1;
bool HadError : 1;
bool FullyInferred : 1;
bool PartiallyInferred : 1;
TemplateArgListResult Res;
bool inferTemplateArg(QualType givenNonCanon, QualType needed);
bool inferTemplateArg(const FinalTemplateArgumentList& GivenList,
ArrayRef<TemplateParamDecl*> NeededParams);
template<class... Args>
std::pair<size_t, bool> emplace(TemplateParamDecl* Decl, Args&&... args)
{
return emplace(getIndexFor(Decl), std::forward<Args&&>(args)...);
}
template<class... Args>
std::pair<size_t, bool> emplace(size_t idx, Args&&... args)
{
if (idx == string::npos || !ResolvedArgs[idx].isNull())
return {idx, false};
auto& Arg = ResolvedArgs[idx];
new (&Arg) TemplateArgument(std::forward<Args&&>(args)...);
StillDependent |= ResolvedArgs[idx].isStillDependent();
return {idx, true};
}
void fillImplicitTemplateArgs()
{
for (auto P : getParameters()) {
if (P->isVariadic()) {
emplace(P, P, P->isTypeName(), std::vector<TemplateArgument>(),
P->getSourceLoc());
}
else if (P->isTypeName()) {
emplace(P, P, SP.getContext().getTemplateParamType(P),
P->getSourceLoc());
}
else {
emplace(P, P, nullptr, P->getSourceLoc());
}
}
}
void inferFromContext()
{
if (!isa<RecordDecl>(Template))
return;
// you can refer to a template without any template arguments from
// within itself
for (auto* Ctx = &SP.getDeclContext(); Ctx; Ctx = Ctx->getParentCtx()) {
auto ND = dyn_cast<NamedDecl>(Ctx);
if (!ND)
continue;
if (auto* Ext = dyn_cast<ExtensionDecl>(ND)) {
if (auto* Rec = Ext->getExtendedRecord())
ND = Rec;
}
if (dyn_cast<NamedDecl>(ND) == Template) {
fillImplicitTemplateArgs();
break;
}
if (ND->isInstantiation()
&& ND->getSpecializedTemplate() == Template) {
copyFromList(ND->getTemplateArgs());
}
}
// chekc if we're in a context that allows incomplete template names,
// e.g. an extension type
if (SP.allowIncompleteTemplateTypes()) {
fillImplicitTemplateArgs();
}
}
bool resolveDefault(TemplateArgument& Arg)
{
auto Param = Arg.getParam();
if (SP.QC.PrepareDeclInterface(Param)) {
return true;
}
auto Def = Param->getDefaultValue();
if (!Def) {
return false;
}
assert(!Param->isVariadic() && "variadics cannot have a default value!");
if (Param->isTypeName()) {
Arg = TemplateArgument(Param, Def->getExprType()->removeMetaType(),
Def->getSourceLoc());
}
else {
auto SE = cast<StaticExpr>(Def);
Arg = TemplateArgument(Arg.getParam(), SE, Def->getSourceLoc());
}
return true;
}
};
bool TemplateArgListImpl::inferFromReturnType(QualType contextualType,
QualType returnType,
bool IsLastVariadicParam)
{
if (contextualType->isAutoType())
return true;
bool Result = inferTemplateArg(contextualType, returnType);
if (!IsLastVariadicParam)
return Result;
// update variadic arguments so we don't infer them again
for (auto& Arg : ResolvedArgs) {
if (!Arg.isVariadic())
continue;
Arg.freeze();
}
return Result;
}
void TemplateArgListImpl::inferFromArgList(
llvm::ArrayRef<QualType> givenArgs, llvm::ArrayRef<FuncArgDecl*> neededArgs)
{
if (!neededArgs.empty()) {
bool variadic = neededArgs.back()->isVariadicArgPackExpansion();
size_t i = 0;
FuncArgDecl* Previous = nullptr;
for (const auto& arg : givenArgs) {
if (i >= neededArgs.size() && !variadic) {
break;
}
auto& neededArg
= neededArgs.size() > i ? neededArgs[i] : neededArgs.back();
if (Previous && Previous != neededArg) {
// update variadic arguments so we don't infer them again
for (auto& Arg : ResolvedArgs) {
if (!Arg.isVariadic())
continue;
Arg.freeze();
}
}
Previous = neededArg;
auto success = inferTemplateArg(arg, neededArg->getType());
if (!success)
return;
++i;
}
}
}
bool TemplateArgListImpl::inferTemplateArg(QualType givenNonCanon,
QualType neededNonCanon)
{
if (givenNonCanon->isDependentType()) {
StillDependent = true;
}
CanType given = givenNonCanon;
CanType needed = neededNonCanon;
if (isa<ReferenceType>(given) && !needed->isReferenceType()) {
given = cast<ReferenceType>(given)->getReferencedType();
}
if (TemplateParamType* neededGen
= dyn_cast<TemplateParamType>(neededNonCanon)) {
auto parameters = getParameters();
auto idx = getIndexFor(neededGen->getParam());
if (idx >= parameters.size())
return true;
auto& Arg = ResolvedArgs[idx];
auto Param = Arg.getParam();
assert(Param->isTypeName()
&& "allowed Value parameter to be used as argument type!");
if (auto* G = dyn_cast<TemplateParamType>(given)) {
if (!cast<NamedDecl>(G->getParam()->getDeclContext())
->isUnboundedTemplate()) {
HasRuntimeParam = true;
}
}
checkCovariance(Param, given);
if (Arg.isNull()) {
if (Param->isVariadic()) {
std::vector<TemplateArgument> variadicArgs;
variadicArgs.emplace_back(Param, given);
emplace(Param, Param, true, move(variadicArgs), ListLoc);
}
else {
emplace(Param, Param, given, ListLoc);
}
}
else {
// invalid argument kind, ignore for now
if (!Arg.isType()) {
return false;
}
if (Arg.isVariadic()) {
if (!Arg.Frozen) {
Arg.emplace_back(Param, given, ListLoc);
}
else {
auto variadicIdx = Arg.VariadicArgs.size()
- Arg.ManuallySpecifiedVariadicArgs;
auto& ManuallySpecifiedTA = Arg.VariadicArgs[variadicIdx];
if (ManuallySpecifiedTA.getType() != given) {
while (Arg.VariadicArgs.size()
> Arg.ManuallySpecifiedVariadicArgs + 1) {
Arg.VariadicArgs.pop_back();
}
Res.setHasConflict(given, Param);
return false;
}
--Arg.ManuallySpecifiedVariadicArgs;
if (Arg.ManuallySpecifiedVariadicArgs == 0)
Arg.Frozen = false;
}
}
else {
// ensure that both inferred types are the same
QualType ty = Arg.getType();
if (ty->getCanonicalType() != given->getCanonicalType()) {
Res.setHasConflict(given, Param);
return false;
}
}
}
PartiallyInferred = true;
return true;
}
if (needed->isPointerType()) {
if (!given->isPointerType()) {
return false;
}
return inferTemplateArg(cast<PointerType>(given)->getPointeeType(),
cast<PointerType>(needed)->getPointeeType());
}
if (needed->isReferenceType()) {
if (!given->isReferenceType()) {
return false;
}
return inferTemplateArg(cast<ReferenceType>(given)->getReferencedType(),
cast<ReferenceType>(needed)->getReferencedType());
}
if (needed->isMetaType()) {
if (!given->isMetaType()) {
return false;
}
return inferTemplateArg(cast<MetaType>(given)->getUnderlyingType(),
cast<MetaType>(needed)->getUnderlyingType());
}
if (needed->isFunctionType()) {
if (!given->isFunctionType()) {
return false;
}
auto givenFunc = cast<FunctionType>(given);
auto neededFunc = cast<FunctionType>(needed);
QualType givenRet = givenFunc->getReturnType();
QualType neededRet = neededFunc->getReturnType();
if (!inferTemplateArg(givenRet, neededRet))
return false;
auto neededArgs = neededFunc->getParamTypes();
auto givenArgs = givenFunc->getParamTypes();
unsigned i = 0;
for (auto& NeededTy : neededArgs) {
bool IsVariadic = false;
if (auto* TA = NeededTy->asTemplateParamType()) {
IsVariadic = TA->isVariadic();
}
if (IsVariadic) {
while (i < givenArgs.size()) {
if (!inferTemplateArg(givenArgs[i++], NeededTy))
return false;
}
auto* Arg
= getArgForParam(NeededTy->asTemplateParamType()->getParam());
Arg->freeze();
return true;
}
if (!inferTemplateArg(givenArgs[i++], NeededTy))
return false;
}
return true;
}
if (needed->isTupleType()) {
if (!given->isTupleType()) {
return false;
}
auto givenTuple = cast<TupleType>(given);
auto neededTuple = cast<TupleType>(needed);
auto givenTys = givenTuple->getContainedTypes();
auto neededTys = neededTuple->getContainedTypes();
unsigned i = 0;
for (auto& NeededTy : neededTys) {
bool IsVariadic = false;
if (auto* TA = NeededTy->asTemplateParamType()) {
IsVariadic = TA->isVariadic();
}
if (IsVariadic) {
while (i < givenTys.size()) {
if (!inferTemplateArg(givenTys[i++], NeededTy))
return false;
}
auto* Arg
= getArgForParam(NeededTy->asTemplateParamType()->getParam());
Arg->freeze();
return true;
}
if (!inferTemplateArg(givenTys[i++], NeededTy))
return false;
}
return true;
}
if (needed->isRecordType()) {
if (!given->isRecordType()) {
return false;
}
if (given->hasTemplateArgs() && needed->hasTemplateArgs()) {
auto& givenConcrete = given->getTemplateArgs();
auto& neededConcrete = needed->getTemplateArgs();
unsigned i = 0;
for (auto& NeededArg : neededConcrete) {
if (NeededArg.isValue()) {
if (NeededArg.isVariadic())
break;
++i;
continue;
}
QualType NeededTy = NeededArg.getType();
bool IsVariadic = NeededArg.isVariadic();
if (IsVariadic) {
while (i < givenConcrete.size()) {
auto& ConcreteArg = givenConcrete[i++];
if (!ConcreteArg.isType() || ConcreteArg.isVariadic())
return false;
if (!inferTemplateArg(ConcreteArg.getType(), NeededTy))
return false;
}
auto* Arg = getArgForParam(
NeededTy->asTemplateParamType()->getParam());
Arg->freeze();
return true;
}
auto& ConcreteArg = givenConcrete[i++];
if (!ConcreteArg.isType() || ConcreteArg.isVariadic())
return false;
if (!inferTemplateArg(ConcreteArg.getType(), NeededTy))
return false;
}
return true;
}
// Otherwise, try to infer from unconstrained template parameters.
if (given->hasTemplateArgs() && needed->getRecord()->isTemplate()) {
const auto& givenConcrete = given->getTemplateArgs();
ArrayRef<TemplateParamDecl*> neededParams
= needed->getRecord()->getTemplateParams();
return inferTemplateArg(givenConcrete, neededParams);
}
return true;
}
if (needed->isArrayType()) {
if (!given->isArrayType())
return false;
ArrayType* givenArr = cast<ArrayType>(given);
ArrayType* neededArr = cast<ArrayType>(needed);
if (!inferTemplateArg(givenArr->getElementType(),
neededArr->getElementType()))
return false;
if (auto Inf = dyn_cast<DependentSizeArrayType>(neededArr)) {
auto Ident
= dyn_cast<IdentifierRefExpr>(Inf->getSizeExpr()->getExpr());
if (!Ident || Ident->getKind() != IdentifierKind::TemplateParam)
return true;
auto Param = Ident->getTemplateParam();
// have to lookup via name because the address might change if an
// outer record is instantiated
auto Idx = getIndexFor(Param->getDeclName());
if (Idx == string::npos)
return true;
if (ResolvedArgs[Idx].isNull()) {
auto& Builder = SP.getILGen().Builder;
emplace(Idx, Param,
Builder.GetConstantInt(Param->getValueType(),
givenArr->getNumElements()));
}
}
return true;
}
if (auto* DN = needed->asDependentNameType()) {
auto* Name = DN->getNameSpec();
if (Name->getKind() != NestedNameSpecifier::TemplateArgList
|| Name->depth() != 2) {
return true;
}
ArrayRef<TemplateParamDecl*> NeededParams;
auto* Prev = Name->getPrevious();
switch (Prev->getKind()) {
case NestedNameSpecifier::Alias: {
if (!givenNonCanon->isTypedefType()) {
return true;
}
auto* NeededAlias = Prev->getAlias();
auto* GivenAlias = givenNonCanon->asTypedefType()->getTypedef();
if (!GivenAlias->isInstantiation()
|| GivenAlias->getSpecializedTemplate() != NeededAlias) {
return true;
}
NeededParams = NeededAlias->getTemplateParams();
break;
}
case NestedNameSpecifier::Type: {
if (!givenNonCanon->isRecordType()) {
return true;
}
QualType NeededT = Prev->getType();
if (!NeededT->isRecordType()) {
return true;
}
auto* NeededRec = NeededT->getRecord();
auto* GivenRec = givenNonCanon->getRecord();
if (!GivenRec->isInstantiation()
|| GivenRec->getSpecializedTemplate() != NeededRec) {
return true;
}
NeededParams = NeededRec->getTemplateParams();
break;
}
default:
return true;
}
return inferTemplateArg(*Name->getTemplateArgs(), NeededParams);
}
return true;
}
bool TemplateArgListImpl::inferTemplateArg(
const FinalTemplateArgumentList& GivenList,
ArrayRef<TemplateParamDecl*> NeededParams)
{
auto& Context = SP.getContext();
unsigned i = 0;
for (auto* NeededArg : NeededParams) {
if (!NeededArg->isTypeName()) {
if (NeededArg->isVariadic())
break;
++i;
continue;
}
QualType NeededTy = Context.getTemplateParamType(NeededArg);
bool IsVariadic = NeededArg->isVariadic();
if (IsVariadic) {
while (i < GivenList.size()) {
auto& ConcreteArg = GivenList[i++];
if (!ConcreteArg.isType() || ConcreteArg.isVariadic())
return false;
if (!inferTemplateArg(ConcreteArg.getType(), NeededTy))
return false;
}
auto* Arg = getArgForParam(NeededArg);
Arg->freeze();
return true;
}
auto& ConcreteArg = GivenList[i++];
if (!ConcreteArg.isType() || ConcreteArg.isVariadic())
return false;
if (!inferTemplateArg(ConcreteArg.getType(), NeededTy))
return false;
}
return true;
}
bool MultiLevelTemplateArgList::setParamValue(TemplateParamDecl* Param,
TemplateArgument&& Arg)
{
for (auto& list : *this) {
if (list->getArgForParam(Param)) {
return list->setParamValue(Param, move(Arg));
}
}
return false;
}
bool MultiLevelTemplateArgList::inferFromType(QualType contextualType,
QualType returnType,
bool IsLastVariadicParam)
{
for (auto& list : *this) {
if (!list->inferFromType(contextualType, returnType, IsLastVariadicParam))
return false;
}
return true;
}
bool TemplateArgListImpl::checkSingleCompatibility(TemplateArgument& TA,
TemplateParamDecl* const& P,
size_t idx,
bool ignoreVariadic)
{
enum DiagSelectIndex : unsigned {
Type = 0,
Value = 1,
VariadicType = 2,
VariadicValue = 3,
};
if (P->isVariadic() && !ignoreVariadic) {
if (!TA.isVariadic()) {
unsigned diagSelect = P->isTypeName() ? VariadicType : VariadicValue;
diagSelect |= (TA.isType() ? Type : Value) << 2u;
Res.setHasIncompatibleKind(diagSelect, P);
return false;
}
size_t i = 0;
for (auto& VA : TA.VariadicArgs) {
if (!checkSingleCompatibility(VA, P, idx, true)) {
while (TA.VariadicArgs.size()
> TA.ManuallySpecifiedVariadicArgs + 1) {
TA.VariadicArgs.pop_back();
}
return false;
}
++i;
}
}
else if (P->isTypeName()) {
if (!TA.isType()) {
unsigned diagSelect = Type;
diagSelect |= (TA.isVariadic() ? VariadicValue : Value) << 2u;
Res.setHasIncompatibleKind(diagSelect, P);
return false;
}
// if (P.covariance) {
// if (!TA.getType()->implicitlyConvertibleTo(P.covariance)) {
// err(err_generic_error)
// << "incompatible template argument " + P->getName()
// + ": expected " + P.covariance->toString()
// << P->getSourceLoc() << end;
//
// compatible = false;
// continue;
// }
// }
}
else {
if (!TA.isValue()) {
unsigned diagSelect = Value;
diagSelect |= (TA.isVariadic() ? VariadicType : Type) << 2u;
Res.setHasIncompatibleKind(diagSelect, P);
return false;
}
if (TA.getValueType()->getCanonicalType()
!= P->getValueType()->getCanonicalType()) {
Res.setHasIncompatibleType(TA.getValueType(), P);
return false;
}
}
return true;
}
void TemplateArgListImpl::checkCompatibility()
{
assert(ResolvedArgs.size() == getParameters().size()
&& "broken template argument list");
if (!Res)
return;
size_t idx = 0;
for (auto& Arg : ResolvedArgs) {
if (Arg.isNull()) {
if (resolveDefault(Arg)) {
++idx;
continue;
}
return Res.setCouldNotInfer(Arg.getParam());
}
if (!checkSingleCompatibility(Arg, Arg.getParam(), idx))
return;
++idx;
}
}
TemplateArgList::TemplateArgList(SemaPass& S, NamedDecl* Template,
RawArgList templateArguments,
SourceLocation loc)
: pImpl(new TemplateArgListImpl(S, Template, templateArguments, loc))
{
}
TemplateArgList::TemplateArgList(SemaPass& S, QualType RecordTy,
RawArgList templateArguments,
SourceLocation loc)
: pImpl(new TemplateArgListImpl(S, RecordTy->getRecord(), templateArguments,
loc))
{
if (auto Dep = RecordTy->asDependentRecordType()) {
pImpl->copyFromList(Dep->getTemplateArgs());
}
}
TemplateArgList::TemplateArgList(SemaPass& S, RawArgList templateArguments,
SourceLocation loc)
: pImpl(new TemplateArgListImpl(S, templateArguments, loc))
{
}
TemplateArgList::TemplateArgList(SemaPass &S,
FinalTemplateArgumentList &FinalList,
SourceLocation loc)
: pImpl(new TemplateArgListImpl(S, FinalList, loc))
{
}
TemplateArgList::~TemplateArgList() { delete pImpl; }
TemplateArgList TemplateArgList::copy() const
{
TemplateArgList Copy(pImpl->SP, pImpl->Template);
Copy.pImpl->copyFromList(*this);
return Copy;
}
void TemplateArgList::Profile(llvm::FoldingSetNodeID& ID,
TemplateArgList const& list)
{
ID.AddInteger(list.size());
for (auto& arg : list)
arg.Profile(ID);
}
bool TemplateArgList::setParamValue(TemplateParamDecl* Param,
TemplateArgument&& Arg) const
{
assert(pImpl && "incomplete argument list!");
return pImpl->setParamValue(Param, move(Arg));
}
bool TemplateArgList::inferFromType(QualType contextualType,
QualType returnType,
bool IsLastVariadicParam) const
{
assert(pImpl && "incomplete argument list!");
return pImpl->inferFromReturnType(contextualType, returnType,
IsLastVariadicParam);
}
void TemplateArgList::inferFromArgList(
llvm::ArrayRef<QualType> givenArgs,
llvm::ArrayRef<FuncArgDecl*> neededArgs) const
{
assert(pImpl && "incomplete argument list!");
pImpl->inferFromArgList(givenArgs, neededArgs);
}
bool TemplateArgList::isFullyInferred() const
{
if (!pImpl)
return false;
return pImpl->FullyInferred && pImpl->PartiallyInferred;
}
bool TemplateArgList::isPartiallyInferred() const
{
if (!pImpl)
return false;
return !pImpl->FullyInferred && pImpl->PartiallyInferred;
}
TemplateArgListResult TemplateArgList::checkCompatibility() const
{
assert(pImpl && "incomplete argument list!");
pImpl->checkCompatibility();
return pImpl->Res;
}
bool TemplateArgList::isStillDependent() const
{
return pImpl && pImpl->isStillDependent();
}
bool TemplateArgList::hasRuntimeParameter() const
{
return pImpl && pImpl->HasRuntimeParam;
}
TemplateArgument* TemplateArgList::getNamedArg(DeclarationName Name) const
{
return pImpl ? pImpl->getNamedArg(Name) : nullptr;
}
TemplateArgument* TemplateArgList::getArgForParam(TemplateParamDecl* P) const
{
return pImpl ? pImpl->getArgForParam(P) : nullptr;
}
TemplateParamDecl* TemplateArgList::getParameter(TemplateArgument* forArg) const
{
size_t idx = 0;
for (auto& arg : pImpl->ResolvedArgs) {
if (&arg == forArg)
return pImpl->getParameters()[idx];
++idx;
}
return nullptr;
}
ast::NamedDecl* TemplateArgList::getTemplate() const
{
if (!pImpl)
return nullptr;
return pImpl->Template;
}
bool TemplateArgList::empty() const
{
return !pImpl || pImpl->ResolvedArgs.empty();
}
size_t TemplateArgList::size() const
{
return pImpl ? pImpl->ResolvedArgs.size() : 0;
}
const TemplateArgument& TemplateArgList::front() const
{
return pImpl->ResolvedArgs.front();
}
const TemplateArgument& TemplateArgList::back() const
{
return pImpl->ResolvedArgs.back();
}
const TemplateArgument& TemplateArgList::operator[](size_t idx) const
{
return pImpl->ResolvedArgs[idx];
}
bool TemplateArgList::insert(TemplateArgument&& arg)
{
assert(pImpl && "incomplete argument list!");
return pImpl->insert(move(arg));
}
std::string TemplateArgList::toString(char beginC, char endC,
bool showNames) const
{
string s;
{
llvm::raw_string_ostream OS(s);
print(OS, beginC, endC, showNames);
}
return s;
}
void TemplateArgList::print(llvm::raw_ostream& OS, char beginC, char endC,
bool showNames) const
{
if (beginC)
OS << beginC;
size_t i = 0;
auto end_it = end();
for (auto it = begin(); it != end_it; ++it, ++i) {
if (i != 0)
OS << ", ";
if (showNames) {
OS << it->getParam()->getName();
OS << " = ";
}
OS << it->toString();
}
if (endC)
OS << endC;
}
TemplateArgList::arg_iterator TemplateArgList::begin()
{
return pImpl->ResolvedArgs.begin();
}
TemplateArgList::arg_iterator TemplateArgList::end()
{
return pImpl->ResolvedArgs.end();
}
TemplateArgList::const_arg_iterator TemplateArgList::begin() const
{
return pImpl->ResolvedArgs.begin();
}
TemplateArgList::const_arg_iterator TemplateArgList::end() const
{
return pImpl->ResolvedArgs.end();
}
llvm::MutableArrayRef<TemplateArgument> TemplateArgList::getMutableArgs() const
{
return pImpl ? pImpl->ResolvedArgs
: llvm::MutableArrayRef<TemplateArgument>();
}
TemplateArgListResult MultiLevelTemplateArgList::checkCompatibility() const
{
for (auto& list : *this) {
auto comp = list->checkCompatibility();
if (!comp)
return comp;
}
return TemplateArgListResult();
}
void MultiLevelTemplateArgList::Profile(llvm::FoldingSetNodeID& ID) const
{
ID.AddInteger(size());
for (auto* list : *this) {
list->Profile(ID);
}
}
void MultiLevelTemplateArgList::print(llvm::raw_ostream& OS) const
{
OS << "[";
for (auto& list : *this) {
list->print(OS, '\0', '\0', true);
}
OS << "]";
}
std::string MultiLevelTemplateArgList::toString() const
{
std::string str;
{
llvm::raw_string_ostream OS(str);
print(OS);
}
return str;
}
FinalTemplateArgumentList::FinalTemplateArgumentList(
MutableArrayRef<TemplateArgument> Args, bool Dependent, bool RuntimeParam,
bool Canonicalize)
: NumArgs((unsigned)Args.size()), Dependent(Dependent),
RuntimeParam(RuntimeParam)
{
auto it = getTrailingObjects<TemplateArgument>();
for (auto& Arg : Args) {
assert(!Arg.isNull() && "finalizing null template argument!");
this->RuntimeParam |= Arg.isRuntime();
this->Dependent |= Arg.isStillDependent();
new (it++) TemplateArgument(Arg.clone(Canonicalize, true));
}
}
FinalTemplateArgumentList*
FinalTemplateArgumentList::Create(ASTContext& C, const TemplateArgList& list,
bool Canonicalize)
{
return Create(C, list.getMutableArgs(), !list.isStillDependent());
}
FinalTemplateArgumentList* FinalTemplateArgumentList::Create(
ASTContext& C, MutableArrayRef<TemplateArgument> Args, bool Canonicalize)
{
llvm::FoldingSetNodeID ID;
Profile(ID, Args, Canonicalize);
void* InsertPos;
if (auto* List = C.TemplateArgs.FindNodeOrInsertPos(ID, InsertPos)) {
return List;
}
void* Mem = C.Allocate(totalSizeToAlloc<TemplateArgument>(Args.size()),
alignof(FinalTemplateArgumentList));
auto* List
= new (Mem) FinalTemplateArgumentList(Args, false, false, Canonicalize);
C.TemplateArgs.InsertNode(List, InsertPos);
return List;
}
void FinalTemplateArgumentList::Profile(llvm::FoldingSetNodeID& ID,
bool Canonicalize) const
{
Profile(ID, getArguments(), Canonicalize);
}
void FinalTemplateArgumentList::Profile(llvm::FoldingSetNodeID& ID,
ArrayRef<TemplateArgument> Args,
bool Canonicalize)
{
ID.AddInteger(Args.size());
for (auto& Arg : Args) {
Arg.Profile(ID, Canonicalize);
}
}
void FinalTemplateArgumentList::print(llvm::raw_ostream& OS, char beginC,
char endC, bool showNames) const
{
if (beginC)
OS << beginC;
size_t i = 0;
auto end_it = end();
for (auto it = begin(); it != end_it; ++it, ++i) {
if (i != 0)
OS << ", ";
if (showNames) {
OS << it->getParam()->getName();
OS << " = ";
}
OS << it->toString();
}
if (endC)
OS << endC;
}
std::string FinalTemplateArgumentList::toString(char begin, char end,
bool showNames) const
{
std::string s;
llvm::raw_string_ostream OS(s);
print(OS, begin, end, showNames);
return OS.str();
}
const TemplateArgument*
FinalTemplateArgumentList::getNamedArg(DeclarationName Name) const
{
for (auto& Arg : *this) {
if (!Arg.isNull() && Arg.getParam()->getDeclName() == Name)
return &Arg;
}
return nullptr;
}
const TemplateArgument*
FinalTemplateArgumentList::getArgForParam(TemplateParamDecl* P) const
{
for (auto& Arg : *this) {
if (Arg.getParam() == P)
return &Arg;
}
return nullptr;
}
ast::TemplateParamDecl*
FinalTemplateArgumentList::getParameter(TemplateArgument* forArg) const
{
for (auto& Arg : *this) {
if (&Arg == forArg)
return Arg.getParam();
}
return nullptr;
}
void MultiLevelFinalTemplateArgList::Profile(llvm::FoldingSetNodeID& ID) const
{
for (auto& L : *this)
L->Profile(ID);
}
void MultiLevelFinalTemplateArgList::print(llvm::raw_ostream& OS) const
{
OS << "[";
for (auto& list : *this) {
list->print(OS, '\0', '\0', true);
}
OS << "]";
}
std::string MultiLevelFinalTemplateArgList::toString() const
{
std::string str;
{
llvm::raw_string_ostream OS(str);
print(OS);
}
return str;
}
void MultiLevelFinalTemplateArgList::reverse()
{
std::reverse(ArgLists.begin(), ArgLists.end());
}
} // namespace sema
} // namespace cdot |
; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
%ifidn __OUTPUT_FORMAT__,obj
section code use32 class=code align=64
%elifidn __OUTPUT_FORMAT__,win32
$@feat.00 equ 1
section .text code align=64
%else
section .text code
%endif
global _abi_test_trampoline
align 16
_abi_test_trampoline:
L$_abi_test_trampoline_begin:
push ebp
push ebx
push esi
push edi
mov ecx,DWORD [24+esp]
mov esi,DWORD [ecx]
mov edi,DWORD [4+ecx]
mov ebx,DWORD [8+ecx]
mov ebp,DWORD [12+ecx]
sub esp,44
mov eax,DWORD [72+esp]
xor ecx,ecx
L$000loop:
cmp ecx,DWORD [76+esp]
jae NEAR L$001loop_done
mov edx,DWORD [ecx*4+eax]
mov DWORD [ecx*4+esp],edx
add ecx,1
jmp NEAR L$000loop
L$001loop_done:
call DWORD [64+esp]
add esp,44
mov ecx,DWORD [24+esp]
mov DWORD [ecx],esi
mov DWORD [4+ecx],edi
mov DWORD [8+ecx],ebx
mov DWORD [12+ecx],ebp
pop edi
pop esi
pop ebx
pop ebp
ret
global _abi_test_get_and_clear_direction_flag
align 16
_abi_test_get_and_clear_direction_flag:
L$_abi_test_get_and_clear_direction_flag_begin:
pushfd
pop eax
and eax,1024
shr eax,10
cld
ret
global _abi_test_set_direction_flag
align 16
_abi_test_set_direction_flag:
L$_abi_test_set_direction_flag_begin:
std
ret
global _abi_test_clobber_eax
align 16
_abi_test_clobber_eax:
L$_abi_test_clobber_eax_begin:
xor eax,eax
ret
global _abi_test_clobber_ebx
align 16
_abi_test_clobber_ebx:
L$_abi_test_clobber_ebx_begin:
xor ebx,ebx
ret
global _abi_test_clobber_ecx
align 16
_abi_test_clobber_ecx:
L$_abi_test_clobber_ecx_begin:
xor ecx,ecx
ret
global _abi_test_clobber_edx
align 16
_abi_test_clobber_edx:
L$_abi_test_clobber_edx_begin:
xor edx,edx
ret
global _abi_test_clobber_edi
align 16
_abi_test_clobber_edi:
L$_abi_test_clobber_edi_begin:
xor edi,edi
ret
global _abi_test_clobber_esi
align 16
_abi_test_clobber_esi:
L$_abi_test_clobber_esi_begin:
xor esi,esi
ret
global _abi_test_clobber_ebp
align 16
_abi_test_clobber_ebp:
L$_abi_test_clobber_ebp_begin:
xor ebp,ebp
ret
global _abi_test_clobber_xmm0
align 16
_abi_test_clobber_xmm0:
L$_abi_test_clobber_xmm0_begin:
pxor xmm0,xmm0
ret
global _abi_test_clobber_xmm1
align 16
_abi_test_clobber_xmm1:
L$_abi_test_clobber_xmm1_begin:
pxor xmm1,xmm1
ret
global _abi_test_clobber_xmm2
align 16
_abi_test_clobber_xmm2:
L$_abi_test_clobber_xmm2_begin:
pxor xmm2,xmm2
ret
global _abi_test_clobber_xmm3
align 16
_abi_test_clobber_xmm3:
L$_abi_test_clobber_xmm3_begin:
pxor xmm3,xmm3
ret
global _abi_test_clobber_xmm4
align 16
_abi_test_clobber_xmm4:
L$_abi_test_clobber_xmm4_begin:
pxor xmm4,xmm4
ret
global _abi_test_clobber_xmm5
align 16
_abi_test_clobber_xmm5:
L$_abi_test_clobber_xmm5_begin:
pxor xmm5,xmm5
ret
global _abi_test_clobber_xmm6
align 16
_abi_test_clobber_xmm6:
L$_abi_test_clobber_xmm6_begin:
pxor xmm6,xmm6
ret
global _abi_test_clobber_xmm7
align 16
_abi_test_clobber_xmm7:
L$_abi_test_clobber_xmm7_begin:
pxor xmm7,xmm7
ret
|
; A162963: a(n) = 5*a(n-2) for n > 2; a(1) = 2, a(2) = 5.
; 2,5,10,25,50,125,250,625,1250,3125,6250,15625,31250,78125,156250,390625,781250,1953125,3906250,9765625,19531250,48828125,97656250,244140625,488281250,1220703125,2441406250,6103515625,12207031250
mov $2,$0
gcd $0,2
lpb $2
mul $0,5
sub $2,1
trn $2,1
lpe
|
object_const_def ; object_event constants
const ILEXFOREST_FARFETCHD
const ILEXFOREST_YOUNGSTER1
const ILEXFOREST_BLACK_BELT
const ILEXFOREST_ROCKER
const ILEXFOREST_POKE_BALL1
const ILEXFOREST_KURT
const ILEXFOREST_LASS
const ILEXFOREST_YOUNGSTER2
const ILEXFOREST_POKE_BALL2
const ILEXFOREST_POKE_BALL3
const ILEXFOREST_POKE_BALL4
IlexForest_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_OBJECTS, .FarfetchdCallback
.FarfetchdCallback:
checkevent EVENT_GOT_HM01_CUT
iftrue .Static
readmem wFarfetchdPosition
ifequal 1, .PositionOne
ifequal 2, .PositionTwo
ifequal 3, .PositionThree
ifequal 4, .PositionFour
ifequal 5, .PositionFive
ifequal 6, .PositionSix
ifequal 7, .PositionSeven
ifequal 8, .PositionEight
ifequal 9, .PositionNine
ifequal 10, .PositionTen
.Static:
return
.PositionOne:
moveobject ILEXFOREST_FARFETCHD, 14, 31
appear ILEXFOREST_FARFETCHD
return
.PositionTwo:
moveobject ILEXFOREST_FARFETCHD, 15, 25
appear ILEXFOREST_FARFETCHD
return
.PositionThree:
moveobject ILEXFOREST_FARFETCHD, 20, 24
appear ILEXFOREST_FARFETCHD
return
.PositionFour:
moveobject ILEXFOREST_FARFETCHD, 29, 22
appear ILEXFOREST_FARFETCHD
return
.PositionFive:
moveobject ILEXFOREST_FARFETCHD, 28, 31
appear ILEXFOREST_FARFETCHD
return
.PositionSix:
moveobject ILEXFOREST_FARFETCHD, 24, 35
appear ILEXFOREST_FARFETCHD
return
.PositionSeven:
moveobject ILEXFOREST_FARFETCHD, 22, 31
appear ILEXFOREST_FARFETCHD
return
.PositionEight:
moveobject ILEXFOREST_FARFETCHD, 15, 29
appear ILEXFOREST_FARFETCHD
return
.PositionNine:
moveobject ILEXFOREST_FARFETCHD, 10, 35
appear ILEXFOREST_FARFETCHD
return
.PositionTen:
moveobject ILEXFOREST_FARFETCHD, 6, 28
appear ILEXFOREST_FARFETCHD
return
IlexForestCharcoalApprenticeScript:
faceplayer
opentext
checkevent EVENT_HERDED_FARFETCHD
iftrue .DoneFarfetchd
writetext IlexForestApprenticeIntroText
waitbutton
closetext
end
.DoneFarfetchd:
writetext IlexForestApprenticeAfterText
waitbutton
closetext
end
IlexForestFarfetchdScript:
readmem wFarfetchdPosition
ifequal 1, .Position1
ifequal 2, .Position2
ifequal 3, .Position3
ifequal 4, .Position4
ifequal 5, .Position5
ifequal 6, .Position6
ifequal 7, .Position7
ifequal 8, .Position8
ifequal 9, .Position9
ifequal 10, .Position10
.Position1:
faceplayer
opentext
writetext Text_ItsTheMissingPokemon
buttonsound
writetext Text_Kwaaaa
cry FARFETCH_D
waitbutton
closetext
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos1_Pos2
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 2
end
.Position2:
scall .CryAndCheckFacing
ifequal DOWN, .Position2_Down
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos2_Pos3
moveobject ILEXFOREST_FARFETCHD, 20, 24
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 3
end
.Position2_Down:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos2_Pos8
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 8
end
.Position3:
scall .CryAndCheckFacing
ifequal LEFT, .Position3_Left
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos3_Pos4
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 4
end
.Position3_Left:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos3_Pos2
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 2
end
.Position4:
scall .CryAndCheckFacing
ifequal UP, .Position4_Up
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos4_Pos5
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 5
end
.Position4_Up:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos4_Pos3
moveobject ILEXFOREST_FARFETCHD, 20, 24
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 3
end
.Position5:
scall .CryAndCheckFacing
ifequal UP, .Position5_Up
ifequal LEFT, .Position5_Left
ifequal RIGHT, .Position5_Right
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos5_Pos6
moveobject ILEXFOREST_FARFETCHD, 24, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 6
end
.Position5_Left:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetchd_Pos5_Pos7
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 7
end
.Position5_Up:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos5_Pos4_Up
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 4
end
.Position5_Right:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos5_Pos4_Right
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 4
end
.Position6:
scall .CryAndCheckFacing
ifequal RIGHT, .Position6_Right
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos6_Pos7
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 7
end
.Position6_Right:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos6_Pos5
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 5
end
.Position7:
scall .CryAndCheckFacing
ifequal DOWN, .Position7_Down
ifequal LEFT, .Position7_Left
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos7_Pos8
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 8
end
.Position7_Left:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos7_Pos6
moveobject ILEXFOREST_FARFETCHD, 24, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 6
end
.Position7_Down:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos7_Pos5
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 5
end
.Position8:
scall .CryAndCheckFacing
ifequal UP, .Position8_Up
ifequal LEFT, .Position8_Left
ifequal RIGHT, .Position8_Right
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos8_Pos9
moveobject ILEXFOREST_FARFETCHD, 10, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 9
end
.Position8_Right:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos8_Pos7
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 7
end
.Position8_Up:
.Position8_Left:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos8_Pos2
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 2
end
.Position9:
scall .CryAndCheckFacing
ifequal DOWN, .Position9_Down
ifequal RIGHT, .Position9_Right
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos9_Pos10
moveobject ILEXFOREST_FARFETCHD, 6, 28
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 10
appear ILEXFOREST_BLACK_BELT
setevent EVENT_CHARCOAL_KILN_BOSS
setevent EVENT_HERDED_FARFETCHD
end
.Position9_Right:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos9_Pos8_Right
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 8
end
.Position9_Down:
applymovement ILEXFOREST_FARFETCHD, MovementData_Farfetched_Pos9_Pos8_Down
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
loadmem wFarfetchdPosition, 8
end
.Position10:
faceplayer
opentext
writetext Text_Kwaaaa
cry FARFETCH_D
waitbutton
closetext
end
.CryAndCheckFacing:
faceplayer
opentext
writetext Text_Kwaaaa
cry FARFETCH_D
waitbutton
closetext
readvar VAR_FACING
end
IlexForestCharcoalMasterScript:
faceplayer
opentext
checkevent EVENT_GOT_HM01_CUT
iftrue .AlreadyGotUproot
writetext Text_CharcoalMasterIntro
buttonsound
verbosegiveitem HM_UPROOT
setevent EVENT_GOT_HM01_CUT
writetext Text_CharcoalMasterOutro
waitbutton
closetext
setevent EVENT_ILEX_FOREST_FARFETCHD
setevent EVENT_ILEX_FOREST_APPRENTICE
setevent EVENT_ILEX_FOREST_CHARCOAL_MASTER
clearevent EVENT_CHARCOAL_KILN_FARFETCH_D
clearevent EVENT_CHARCOAL_KILN_APPRENTICE
clearevent EVENT_CHARCOAL_KILN_BOSS
end
.AlreadyGotUproot:
writetext Text_CharcoalMasterTalkAfter
waitbutton
closetext
end
IlexForestHeadbuttGuyScript:
faceplayer
opentext
checkevent EVENT_GOT_TM02_HEADBUTT
iftrue .AlreadyGotHeadbutt
writetext Text_HeadbuttIntro
buttonsound
verbosegiveitem TM_HEADBUTT
iffalse .BagFull
setevent EVENT_GOT_TM02_HEADBUTT
.AlreadyGotHeadbutt:
writetext Text_HeadbuttOutro
waitbutton
.BagFull:
closetext
end
TrainerBugCatcherWayne:
trainer BUG_CATCHER, WAYNE, EVENT_BEAT_BUG_CATCHER_WAYNE, BugCatcherWayneSeenText, BugCatcherWayneBeatenText, 0, .Script
.Script:
endifjustbattled
opentext
writetext BugCatcherWayneAfterBattleText
waitbutton
closetext
end
IlexForestLassScript:
jumptextfaceplayer Text_IlexForestLass
IlexForestRevive:
itemball REVIVE
IlexForestXAttack:
itemball X_ATTACK
IlexForestAntidote:
itemball ANTIDOTE
IlexForestEther:
itemball ETHER
IlexForestHiddenEther:
hiddenitem ETHER, EVENT_ILEX_FOREST_HIDDEN_ETHER
IlexForestHiddenSuperPotion:
hiddenitem SUPER_POTION, EVENT_ILEX_FOREST_HIDDEN_SUPER_POTION
IlexForestHiddenFullHeal:
hiddenitem FULL_HEAL, EVENT_ILEX_FOREST_HIDDEN_FULL_HEAL
IlexForestBoulder:
; unused
jumpstd strengthboulder
IlexForestSignpost:
jumptext IlexForestSignpostText
IlexForestShrineScript:
checkevent EVENT_FOREST_IS_RESTLESS
iftrue .ForestIsRestless
sjump .DontDoCelebiEvent
.ForestIsRestless:
checkitem GS_BALL
iftrue .AskCelebiEvent
.DontDoCelebiEvent:
jumptext Text_IlexForestShrine
.AskCelebiEvent:
opentext
writetext Text_ShrineCelebiEvent
yesorno
iftrue .CelebiEvent
closetext
end
.CelebiEvent:
takeitem GS_BALL
clearevent EVENT_FOREST_IS_RESTLESS
setevent EVENT_AZALEA_TOWN_KURT
disappear ILEXFOREST_LASS
clearevent EVENT_ROUTE_34_ILEX_FOREST_GATE_LASS
writetext Text_InsertGSBall
waitbutton
closetext
pause 20
showemote EMOTE_SHOCK, PLAYER, 20
special FadeOutMusic
applymovement PLAYER, MovementData_0x6ef58
pause 30
turnobject PLAYER, DOWN
pause 20
clearflag ENGINE_FOREST_IS_RESTLESS
special CelebiShrineEvent
loadwildmon CELEBI, 30
startbattle
reloadmapafterbattle
pause 20
special CheckCaughtCelebi
iffalse .DidntCatchCelebi
appear ILEXFOREST_KURT
applymovement ILEXFOREST_KURT, MovementData_0x6ef4e
opentext
writetext Text_KurtCaughtCelebi
waitbutton
closetext
applymovement ILEXFOREST_KURT, MovementData_0x6ef53
disappear ILEXFOREST_KURT
.DidntCatchCelebi:
end
MovementData_Farfetchd_Pos1_Pos2:
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetchd_Pos2_Pos3:
big_step UP
big_step UP
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step DOWN
step_end
MovementData_Farfetchd_Pos2_Pos8:
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
step_end
MovementData_Farfetchd_Pos3_Pos4:
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
step_end
MovementData_Farfetchd_Pos3_Pos2:
big_step UP
big_step LEFT
big_step LEFT
big_step LEFT
big_step LEFT
step_end
MovementData_Farfetchd_Pos4_Pos5:
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
step_end
MovementData_Farfetchd_Pos4_Pos3:
big_step LEFT
jump_step LEFT
big_step LEFT
big_step LEFT
step_end
MovementData_Farfetchd_Pos5_Pos6:
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step LEFT
big_step LEFT
big_step LEFT
big_step LEFT
step_end
MovementData_Farfetchd_Pos5_Pos7:
big_step LEFT
big_step LEFT
big_step LEFT
big_step LEFT
step_end
MovementData_Farfetched_Pos5_Pos4_Up:
big_step UP
big_step UP
big_step UP
big_step RIGHT
big_step UP
step_end
MovementData_Farfetched_Pos5_Pos4_Right:
big_step RIGHT
turn_head UP
step_sleep 1
turn_head DOWN
step_sleep 1
turn_head UP
step_sleep 1
big_step DOWN
big_step DOWN
fix_facing
jump_step UP
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos6_Pos7:
big_step LEFT
big_step LEFT
big_step LEFT
big_step UP
big_step UP
big_step RIGHT
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos6_Pos5:
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos7_Pos8:
big_step UP
big_step UP
big_step LEFT
big_step LEFT
big_step LEFT
big_step LEFT
big_step LEFT
step_end
MovementData_Farfetched_Pos7_Pos6:
big_step DOWN
big_step DOWN
big_step LEFT
big_step DOWN
big_step DOWN
big_step RIGHT
big_step RIGHT
big_step RIGHT
step_end
MovementData_Farfetched_Pos7_Pos5:
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
step_end
MovementData_Farfetched_Pos8_Pos9:
big_step DOWN
big_step LEFT
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
big_step DOWN
step_end
MovementData_Farfetched_Pos8_Pos7:
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
step_end
MovementData_Farfetched_Pos8_Pos2:
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos9_Pos10:
big_step LEFT
big_step LEFT
fix_facing
jump_step RIGHT
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step LEFT
big_step LEFT
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos9_Pos8_Right:
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_Farfetched_Pos9_Pos8_Down:
big_step LEFT
big_step LEFT
fix_facing
jump_step RIGHT
step_sleep 8
step_sleep 8
remove_fixed_facing
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step RIGHT
big_step UP
big_step UP
big_step UP
big_step UP
big_step UP
step_end
MovementData_0x6ef4e:
step UP
step UP
step UP
step UP
step_end
MovementData_0x6ef53:
step DOWN
step DOWN
step DOWN
step DOWN
step_end
MovementData_0x6ef58:
fix_facing
slow_step DOWN
remove_fixed_facing
step_end
IlexForestApprenticeIntroText:
text "Oh, man… My boss"
line "is going to be"
cont "steaming…"
para "The FARFETCH'D"
line "that cuts trees"
para "for charcoal took"
line "off on me."
para "I can't go looking"
line "for it here in the"
cont "ILEX FOREST."
para "It's too big, dark"
line "and scary for me…"
done
IlexForestApprenticeAfterText:
text "Wow! Thanks a"
line "whole bunch!"
para "My boss's #MON"
line "won't obey me be-"
cont "cause I don't have"
cont "a BADGE."
done
Text_ItsTheMissingPokemon:
text "It's the missing"
line "#MON!"
done
Text_Kwaaaa:
text "FARFETCH'D: Kwaa!"
done
Text_CharcoalMasterIntro:
text "Ah! My FARFETCH'D!"
para "You found it for"
line "us, kid?"
para "Without it, we"
line "wouldn't be able"
para "to cut trees for"
line "charcoal."
para "Thanks, kid!"
para "Now, how can I"
line "thank you…"
para "I know! Here, take"
line "this."
done
Text_CharcoalMasterOutro:
text "That's the UPROOT"
line "HM. Teach that to a"
para "#MON to clear"
line "small trees."
para "Of course, you"
line "have to have the"
para "GYM BADGE from"
line "AZALEA to use it."
done
Text_CharcoalMasterTalkAfter:
text "Do you want to"
line "apprentice as a"
para "charcoal maker"
line "with me?"
para "You'll be first-"
line "rate in ten years!"
done
Text_HeadbuttIntro:
text "What am I doing?"
para "I'm shaking trees"
line "using HEADBUTT."
para "It's fun. Here,"
line "you try it too!"
done
Text_HeadbuttOutro:
text "Rattle trees with"
line "HEADBUTT. Some-"
cont "times, sleeping"
cont "#MON fall out."
done
Text_IlexForestLass:
text "Did something"
line "happen to the"
cont "forest's guardian?"
done
IlexForestSignpostText:
text "ILEX FOREST is"
line "so overgrown with"
para "trees that you"
line "can't see the sky."
para "Please watch out"
line "for items that may"
cont "have been dropped."
done
Text_IlexForestShrine:
text "ILEX FOREST"
line "SHRINE…"
para "It's in honor of"
line "the forest's"
cont "protector…"
done
Text_ShrineCelebiEvent:
text "ILEX FOREST"
line "SHRINE…"
para "It's in honor of"
line "the forest's"
cont "protector…"
para "Oh? What is this?"
para "It's a hole."
line "It looks like the"
para "GS BALL would fit"
line "inside it."
para "Want to put the GS"
line "BALL here?"
done
Text_InsertGSBall:
text "<PLAYER> put in the"
line "GS BALL."
done
Text_KurtCaughtCelebi:
text "Whew, wasn't that"
line "something!"
para "<PLAYER>, that was"
line "fantastic. Thanks!"
para "The legends about"
line "that SHRINE were"
cont "real after all."
para "I feel inspired by"
line "what I just saw."
para "It motivates me to"
line "make better BALLS!"
para "I'm going!"
done
BugCatcherWayneSeenText:
text "Don't sneak up on"
line "me like that!"
para "You frightened a"
line "#MON away!"
done
BugCatcherWayneBeatenText:
text "I hadn't seen that"
line "#MON before…"
done
BugCatcherWayneAfterBattleText:
text "A #MON I've"
line "never seen before"
para "fell out of the"
line "tree when I used"
cont "HEADBUTT."
para "I ought to use"
line "HEADBUTT in other"
cont "places too."
done
IlexForest_MapEvents:
db 0, 0 ; filler
db 3 ; warp events
warp_event 1, 5, ROUTE_34_ILEX_FOREST_GATE, 3
warp_event 3, 42, ILEX_FOREST_AZALEA_GATE, 1
warp_event 3, 43, ILEX_FOREST_AZALEA_GATE, 2
db 0 ; coord events
db 5 ; bg events
bg_event 3, 17, BGEVENT_READ, IlexForestSignpost
bg_event 11, 7, BGEVENT_ITEM, IlexForestHiddenEther
bg_event 22, 14, BGEVENT_ITEM, IlexForestHiddenSuperPotion
bg_event 1, 17, BGEVENT_ITEM, IlexForestHiddenFullHeal
bg_event 8, 22, BGEVENT_UP, IlexForestShrineScript
db 11 ; object events
object_event 14, 31, SPRITE_BIRD, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_BROWN, OBJECTTYPE_SCRIPT, 0, IlexForestFarfetchdScript, EVENT_ILEX_FOREST_FARFETCHD
object_event 7, 28, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, IlexForestCharcoalApprenticeScript, EVENT_ILEX_FOREST_APPRENTICE
object_event 5, 28, SPRITE_BLACK_BELT, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestCharcoalMasterScript, EVENT_ILEX_FOREST_CHARCOAL_MASTER
object_event 15, 14, SPRITE_ROCKER, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, IlexForestHeadbuttGuyScript, -1
object_event 20, 32, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, IlexForestRevive, EVENT_ILEX_FOREST_REVIVE
object_event 8, 29, SPRITE_KURT, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_ILEX_FOREST_KURT
object_event 3, 24, SPRITE_LASS, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, IlexForestLassScript, EVENT_ILEX_FOREST_LASS
object_event 12, 1, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_TRAINER, 0, TrainerBugCatcherWayne, -1
object_event 9, 17, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, IlexForestXAttack, EVENT_ILEX_FOREST_X_ATTACK
object_event 17, 7, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, IlexForestAntidote, EVENT_ILEX_FOREST_ANTIDOTE
object_event 27, 1, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, IlexForestEther, EVENT_ILEX_FOREST_ETHER
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.