blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
357
content_id
stringlengths
40
40
detected_licenses
listlengths
0
58
license_type
stringclasses
2 values
repo_name
stringlengths
4
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
58
visit_date
timestamp[ns]date
2015-07-14 21:31:45
2023-09-06 10:45:08
revision_date
timestamp[ns]date
1970-01-01 00:00:00
2023-09-05 23:26:37
committer_date
timestamp[ns]date
1970-01-01 00:00:00
2023-09-05 23:26:37
github_id
int64
966
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
24 values
gha_event_created_at
timestamp[ns]date
2012-06-07 00:51:45
2023-09-14 21:58:52
gha_created_at
timestamp[ns]date
2008-02-03 21:17:16
2023-08-24 19:49:39
gha_language
stringclasses
180 values
src_encoding
stringclasses
35 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
6
10.4M
extension
stringclasses
121 values
filename
stringlengths
1
148
content
stringlengths
6
10.4M
ac36aa96143519862ac40acbe751978c1aea71fc
7304e8f6b0402f3858981795e97a0b26e77a8bd2
/modules/ircd/commands/topic.c
7bd2a417dd665e0134d7bcd3e5cdf7708a3d444f
[ "BSD-2-Clause" ]
permissive
Vaelatern/ithildin
f0f2bc5463733d92b600c772d66f0417e153d913
efee8b2f20abd45c91b4a4c7d0109638b7acedca
refs/heads/master
2020-03-13T05:00:35.199230
2010-05-23T03:52:17
2010-05-23T03:52:17
null
0
0
null
null
null
null
UTF-8
C
false
false
6,841
c
topic.c
/* * topic.c: the TOPIC command * * Copyright 2002 the Ithildin Project. * See the COPYING file for more information on licensing and use. */ #include <ithildin/stand.h> #include "ircd.h" #include "addons/core.h" #include "commands/topic.h" IDSTRING(rcsid, "$Id: topic.c 752 2006-06-24 18:22:28Z wd $"); MODULE_REGISTER("$Rev: 752 $"); /* @DEPENDENCIES@: ircd @DEPENDENCIES@: ircd/addons/core */ unsigned char topic_chanmode; HOOK_FUNCTION(topic_server_establish_hook); HOOK_FUNCTION(topic_channel_add_hook); MODULE_LOADER(topic) { int64_t i64; if (!get_module_savedata(savelist, "topic_chanmode", &topic_chanmode)) chanmode_request('t', &topic_chanmode, CHANMODE_FL_D, "chanmode_flag", "chanmode_flag_query", 0, NULL); if (!get_module_savedata(savelist, "topic_mdext", &topic_mdext)) topic_mdext = create_mdext_item(ircd.mdext.channel, sizeof(struct channel_topic)); i64 = TOPICLEN; add_isupport("TOPICLEN", ISUPPORT_FL_INT, (char *)&i64); /* stuff this hook in nice and early so we are always in front of NAMES. * THis should be harmless, at least for now. Some clients seem to * depend on speculative wording in RFC1459 that says RPL_TOPIC and * RPL_NAMREPLY are sent. They believe this implies that RPL_TOPIC must * be first. Most clients do not break when this isn't the case, but a * few poorly written ones do. */ add_hook_before(ircd.events.channel_add, topic_channel_add_hook, NULL); add_hook(ircd.events.server_establish, topic_server_establish_hook); #define RPL_NOTOPIC 331 CMSG("331", "%s :No topic is set."); #define RPL_TOPIC 332 CMSG("332", "%s :%s"); #define RPL_TOPICWHOTIME 333 CMSG("333", "%s %s %lu"); return 1; } MODULE_UNLOADER(topic) { if (reload) { add_module_savedata(savelist, "topic_chanmode", sizeof(topic_chanmode), &topic_chanmode); add_module_savedata(savelist, "topic_mdext", sizeof(topic_mdext), &topic_mdext); } else { chanmode_release(topic_chanmode); destroy_mdext_item(ircd.mdext.channel, topic_mdext); } del_isupport(find_isupport("TOPICLEN")); remove_hook(ircd.events.channel_add, topic_channel_add_hook); remove_hook(ircd.events.server_establish, topic_server_establish_hook); DMSG(RPL_NOTOPIC); DMSG(RPL_TOPIC); DMSG(RPL_TOPICWHOTIME); } /* the topic command. may come from either clients or servers. * argv[1] == channel (local users) * argv[2] == topic (local users) or person who set the topic (remote) * argv[3] == topic timestamp (remote) * argv[4] == topic (remote) */ CLIENT_COMMAND(topic, 1, 4, 0) { channel_t *chan = find_channel(argv[1]); struct channel_topic *ctp; if (chan == NULL) { sendto_one(cli, RPL_FMT(cli, ERR_NOSUCHCHANNEL), argv[1]); return COMMAND_WEIGHT_NONE; } ctp = TOPIC(chan); if (MYCLIENT(cli)) { if (argc < 3) { int see; char modname[CHANLEN + 2]; see = can_can_see_channel(cli, chan); if (see == CHANNEL_CHECK_OVERRIDE) sprintf(modname, "%%%s", chan->name); else if (see < 0) strcpy(modname, chan->name); else if (see > 0) { sendto_one(cli, RPL_FMT(cli, see), chan->name); return COMMAND_WEIGHT_NONE; } else return COMMAND_WEIGHT_NONE; /* silently denied. */ if (*ctp->topic) { sendto_one(cli, RPL_FMT(cli, RPL_TOPIC), modname, ctp->topic); sendto_one(cli, RPL_FMT(cli, RPL_TOPICWHOTIME), modname, ctp->by, ctp->set); } else sendto_one(cli, RPL_FMT(cli, RPL_NOTOPIC), modname); return COMMAND_WEIGHT_LOW; } if (!onchannel(cli, chan)) { sendto_one(cli, RPL_FMT(cli, ERR_NOTONCHANNEL), chan->name); return COMMAND_WEIGHT_NONE; } if (chanmode_isset(chan, topic_chanmode) && !CHANOP(cli, chan) && !CLIENT_MASTER(cli)) { sendto_one(cli, RPL_FMT(cli, ERR_CHANOPRIVSNEEDED), chan->name); return COMMAND_WEIGHT_NONE; } strncpy(ctp->topic, argv[2], TOPICLEN); strncpy(ctp->by, cli->nick, ircd.limits.nicklen); ctp->set = me.now; } else { /* a remote client. */ if (argc != 5) return 0; /* uhh.. */ strncpy(ctp->by, argv[2], ircd.limits.nicklen); ctp->set = str_conv_int(argv[3], 0); strncpy(ctp->topic, argv[4], TOPICLEN); } sendto_channel_local(chan, cli, NULL, "TOPIC", ":%s", ctp->topic); sendto_serv_butone(sptr, cli, NULL, chan->name, "TOPIC", "%s %d :%s", ctp->by, ctp->set, ctp->topic); return COMMAND_WEIGHT_MEDIUM; } /* just like the client command, but always assumes remote. */ SERVER_COMMAND(topic, 4, 4, 0) { channel_t *chan = find_channel(argv[1]); struct channel_topic *ctp; time_t ts; if (chan == NULL) return 0; /* hm.. */ ctp = TOPIC(chan); ts = str_conv_int(argv[3], 0); /* (this is what bahamut does, I'm not convinced it is correct): if the * local topic is newer than the remote topic and we have a topic and we're * in a sync (server setting the topic) then don't allow the change. */ if (ctp->set >= ts && *ctp->topic) return 0; /* huh.. */ strncpy(ctp->by, argv[2], ircd.limits.nicklen); ctp->set = ts; strncpy(ctp->topic, argv[4], TOPICLEN); sendto_channel_local(chan, NULL, srv, "TOPIC", ":%s", ctp->topic); sendto_serv_butone(srv, NULL, srv, chan->name, "TOPIC", "%s %d :%s", ctp->by, ctp->set, ctp->topic); return 0; } /* burst topics to the connecting server .. */ HOOK_FUNCTION(topic_server_establish_hook) { server_t *to = (server_t *)data; channel_t *cp; struct channel_topic *ctp; LIST_FOREACH(cp, ircd.lists.channels, lp) { ctp = TOPIC(cp); if (*ctp->topic) sendto_serv_from(to, NULL, ircd.me, cp->name, "TOPIC", "%s %d :%s", ctp->by, ctp->set, ctp->topic); } return NULL; } /* display the topic to local clients joining a channel */ HOOK_FUNCTION(topic_channel_add_hook) { struct chanlink *clp = (struct chanlink *)data; struct channel_topic *ctp = TOPIC(clp->chan); if (!MYCLIENT(clp->cli) || *ctp->topic == '\0') return NULL; sendto_one(clp->cli, RPL_FMT(clp->cli, RPL_TOPIC), clp->chan->name, ctp->topic); sendto_one(clp->cli, RPL_FMT(clp->cli, RPL_TOPICWHOTIME), clp->chan->name, ctp->by, ctp->set); return NULL; } /* vi:set ts=8 sts=4 sw=4 tw=76 et: */
c10e9a6f90f854c6a83e9092f5cdde6fc0e351f4
6f0b7753233ebf4768a4bec47b142c7045e0c89e
/src/free/free_data.c
ac57b5df1b0dd9bb920e149e8b147d37917b8722
[ "MIT" ]
permissive
VictorTennekes/miniRT
6bf4c647fe68f868e4903a116c0335b78c5a7a73
a1589a2e3c3288bcacc660101ddfad06f391d3ef
refs/heads/master
2020-12-19T15:03:45.510770
2020-09-02T23:46:34
2020-09-02T23:46:34
235,767,297
5
1
null
2020-03-08T19:51:04
2020-01-23T10:00:05
C
UTF-8
C
false
false
1,227
c
free_data.c
/* ************************************************************************** */ /* */ /* :::::::: */ /* free_data.c :+: :+: */ /* +:+ */ /* By: vtenneke <vtenneke@student.codam.nl> +#+ */ /* +#+ */ /* Created: 2020/02/20 12:59:49 by vtenneke #+# #+# */ /* Updated: 2020/02/20 12:59:49 by vtenneke ######## odam.nl */ /* */ /* ************************************************************************** */ /* ** Function to free the data struct. ** ** @param : {t_data *} data ** ** @return : {void} */ #include <minirt.h> #include <stdlib.h> void free_data(t_data *data) { if (data->objects) free_list(data->objects, &free); if (data->cameras) free_list(data->cameras, &free); if (data->lights) free_list(data->lights, &free); }
95488546a2e162a3516e4478633b519e3e416bcc
f2ebdcabb5fa9eba66ec0b7984826f5cafbe124a
/software/robot_dog_esp32/web/index.html.gz.h
1ab00846c167bc1e2a74b4357429b527d68de1e3
[ "MIT" ]
permissive
jeremysee2/esp32-robot-dog-code
3c2fa227ccfba7cd0f2dab99e2cea0e9eb7657df
715c200ab4e711418d59b4a45104a490f266d331
refs/heads/master
2023-05-03T06:22:38.650943
2021-05-17T20:02:00
2021-05-17T20:02:00
null
0
0
null
null
null
null
UTF-8
C
false
false
9,129
h
index.html.gz.h
#define index_html_gz_len 2535 static const uint8_t index_html_gz[] PROGMEM = {31,139,8,0,0,0,0,0,0,3,173,25,107,147,211,70,242,179,247,87,76,156,226,36,131,45,219,11,75,182,252,216,59,72,8,225,14,174,82,44,33,151,162,40,106,44,141,237,97,37,141,78,15,219,194,248,191,95,247,188,36,249,65,204,17,23,172,71,253,238,158,238,158,30,121,178,204,163,240,102,178,100,52,184,153,228,60,15,217,205,107,49,19,249,79,98,241,118,56,233,43,200,36,203,75,248,154,137,160,220,246,214,108,118,199,243,94,46,10,127,217,243,105,24,138,34,31,197,34,102,99,131,42,50,150,246,50,22,50,223,32,238,80,203,17,120,36,62,29,131,102,135,192,3,128,88,177,52,243,83,17,134,189,25,91,210,21,23,169,66,36,52,8,120,188,24,13,198,17,77,23,60,134,197,146,241,197,50,31,13,7,131,123,227,53,15,242,165,92,238,60,95,196,57,229,49,75,183,117,138,128,103,73,72,203,209,60,100,155,49,254,233,5,60,5,189,92,196,35,95,132,69,20,239,190,207,114,154,23,217,118,14,2,122,115,26,241,176,28,69,34,22,89,66,125,182,251,30,229,130,101,91,100,30,13,119,255,136,88,192,41,1,107,25,139,9,141,3,226,138,148,51,208,45,101,38,34,205,83,202,243,206,214,251,40,202,44,231,254,221,135,69,42,138,100,219,176,164,110,226,113,171,254,76,81,8,144,204,167,9,59,95,211,110,87,81,86,209,146,126,93,129,29,117,74,75,184,173,66,220,48,122,70,253,59,212,22,7,61,30,209,5,27,21,105,232,182,3,154,211,145,124,238,103,171,197,131,77,20,118,239,61,252,17,150,4,150,113,54,117,150,121,158,140,250,253,245,122,237,173,31,122,34,93,244,47,7,131,1,18,59,68,137,159,58,32,223,33,82,173,90,223,123,248,12,132,248,60,245,67,70,252,205,212,185,2,188,95,170,239,116,234,60,186,114,72,6,91,116,199,166,206,44,4,187,204,99,79,11,121,232,144,57,15,195,169,19,162,130,5,198,211,33,125,37,22,85,195,170,221,169,123,148,178,132,81,76,77,189,170,227,18,145,113,185,1,16,50,130,97,59,153,187,243,80,128,144,144,205,243,177,128,84,226,121,57,242,134,99,200,142,88,75,208,80,226,93,101,85,192,61,10,105,176,98,91,195,50,220,77,250,170,98,39,17,203,41,137,105,196,166,237,21,103,107,76,181,54,193,141,132,164,152,182,149,179,1,91,113,95,123,222,229,49,40,162,97,15,242,36,100,211,97,55,162,27,30,21,145,125,86,117,8,15,116,6,207,177,104,223,76,250,170,121,96,119,184,153,4,124,69,252,144,102,217,180,109,243,165,173,192,60,152,182,85,221,180,111,110,229,55,9,1,61,233,3,178,162,136,68,192,128,96,194,227,164,200,73,94,38,96,186,191,100,254,221,76,108,218,146,2,21,125,72,5,72,96,64,7,134,176,144,204,69,186,135,120,45,191,73,206,178,124,210,151,68,55,123,154,116,149,182,27,70,55,235,226,56,78,153,129,187,244,207,118,93,232,81,178,20,19,168,162,59,252,11,137,192,147,156,100,169,15,38,121,31,209,247,190,130,25,220,205,188,136,101,161,147,231,46,15,58,100,123,209,74,89,94,164,49,9,132,95,68,176,149,222,130,229,207,66,134,203,167,229,139,0,169,198,23,187,139,139,21,77,201,10,154,132,72,201,20,217,34,200,188,17,46,90,155,17,25,120,131,46,172,74,187,250,100,86,59,248,175,226,168,136,19,158,251,75,75,134,121,59,34,150,157,174,225,161,98,220,141,149,218,156,161,61,121,90,42,205,106,227,145,114,139,210,87,34,204,177,5,24,70,191,72,83,48,222,62,135,66,36,111,120,4,4,131,74,228,162,224,100,10,178,138,4,154,6,123,1,73,156,174,40,152,18,23,97,8,60,98,246,81,153,107,116,105,120,171,150,23,22,8,70,92,180,48,217,71,196,70,215,149,161,109,217,160,194,65,242,108,5,139,151,60,131,122,97,169,11,53,148,241,25,15,161,200,252,37,141,23,172,221,69,163,60,17,191,181,136,31,37,2,194,223,106,73,212,236,163,167,236,129,56,60,119,29,181,118,26,248,154,125,138,168,6,64,74,77,218,116,27,40,51,150,155,39,183,34,232,18,232,128,40,95,186,168,96,135,78,86,244,170,20,93,203,113,232,204,33,55,159,19,215,134,169,10,202,173,114,97,74,218,75,30,4,44,110,43,234,86,191,79,94,204,201,44,21,107,232,30,80,38,34,99,1,194,231,148,135,25,157,51,15,60,249,249,86,154,208,218,105,51,244,137,244,239,34,154,177,180,110,65,92,153,16,163,174,129,86,162,75,162,13,9,52,24,180,149,168,11,11,6,218,7,128,147,159,118,199,203,66,104,121,238,160,75,174,246,34,117,171,115,167,230,241,246,96,43,61,30,67,58,252,242,230,213,75,216,5,68,53,140,117,109,234,123,58,205,59,160,219,121,75,62,19,7,22,95,162,215,101,32,233,159,0,253,75,91,6,200,89,209,153,242,24,219,146,11,89,78,214,153,170,181,181,172,179,198,71,103,125,85,133,246,51,167,97,198,0,197,210,20,78,33,114,12,181,95,111,149,60,107,209,65,49,158,42,46,56,144,105,106,179,118,157,237,101,181,76,1,108,26,114,75,1,45,125,138,217,154,252,206,102,183,194,191,99,185,235,123,107,73,166,208,80,124,34,129,105,103,106,85,105,77,18,111,75,47,79,11,38,153,118,13,86,233,245,159,241,202,56,28,97,142,88,150,193,238,214,216,137,203,86,114,255,148,16,249,224,225,132,227,209,52,165,229,211,98,62,135,253,238,120,249,146,197,238,76,62,145,233,13,217,130,184,132,166,25,147,237,198,69,119,127,227,113,126,253,4,153,52,93,167,179,235,24,27,180,17,123,13,1,62,205,158,96,73,32,205,7,54,100,7,123,118,200,101,73,94,179,255,22,112,128,202,150,162,36,236,136,79,225,48,112,153,246,241,156,253,60,17,76,128,154,240,219,221,129,51,57,19,33,131,4,95,184,170,137,238,78,117,50,23,227,90,245,2,171,163,83,203,29,104,44,113,224,194,88,4,121,227,225,225,231,118,26,77,166,10,122,61,83,103,60,166,105,249,147,21,159,173,241,252,171,195,223,13,222,27,255,105,198,200,245,163,145,73,154,90,232,178,4,156,97,117,105,210,197,214,44,101,244,174,110,197,126,184,235,182,124,173,147,86,214,158,167,7,118,125,201,225,125,89,191,98,152,246,28,217,217,182,99,186,184,62,232,177,149,31,214,189,154,66,228,30,120,27,221,95,160,119,143,247,80,229,105,212,167,163,40,117,74,122,56,147,156,64,201,225,229,56,10,102,23,43,80,249,35,29,82,238,43,119,142,119,49,29,160,228,21,24,166,251,211,147,90,129,15,31,201,216,107,170,85,141,170,86,214,117,25,250,16,106,125,136,69,26,13,235,250,160,134,10,93,107,230,36,147,160,7,195,206,125,44,202,129,225,44,64,242,240,113,131,21,6,254,46,244,227,168,75,196,124,14,251,162,119,2,192,239,20,224,189,244,222,5,146,155,155,235,206,223,46,175,174,198,77,130,7,195,247,104,120,17,105,156,212,4,179,230,111,7,202,48,79,155,122,180,185,178,196,160,29,72,10,163,119,50,185,134,211,173,6,1,69,38,6,106,70,61,17,113,25,75,168,62,176,234,135,31,246,99,252,78,90,59,172,129,117,84,220,58,85,151,24,164,12,182,219,200,204,78,215,28,126,151,157,111,144,83,86,114,30,125,139,156,79,149,156,199,255,167,156,122,21,160,180,235,111,147,131,133,134,98,134,131,111,147,3,165,39,125,27,94,170,1,215,102,75,85,20,58,31,108,23,58,39,41,174,31,157,76,138,243,148,200,86,119,216,27,223,24,188,82,124,48,225,97,29,25,119,109,125,236,243,118,33,25,250,67,85,179,173,131,161,239,76,17,143,143,137,48,243,224,121,34,174,117,255,190,184,144,55,86,34,226,91,249,198,232,57,141,88,66,3,244,16,207,97,56,148,113,199,92,152,123,187,36,128,59,254,140,198,65,151,224,43,63,124,185,161,35,177,228,25,78,198,160,25,233,12,196,144,3,216,46,63,127,198,203,221,149,165,49,130,128,198,44,209,43,131,230,153,60,152,235,35,131,132,215,239,179,173,250,69,182,126,149,85,99,131,25,67,77,190,24,99,15,111,118,78,36,10,184,148,136,117,236,96,86,154,49,14,102,51,201,35,31,225,106,144,230,26,211,25,127,89,156,124,59,154,33,3,202,59,79,220,25,6,22,137,163,26,194,81,137,63,131,175,217,242,76,11,165,60,81,228,74,224,95,36,15,134,193,21,59,233,241,87,201,147,17,132,193,230,175,178,79,202,243,105,236,179,16,68,158,41,239,12,151,177,79,159,206,25,108,49,174,186,71,145,175,176,243,12,161,56,50,215,101,202,100,175,37,86,45,227,171,74,50,115,182,213,47,27,0,42,71,75,92,71,189,72,116,154,242,116,88,142,10,60,86,154,48,223,77,177,14,247,193,229,30,88,95,130,241,22,62,232,156,176,42,149,241,109,24,214,218,239,31,110,77,73,211,114,25,40,158,189,193,144,154,88,73,47,112,202,195,169,249,192,13,68,160,249,174,97,35,127,87,124,30,4,21,90,170,132,177,12,14,27,48,18,223,172,255,135,140,52,129,126,238,144,94,131,195,83,3,206,75,54,7,221,125,98,125,84,224,223,241,165,235,253,203,222,208,40,47,191,70,249,31,123,202,255,56,161,252,141,72,142,232,254,69,190,60,55,202,241,122,241,138,230,75,143,206,50,119,211,33,147,41,105,116,242,142,140,203,224,128,180,60,70,90,214,73,55,228,134,12,21,251,176,130,77,72,79,1,43,245,165,34,44,235,132,165,38,44,235,132,223,213,179,80,95,133,172,117,45,171,124,167,201,155,185,249,221,116,10,106,225,48,106,230,38,130,245,233,222,170,167,134,41,153,221,145,36,39,155,99,57,222,43,117,150,162,110,43,74,139,110,100,254,166,11,42,199,22,124,42,161,229,37,14,147,186,193,215,60,209,228,251,126,175,250,209,225,87,253,155,3,166,211,6,46,11,253,75,188,46,224,123,165,123,242,93,146,91,54,129,78,227,74,167,95,141,87,87,32,183,170,27,249,222,155,232,251,204,222,232,224,62,119,29,137,119,112,184,147,167,189,10,179,4,218,201,193,36,187,122,55,126,90,148,194,163,172,154,40,5,220,147,5,210,61,101,39,62,43,146,10,128,19,94,195,2,119,213,184,149,214,174,131,83,178,242,54,154,165,169,201,240,244,239,223,135,191,228,62,121,42,130,146,72,86,136,179,50,142,192,191,156,69,137,72,97,226,34,185,32,140,102,37,129,11,27,199,119,23,228,197,191,36,103,95,231,198,145,247,191,158,252,169,131,5,58,91,142,95,114,87,158,204,176,19,247,92,101,191,76,64,61,240,154,244,109,222,193,45,101,243,254,109,196,171,249,80,229,129,141,36,90,108,214,122,208,52,143,235,204,44,171,159,47,250,234,55,161,190,252,141,249,127,179,210,139,222,106,30,0,0};
06a93de928dbe5959e25c0d67ba960aa112374c9
984e09bfc02844a034656ca7eaba723d9731026c
/ftp_serive_project/inc/ftp_client.h
f5db26b56c92b42b45af4a5d5152152ed5064b85
[]
no_license
yunyanfuhua/-linux-ftpserver
23be320fdd5bb67ce16e0040c7400f78eacc2d18
dd9b348be75efff6faafbc26e71b9019e9520ea9
refs/heads/master
2020-07-05T00:06:55.302495
2019-08-15T03:14:21
2019-08-15T03:14:21
202,464,463
0
0
null
null
null
null
UTF-8
C
false
false
451
h
ftp_client.h
#ifndef __FTP_CLIENT__ #define __FTP_CLIEND__ #include<stdio.h> #include<sys/socket.h> #include<sys/types.h> #include<stdio.h> #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> #include <stdlib.h> int sen_get(int ,char*); int sen_put(int ,char*); int sen_bye(int); enum CMD_NO { CMD_LS = 1024, CMD_PUT, CMD_GET, CMD_BYE }; #endif
078daeef767b845abad8deacdec1ab3009294b52
691203c8e5dab2c1120110336957b7cda00d3d4a
/20210115/20210115_9.c
5a2248f648bf926859b67dc9f0cdaa1b0ab65fc6
[]
no_license
todorova98/Code-Academy
8471f92ea0fc36649e28aab61c69e91694540446
07da38b664e15681bf60ac8e0afe656692e3db9c
refs/heads/main
2023-06-07T13:46:04.612354
2021-06-30T15:02:41
2021-06-30T15:02:41
326,619,520
0
1
null
null
null
null
UTF-8
C
false
false
196
c
20210115_9.c
#include <stdio.h> int main(){ char s[ ] = "Hi"; unsigned int i=0; while(s[i]!='\0'){ printf("%c", s[i]); i++; } printf("\ni = %d",i); return 0; }
21726f46e9f835f2de79e1ae011b2bf9deee907c
adb6b5a8d66faf15589770566b7c134c4dd9800c
/srcs/ray_cast.c
d9ec3f317b5392ea37a8b3c393afcc74d1a45aae
[]
no_license
schaaban42/wolf3d
330bc1ae43dda6472a6d3d8e15a13bb4d5278024
e5e09113bfb56b0e237532105d47b14c921ebd0f
refs/heads/master
2020-03-08T04:30:15.067718
2018-06-08T00:12:47
2018-06-08T00:12:47
127,923,595
0
0
null
null
null
null
UTF-8
C
false
false
3,421
c
ray_cast.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ray_cast.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: schaaban <schaaban@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/04/27 14:02:10 by schaaban #+# #+# */ /* Updated: 2018/06/01 14:55:15 by schaaban ### ########.fr */ /* */ /* ************************************************************************** */ #include "wolf3d.h" static void ray_wall_h(int hit[2], t_ray *ray, t_wolf *wolf) { double xa; double ya; ya = (a_is_up(ray->angle)) ? -WALL_SIZE : WALL_SIZE; xa = ya / tan(ray->angle); while (!hit[0]) { if (ray->a_h[0] < 0 || ray->a_h[0] >= (wolf->map_w * WALL_SIZE) || ray->a_h[1] < 0 || ray->a_h[1] >= (wolf->map_h * WALL_SIZE)) { hit[0] = 2; break ; } if ((ray->map_v[0] = wolf->map[(int)(ray->a_h[1] / WALL_SIZE)] [(int)(ray->a_h[0] / WALL_SIZE)]) != 0) { hit[0] = 1; break ; } ray->a_h[0] = ray->a_h[0] + xa; ray->a_h[1] = ray->a_h[1] + ya; } ray->a_h[1] += ((a_is_up(ray->angle)) ? 1.0 : 0); } static void ray_wall_v(int hit[2], t_ray *ray, t_wolf *wolf) { double xa; double ya; xa = (a_is_left(ray->angle)) ? -WALL_SIZE : WALL_SIZE; ya = xa * tan(ray->angle); while (!hit[1]) { if (ray->a_v[0] < 0 || ray->a_v[0] >= (wolf->map_w * WALL_SIZE) || ray->a_v[1] < 0 || ray->a_v[1] >= (wolf->map_h * WALL_SIZE)) { hit[1] = 2; break ; } if ((ray->map_v[1] = wolf->map[(int)(ray->a_v[1] / WALL_SIZE)] [(int)(ray->a_v[0] / WALL_SIZE)]) != 0) { hit[1] = 1; break ; } ray->a_v[0] = ray->a_v[0] + xa; ray->a_v[1] = ray->a_v[1] + ya; } ray->a_v[0] += ((a_is_left(ray->angle)) ? 1.0 : 0); } static int ray_return(int hit[2], t_ray *ray, t_wolf *wolf) { if (hit[0] == 1 && hit[1] == 1) { if (ft_raylen(ray->a_h, wolf->player->pos) < ft_raylen(ray->a_v, wolf->player->pos)) { ray->side = (a_is_up(ray->angle)) ? O_NORTH : O_SOUTH; return (W_HORIZONTAL); } ray->side = (a_is_left(ray->angle)) ? O_EAST : O_WEST; return (W_VERTICAL); } if (hit[0] == 1) { ray->side = (a_is_up(ray->angle)) ? O_NORTH : O_SOUTH; return (W_HORIZONTAL); } else if (hit[1] == 1) { ray->side = (a_is_left(ray->angle)) ? O_EAST : O_WEST; return (W_VERTICAL); } return (-1); } void ray_cast(double pos[2], t_ray *ray, t_wolf *wolf) { int hit[2]; int r_return; hit[0] = 0; hit[1] = 0; get_closer_h(pos, ray) ? ray_wall_h(hit, ray, wolf) : 0; get_closer_v(pos, ray) ? ray_wall_v(hit, ray, wolf) : 0; r_return = ray_return(hit, ray, wolf); if (r_return == -1) error_handler(W_ERROR_RAY, wolf); if (r_return == W_HORIZONTAL) { ray->pos[0] = ray->a_h[0]; ray->pos[1] = ray->a_h[1]; ray->map_v[2] = ray->map_v[0]; ray->wall_x = (int)ray->pos[0] % WALL_SIZE; } else { ray->pos[0] = ray->a_v[0]; ray->pos[1] = ray->a_v[1]; ray->map_v[2] = ray->map_v[1]; ray->wall_x = (int)ray->pos[1] % WALL_SIZE; } }
5468b8f36d85d13c405fab749657c4e363d93e66
c4afbfe1885e8d0c7a1c8b928563f7bb8ab6a683
/Simulation_EnvSim/isLEValid_TargetLimits_Pkg.c
ddc5311646876b5bfbb6e80686e2b849655a7808
[]
no_license
VladislavLasmann/srcAndBinary
cd48ebaa2f1f7f697ba5df9f38abb9ed50658e10
13aa76e545b9596f6dac84fb20480dffae7584d8
refs/heads/master
2021-05-08T15:04:05.709079
2016-01-22T12:40:10
2016-01-22T12:40:10
null
0
0
null
null
null
null
UTF-8
C
false
false
1,030
c
isLEValid_TargetLimits_Pkg.c
/* $*************** KCG Version 6.1.3 (build i6) **************** ** Command: s2c613 -config S:/model/Scade/System/OBU_PreIntegrations/Testbench_Integration/Simulation_EnvSim\kcg_s2c_config.txt ** Generation date: 2015-11-23T09:24:22 *************************************************************$ */ #include "kcg_consts.h" #include "kcg_sensors.h" #include "isLEValid_TargetLimits_Pkg.h" /* TargetLimits_Pkg::isLEValid */ kcg_bool isLEValid_TargetLimits_Pkg( /* TargetLimits_Pkg::isLEValid::valid1 */kcg_bool valid1, /* TargetLimits_Pkg::isLEValid::i1 */kcg_real i1, /* TargetLimits_Pkg::isLEValid::valid2 */kcg_bool valid2, /* TargetLimits_Pkg::isLEValid::i2 */kcg_real i2) { /* TargetLimits_Pkg::isLEValid::result */ static kcg_bool result; result = valid1 & ((i1 <= i2) | !valid2); return result; } /* $*************** KCG Version 6.1.3 (build i6) **************** ** isLEValid_TargetLimits_Pkg.c ** Generation date: 2015-11-23T09:24:22 *************************************************************$ */
f3f27b1b96abcd5c722959f502752f56f2e71786
6abdda4bbb1204f92122ad9e5a63713bf12dabee
/Example/Pods/Headers/Private/LinkedME_iOS/LMSpotlightUrlRequest.h
74a36d956f3c22eafeb063982a34bbf6a319a177
[ "MIT" ]
permissive
WFC-LinkedME/LinkedME-iOS-Deep-Linking-SDK
debdec065b4768ae30b31c2a2db0c4c45b7aa87d
dfad510ab560fe483804a2c2a2f14756c49a176e
refs/heads/master
2021-07-01T07:57:20.873793
2021-03-16T09:08:53
2021-03-16T09:08:53
225,335,463
0
1
null
null
null
null
UTF-8
C
false
false
59
h
LMSpotlightUrlRequest.h
../../../../../LinkedME_iOS/Classes/LMSpotlightUrlRequest.h
a78635e828978d0472dcead26d01c08c3fb441f1
b41882f25076484dedb7112b7983a0c33d8f7aa7
/network.c
dc4a3492bf8e5051e40a087fad9303423cb864d0
[]
no_license
GavinPong/dev_communicate
8f3c68d502410f5a63e15b7c59fc3acf6a99eb24
08c48a9dde7f3b9b67ed1f997e3f9bebd13c3f15
refs/heads/master
2020-03-18T21:12:14.986935
2018-05-29T08:38:34
2018-05-29T08:38:34
135,266,205
0
0
null
null
null
null
GB18030
C
false
false
29,451
c
network.c
/****************下一步需要改善的地方 1、parse_ip_from_str使用一个独立的线程去执行,避免gethostbyname阻塞接口 2、多播协议还要进一步做实验,验证其属性 ********************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <sys/select.h> #include <sys/time.h> #include <netdb.h> #include <unistd.h> #include "network.h" #ifdef LINUX_PLATFORM #define Sleep(x) usleep((x) * 1000) #endif #define SOCK_ARRY_DEF 100 //套接字数组默认大小 #define SOCK_ARRY_STEP 50 //套接字数组增大步长 #define LISTEN_CNT 5 //listen接口队列大小 #define DST_IP_MAX 64 //目标ip数组大小 #define SOCKET_ERROR -1 #ifndef DBG_PRINTF #define DBG_PRINTF printf #endif #define NET_HANDLE_2_SOCK_ID(m) (int )(m) typedef struct _net_param_s { int m_sock; net_protocol_type_e m_sock_protocol; server_callback m_callback; pthread_mutex_t m_mutex; }net_param_t; typedef struct _network_ctx_s { net_param_t *m_sock_param_arry_ptr; //套接字数组指正 char m_arry_status; //数组是否被被申请状态 int m_cur_arry_max; //当前数组大小 }network_ctx_t, *pnetwork_ctx_t; typedef struct _accept_ctx_s { net_param_t m_net_param; addr_info_t m_addr_info; }accept_ctx_t; static network_ctx_t s_network_ctx; static int parse_ip_from_str(char *src, char *dst_buf, int buf_size) { if (!src || !dst_buf || !buf_size) { DBG_PRINTF("%s:param invalid\n", __FUNCTION__); return -1; } struct hostent *host = NULL; struct in_addr dst_addr; char str[64] = ""; memset(dst_buf, 0, buf_size); if (1 == inet_pton(AF_INET, src, &dst_addr)) { memcpy(dst_buf, src, buf_size); return 0; } host = gethostbyname(src); if (host) { memcpy(dst_buf, inet_ntop(host->h_addrtype, host->h_addr, str, sizeof(str)), buf_size); return 0; } return -1; } static int network_alloc(network_ctx_t *network_ctx_ptr, int *available_sock_id) { if (!network_ctx_ptr) { return NETWORK_ERR_INVALIDPARAM; } int i = 0; if (0 == s_network_ctx.m_arry_status) { s_network_ctx.m_arry_status = 1; s_network_ctx.m_sock_param_arry_ptr = (net_param_t *)calloc(SOCK_ARRY_DEF, sizeof(net_param_t)); if (!s_network_ctx.m_sock_param_arry_ptr) { return NETWORK_ERR_NOMEMORY; } s_network_ctx.m_cur_arry_max = SOCK_ARRY_DEF; } for (; i < s_network_ctx.m_cur_arry_max;i++) { if (0 == s_network_ctx.m_sock_param_arry_ptr[i].m_sock) { *available_sock_id = i; break; } } if ((i >= s_network_ctx.m_cur_arry_max) && (0 != s_network_ctx.m_arry_status)) { char *new_ptr = (char *)realloc(s_network_ctx.m_sock_param_arry_ptr, (s_network_ctx.m_cur_arry_max + SOCK_ARRY_STEP) * sizeof(net_param_t)); if (!new_ptr) { return NETWORK_ERR_NOMEMORY; } //清空新增内存 memset(new_ptr + s_network_ctx.m_cur_arry_max, 0, SOCK_ARRY_STEP * sizeof(int)); *available_sock_id = s_network_ctx.m_cur_arry_max; s_network_ctx.m_cur_arry_max += SOCK_ARRY_STEP; } return NETWORK_OK; } void *udp_server_process(void *param) { if (!param) { return NULL; } net_param_t *p_net_param = (net_param_t *)param; addr_info_t addr_info; addr_info.m_sock = p_net_param->m_sock; addr_info.m_data_len = 0; if (p_net_param->m_callback) { p_net_param->m_callback(&addr_info); } free(p_net_param); } void *broadcast_server_process(void *param) { if (!param) { return NULL; } net_param_t *p_net_param = (net_param_t *)param; addr_info_t addr_info; addr_info.m_sock = p_net_param->m_sock; addr_info.m_data_len = 0; if (p_net_param->m_callback) { p_net_param->m_callback(&addr_info); } free(p_net_param); } void *multicast_server_process(void *param) { if (!param) { return NULL; } net_param_t *p_net_param = (net_param_t *)param; addr_info_t addr_info; addr_info.m_sock = p_net_param->m_sock; addr_info.m_data_len = 0; if (p_net_param->m_callback) { p_net_param->m_callback(&addr_info); } free(p_net_param); } void *tcp_server_process(void *param) { if (!param) { return NULL; } accept_ctx_t *p_accept_ctx = (accept_ctx_t *)param; p_accept_ctx->m_addr_info; if (p_accept_ctx->m_net_param.m_callback) { //DBG_PRINTF("%d:callback\n", __LINE__); p_accept_ctx->m_net_param.m_callback(&p_accept_ctx->m_addr_info); } else { //DBG_PRINTF("%d: exit callback\n", __LINE__); } free(p_accept_ctx); return NULL; } void *server_accpet(void *param) { int client_sock = -1; struct sockaddr_in client_addr; int client_addr_len = 0; accept_ctx_t *p_accept_ctx = (accept_ctx_t *)param; int sockfd = p_accept_ctx->m_net_param.m_sock; pthread_t thread; while(1) { memset(&client_addr, 0, sizeof(client_addr)); client_sock = accept(sockfd, (struct sockaddr*)&client_addr, &client_addr_len); if (client_sock < 0) { break; } p_accept_ctx->m_net_param.m_sock = client_sock; p_accept_ctx->m_addr_info.m_sock =client_sock; p_accept_ctx->m_addr_info.m_data_len = client_addr_len; memcpy(p_accept_ctx->m_addr_info.data, &client_addr, sizeof(client_addr)); if (!pthread_create(&thread, NULL, tcp_server_process, (void *)p_accept_ctx)) { pthread_detach(thread); } else { close(client_sock); free(p_accept_ctx); return NULL; } } return NULL; } static int open_tcp(net_info_t net_info) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } if(connect(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_CONNECT; } return sockfd; } static int open_udp(net_info_t net_info) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } //使用connet绑定sockfd和目标地址,以便直接使用tcp接口去操作,保证接口的简单性,和程序的稳定性 if(connect(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_CONNECT; } return sockfd; } static int open_broadcast(net_info_t net_info) { int sockfd = -1; struct sockaddr_in bc_addr; char dst_ip[DST_IP_MAX] = ""; int so_broadcast = 1; int ret = -1; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&bc_addr, 0, sizeof(bc_addr)); bc_addr.sin_family = net_info.m_family; bc_addr.sin_port = htons(net_info.m_dev_port); inet_pton(bc_addr.sin_family, dst_ip, &bc_addr.sin_addr); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &so_broadcast, sizeof(so_broadcast)); //使用connet绑定sockfd和目标地址,以便直接使用tcp接口去操作,保证接口的简单性,和程序的稳定性 if(connect(sockfd, (struct sockaddr *)&bc_addr, sizeof(bc_addr))) { close(sockfd); return NETWORK_ERR_CONNECT; } return sockfd; } static int open_multicast(net_info_t net_info) { int sockfd = -1; char dst_ip[DST_IP_MAX] = ""; struct sockaddr_in multi_addr; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } memset(&multi_addr, 0, sizeof(multi_addr)); multi_addr.sin_family = net_info.m_family; multi_addr.sin_port = htons(net_info.m_dev_port); inet_pton(multi_addr.sin_family, dst_ip, &multi_addr.sin_addr); if(connect(sockfd, (struct sockaddr *)&multi_addr, sizeof(multi_addr))) { close(sockfd); return NETWORK_ERR_CONNECT; } return sockfd; } static int close_tcp(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_udp(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_broadcast(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_multicast(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int open_tcp_server(net_info_t net_info, server_callback callback) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; pthread_t thread; accept_ctx_t *p_accept_ctx = NULL; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } if(bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_BIND; } if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } listen(sockfd, LISTEN_CNT); p_accept_ctx = (accept_ctx_t *)calloc(1, sizeof(accept_ctx_t) + sizeof(struct sockaddr_in)); if (!p_accept_ctx) { close(sockfd); return NETWORK_ERR_NOMEMORY; } p_accept_ctx->m_net_param.m_sock = sockfd; p_accept_ctx->m_net_param.m_callback = callback; p_accept_ctx->m_net_param.m_sock_protocol = net_info.m_pro_type; if (!pthread_create(&thread, NULL, server_accpet, (void *)p_accept_ctx)) { pthread_detach(thread); } else { close(sockfd); free(p_accept_ctx); return NETWORK_ERR_THREAD; } return sockfd; } static int open_udp_server(net_info_t net_info, server_callback callback) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; pthread_t thread; net_param_t *p_net_param = (net_param_t *)calloc(1, sizeof(net_param_t)); if (!p_net_param) { return NETWORK_ERR_NOMEMORY; } if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } #if 0 int flags = fcntl(sockfd, F_GETFL, 0); if (flags >= 0) { fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); } #endif if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_BIND; } if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } p_net_param->m_callback = callback; p_net_param->m_sock = sockfd; p_net_param->m_sock_protocol = net_info.m_pro_type; if (!pthread_create(&thread, NULL, udp_server_process, (void *)p_net_param)) { pthread_detach(thread); } else { close(sockfd); free(p_net_param); return NETWORK_ERR_THREAD; } return sockfd; } static int open_broadcast_server(net_info_t net_info, server_callback callback) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; pthread_t thread; net_param_t *p_net_param = (net_param_t *)calloc(1, sizeof(net_param_t)); if (!p_net_param) { return NETWORK_ERR_NOMEMORY; } if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } #if 0 int flags = fcntl(sockfd, F_GETFL, 0); if (flags >= 0) { fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); } #endif if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_BIND; } if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } p_net_param->m_callback = callback; p_net_param->m_sock = sockfd; p_net_param->m_sock_protocol = net_info.m_pro_type; if (!pthread_create(&thread, NULL, broadcast_server_process, (void *)p_net_param)) { pthread_detach(thread); } else { close(sockfd); free(p_net_param); return NETWORK_ERR_THREAD; } return sockfd; } static int open_multicast_server(net_info_t net_info, server_callback callback) { struct sockaddr_in server_addr; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; int ret = -1; pthread_t thread; net_param_t *p_net_param = (net_param_t *)calloc(1, sizeof(net_param_t)); if (!p_net_param) { return NETWORK_ERR_NOMEMORY; } if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = net_info.m_family; server_addr.sin_port = htons(net_info.m_dev_port); inet_pton(server_addr.sin_family, dst_ip, &server_addr.sin_addr); sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { return NETWORK_ERR_SOCKED; } #if 0 int flags = fcntl(sockfd, F_GETFL, 0); if (flags >= 0) { fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); } #endif if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))) { close(sockfd); return NETWORK_ERR_BIND; } //add to multicast struct ip_mreq mreq; memset(&mreq, 0, sizeof(mreq)); //本机地址 mreq.imr_interface.s_addr = htonl(INADDR_ANY); //多播地址 inet_pton(AF_INET, dst_ip, &mreq.imr_multiaddr); //加多播组 ret = setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP,(void *)&mreq, sizeof(mreq)); if (net_info.m_timeout) { struct timeval timeo; socklen_t len = sizeof(struct timeval); timeo.tv_sec = net_info.m_timeout; timeo.tv_usec = 0; setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &timeo, len); } if (net_info.m_recvbuf_size) { int recvbuf_size = net_info.m_recvbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&recvbuf_size, sizeof(int)); } if (net_info.m_sendbuf_size) { int sendbuf_size = net_info.m_sendbuf_size; setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sendbuf_size, sizeof(int)); } p_net_param->m_callback = callback; p_net_param->m_sock = sockfd; p_net_param->m_sock_protocol = net_info.m_pro_type; if (!pthread_create(&thread, NULL, multicast_server_process, (void *)p_net_param)) { pthread_detach(thread); } else { close(sockfd); free(p_net_param); return NETWORK_ERR_THREAD; } return sockfd; } static int close_tcp_server(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_udp_server(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_broadcast_server(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int close_multicast_server(int sockid) { if (sockid > s_network_ctx.m_cur_arry_max) { return NETWORK_ERR_INVALIDPARAM; } int ret = -1; int sockfd = s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock = 0; s_network_ctx.m_sock_param_arry_ptr[sockid].m_sock_protocol = NET_PROTOCOL_TYPE_NULL; shutdown(sockfd, 2); close(sockfd); return NETWORK_OK; } static int recv_tcp(int sockfd, char *buf, int buf_size) { if (!buf || !buf_size) { return NETWORK_ERR_INVALIDPARAM; } return recv(sockfd, buf, buf_size, 0); // int ret = -1; // int off = 0; // int len1 = buf_size; // // while(len1 > 0) // { // ret = recv(sockfd, buf + off, len1, 0); // if (0 == ret || SOCKET_ERROR == ret) // { // return NETWORK_ERR_RECV; // } // else // { // len1 -= ret; // off += ret; // if (len1 > 0) // { // Sleep(1); // } // } // } // return NETWORK_OK; } static int recv_udp(int sockfd, char *buf, int buf_size) { if (!buf || !buf_size) { return NETWORK_ERR_INVALIDPARAM; } return recv_tcp(sockfd, buf, buf_size); // int ret = -1; // int off = 0; // int len1 = buf_size; // // while(len1 > 0) // { // ret = recv(sockfd, buf + off, len1, 0); // if (0 == ret || SOCKET_ERROR == ret) // { // return NETWORK_ERR_RECV; // } // else // { // len1 -= ret; // off += ret; // if (len1 > 0) // { // Sleep(1); // } // } // } // // return NETWORK_OK; } static int send_tcp(int sockfd, char *buf, int buf_size) { if (!buf || !buf_size) { return NETWORK_ERR_INVALIDPARAM; } int off = 0; int ret = 0; while(buf_size > 0) { ret = send(sockfd, buf + off, buf_size, 0); if (0 == ret || SOCKET_ERROR == ret) { return NETWORK_ERR_SEND; } else { buf_size -= ret; off += ret; } } return NETWORK_OK; } static int send_udp(int sockfd, char *buf, int buf_size) { return send_tcp(sockfd, buf, buf_size); // if (!buf || !buf_size) // { // return NETWORK_ERR_INVALIDPARAM; // } // int off = 0; // int ret = 0; // // while(buf_size > 0) // { // ret = send(sockfd, buf + off, buf_size, 0); // if (0 == ret || SOCKET_ERROR == ret) // { // return NETWORK_ERR_SEND; // } // else // { // buf_size -= ret; // off += ret; // } // } // return NETWORK_OK; } static int recv_broadcast() { return NETWORK_OK; } static int recv_multicast() { return NETWORK_OK; } int network_client_open(net_handle_t *handle, net_info_t net_info) { if (!handle) { return NETWORK_ERR_INVALIDPARAM; } int ret = NETWORK_FALSE; int sock_id = 0; char dst_ip[DST_IP_MAX] = ""; int sockfd = -1; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; ret = network_alloc(&s_network_ctx, &sock_id); if(NETWORK_OK != ret) return ret; pthread_mutex_init(&s_network_ctx.m_sock_param_arry_ptr[sock_id].m_mutex,NULL); if (NET_PROTOCOL_TYPE_TCP == net_info.m_pro_type) { if((sockfd = open_tcp(net_info)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_UDP == net_info.m_pro_type) { if((sockfd = open_udp(net_info)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_BROADCAST == net_info.m_pro_type) { if((sockfd = open_broadcast(net_info)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_MULTICAST == net_info.m_pro_type) { if((sockfd = open_multicast(net_info)) < 0) return sockfd; } s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock = sockfd; s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol = net_info.m_pro_type; *handle = (net_handle_t)(sock_id); return NETWORK_OK; } int network_client_close(net_handle_t handle) { int sock_id = NET_HANDLE_2_SOCK_ID(handle); if (NET_PROTOCOL_TYPE_TCP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_tcp(sock_id); } else if (NET_PROTOCOL_TYPE_UDP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } else if (NET_PROTOCOL_TYPE_BROADCAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } else if (NET_PROTOCOL_TYPE_MULTICAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } return NETWORK_OK; } int network_server_open(net_handle_t *handle, net_info_t net_info, server_callback callback) { if (!handle) { return NETWORK_ERR_INVALIDPARAM; } int ret = NETWORK_FALSE; int sock_id = 0; char dst_ip[32] = ""; int sockfd = -1; if(parse_ip_from_str(net_info.m_dev_addr, dst_ip, sizeof(dst_ip)) < 0) return NETWORK_ERR_DEV_ADDR; ret = network_alloc(&s_network_ctx, &sock_id); if(NETWORK_OK != ret) return ret; pthread_mutex_init(&s_network_ctx.m_sock_param_arry_ptr[sock_id].m_mutex,NULL); if (NET_PROTOCOL_TYPE_TCP == net_info.m_pro_type) { if((sockfd = open_tcp_server(net_info, callback)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_UDP == net_info.m_pro_type) { if((sockfd = open_udp_server(net_info, callback)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_BROADCAST == net_info.m_pro_type) { if((sockfd = open_broadcast_server(net_info, callback)) < 0) return sockfd; } if (NET_PROTOCOL_TYPE_MULTICAST == net_info.m_pro_type) { if((sockfd = open_multicast_server(net_info, callback)) < 0) return sockfd; } s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock = sockfd; s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol = net_info.m_pro_type; s_network_ctx.m_sock_param_arry_ptr[sock_id].m_callback = callback; *handle = (net_handle_t)(sock_id); return NETWORK_OK; } int network_server_close(net_handle_t handle) { int sock_id = NET_HANDLE_2_SOCK_ID(handle); if (NET_PROTOCOL_TYPE_TCP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_tcp(sock_id); } else if (NET_PROTOCOL_TYPE_UDP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } else if (NET_PROTOCOL_TYPE_BROADCAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } else if (NET_PROTOCOL_TYPE_MULTICAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { close_udp(sock_id); } s_network_ctx.m_sock_param_arry_ptr[sock_id].m_callback = NULL; return NETWORK_OK; } int network_server_recv(int sockfd, char *recv_buf, int buf_size) { if (!recv_buf || !buf_size) { return NETWORK_ERR_INVALIDPARAM; } return recv_tcp(sockfd, recv_buf, buf_size); } int network_server_send(int sockfd, char *send_buf, int buf_size) { if (!send_buf || !buf_size) { return NETWORK_ERR_INVALIDPARAM; } int ret = -1; return send_tcp(sockfd, send_buf, buf_size); } int network_server_check_timeout(int sockfd, int millisecond) { fd_set read_set; struct timeval tvs; int ret = -1; FD_ZERO(&read_set); FD_SET(sockfd, &read_set); tvs.tv_sec = millisecond / 1000; tvs.tv_usec = (millisecond % 1000) * 1000; ret = select(sockfd + 1, &read_set, NULL, NULL, &tvs); if (ret < 0) { return NETWORK_ERR_SOCK_ABNORMAL; } if (0 == ret) { return NETWORK_ERR_TIMEOUT; } return NETWORK_OK; } int network_client_recv(net_handle_t handle, char *recv_buf, int buf_size) { int sock_id = NET_HANDLE_2_SOCK_ID(handle); int sockfd = s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock; if (NET_PROTOCOL_TYPE_TCP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { return recv_tcp(sockfd, recv_buf, buf_size); } else if (NET_PROTOCOL_TYPE_UDP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { return recv_udp(sockfd, recv_buf, buf_size); } else if (NET_PROTOCOL_TYPE_BROADCAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { return recv_udp(sockfd, recv_buf, buf_size); } else if (NET_PROTOCOL_TYPE_MULTICAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { return recv_udp(sockfd, recv_buf, buf_size); } } int network_client_send(net_handle_t handle, char *send_buf, int buf_size) { int sock_id = NET_HANDLE_2_SOCK_ID(handle); int sockfd = s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock; int ret = -1; pthread_mutex_lock(&s_network_ctx.m_sock_param_arry_ptr[sock_id].m_mutex); if (NET_PROTOCOL_TYPE_TCP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { ret = send_tcp(sockfd, send_buf, buf_size); } else if (NET_PROTOCOL_TYPE_UDP == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { ret = send_udp(sockfd, send_buf, buf_size); } else if (NET_PROTOCOL_TYPE_BROADCAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { ret = send_udp(sockfd, send_buf, buf_size); } else if (NET_PROTOCOL_TYPE_MULTICAST == s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock_protocol) { ret = send_udp(sockfd, send_buf, buf_size); } client_send: pthread_mutex_unlock(&s_network_ctx.m_sock_param_arry_ptr[sock_id].m_mutex); return ret; } int network_client_check_timeout(net_handle_t handle, int millisecond) { int sock_id = NET_HANDLE_2_SOCK_ID(handle); int sockfd = s_network_ctx.m_sock_param_arry_ptr[sock_id].m_sock; fd_set read_set; struct timeval tvs; int ret = -1; FD_ZERO(&read_set); FD_SET(sockfd, &read_set); tvs.tv_sec = millisecond / 1000; tvs.tv_usec = (millisecond % 1000) * 1000; ret = select(sockfd + 1, &read_set, NULL, NULL, &tvs); if (ret < 0) { return NETWORK_ERR_SOCK_ABNORMAL; } if (0 == ret) { return NETWORK_ERR_TIMEOUT; } return NETWORK_OK; }
266e0e9089f1a1c61fbfc394ce6ea7a872db5b87
2435b825e44f4eb2b8c5288221f0d3cd8fed3e36
/ft_printf_format.c
6f6f2fe58900d21b0fc9b262515e15b3aed07858
[]
no_license
tayran-mila/ft_printf
2fb597fe249e7295c0b564e55ff9f7191ab42a98
754bf53eabc73612a6351d09247f070a3c63b0e9
refs/heads/master
2022-11-28T13:35:34.866119
2020-08-07T11:59:36
2020-08-07T11:59:36
279,971,004
0
0
null
null
null
null
UTF-8
C
false
false
3,215
c
ft_printf_format.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf_format.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tmendes- <tmendes-@student.42sp.org.br> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/07/18 08:20:06 by tmendes- #+# #+# */ /* Updated: 2020/08/05 13:12:39 by tmendes- ### ########.fr */ /* */ /* ************************************************************************** */ #include "libftprintf.h" static char *repeat_chr(char chr, int nbr) { char *str; int k; if (!(str = (char *)malloc((nbr + 1) * sizeof(char)))) return (NULL); k = 0; while (k < nbr) { *(str + k) = chr; k++; } *(str + k) = 0; return (str); } static char *pad_aux(char *str, t_fields fld, char chr) { if ((*fld.str == '-' || *fld.str == '+' || *fld.str == ' ') && chr == 'p') fld.itg++; if (!(str = repeat_chr('0', fld.itg))) return (NULL); if ((*fld.str == '-' || *fld.str == ' ' || *fld.str == '+') && fld.itg != 0) { *str = *fld.str; *fld.str = '0'; } return (str); } char *pad_str(char *str, t_fields fld, int len, char chr) { fld.itg = len - ft_strlen(str); if (fld.itg >= 0) { if (fld.flag[4] && chr != 'p') fld.str = repeat_chr(' ', fld.itg); else { fld.str = str; if (fld.flag[3]) str = pad_aux(str, fld, chr); else str = repeat_chr(' ', fld.itg); } str = ft_concat(str, fld.str); free(fld.str); fld.str = NULL; } return (str); } char *signal_space(char *str, t_fields fld) { if (*str != '-') { fld.str = str; if (fld.flag[2]) str = ft_strdup("+"); else if (fld.flag[1]) str = ft_strdup(" "); else str = ft_strdup(""); str = ft_concat(str, fld.str); free(fld.str); fld.str = NULL; } return (str); } t_printf format_txt(t_printf ptf, va_list ap) { t_fields fld; fld = init_fields(); fld = set_fields(ptf.begin, ptf.end, fld); ptf.rtrn = fld.rtrn; if (fld.pnt_w) fld.width = va_arg(ap, int); if (fld.pnt_p) fld.prec = va_arg(ap, int); if (*ptf.end == 'c') return (c____type(ptf, fld, ap)); if (*ptf.end == 's') return (s____type(ptf, fld, ap)); if (*ptf.end == 'p') return (p____type(ptf, fld, ap)); if (*ptf.end == 'd' || *ptf.end == 'i') return (d____type(ptf, fld, ap)); if (*ptf.end == 'u') return (u____type(ptf, fld, ap)); if (*ptf.end == '%') return (p100_type(ptf, fld)); if (*ptf.end == 'x' || *ptf.end == 'X') return (x____type(ptf, fld, ap)); if (*ptf.end == 'n') return (n____type(ptf, fld, ap)); if (*ptf.end == 'f') return (f____type(ptf, fld, ap)); if (*ptf.end == 'g') return (g____type(ptf, fld, ap)); if (*ptf.end == 'e') return (e____type(ptf, fld, ap)); if (*ptf.end == 'o') return (o____type(ptf, fld, ap)); ptf.rtrn = -1; return (ptf); }
fe53e0e3499c2e02dd72e42ada9b3bfbfc512c1c
a78b4255c76bb1e292c17c86a50816473dfd6006
/src/langinfo/ABMON_2.h
98737148a435c36df93a3c587a4304ac17f053c0
[ "MIT" ]
permissive
ung-org/libc
be61b73696766d8ca003dd3e2e94d57ea695e151
55fc64c7ffd7792bc88451a736c2e94e5865282f
refs/heads/master
2022-12-01T22:24:51.479128
2020-08-17T19:39:58
2020-08-17T19:39:58
null
0
0
null
null
null
null
UTF-8
C
false
false
132
h
ABMON_2.h
#include <langinfo.h> #define ABMON_2 ((nl_item)35) /* XOPEN(4) POSIX(200809) */
b310cc5507f91e986e6a1425049e4b74c608c666
3fb08d439d469cb07e41120f94e051c7dcb8ce1e
/C2.5/full.c
8c11652d758f80d3e18aa861e6ecc039b15614e1
[ "MIT" ]
permissive
smwikipedia/EmbeddedAndRTOSSamples
9671ed54c833bf8b15c83062b5ac97d31175ade5
15af3015560ff0dc2445e7282f0fb9e7b37c4b19
refs/heads/master
2023-04-12T03:17:56.139516
2023-04-07T05:41:43
2023-04-07T05:41:43
205,616,217
17
2
null
null
null
null
UTF-8
C
false
false
1,625
c
full.c
int v[] = {1,2,3,4,5,6,7,8,9,10}; int sum; #define TXFE 0x80 #define TXFF 0x20 #define RXFE 0x10 #define RXFF 0x40 #define BUSY 0x08 #define UDR 0x00 #define UFR 0x18 typedef volatile struct uart { char *base; int n; }UART; UART uart[4]; int uart_init() { int i; UART *up; for(i=0; i<4; i++){ up = &uart[i]; up->base = (char *)(0x101F1000 + i*0x1000); up->n = i; } uart[3].base = (char *)(0x10009000); } char ugetc(UART *up) { while(*(up->base + UFR) & RXFE); return *(up->base + UDR); } void uputc(UART *up, char c) { while(*(up->base + UFR) & TXFF); *(up->base + UDR) = c; } void upgets(UART *up, char *s) { while((*s = ugetc(up))!='\r'){ uputc(up, *s); s++; } *s = 0; } void uprints(UART *up, char *s) { while(*s) { uputc(up, *s++); } } int strcmp(char *s1, char *s2) { while((*s1++==*s2++)&&(*s1!=0)&&(*s2!=0)); if(*s1==0 && *s2==0) { return 0; } return 1; } int main() { int i; char string[64]; UART *up; uart_init(); up = &uart[0]; uprints(up, "\n\rEnter lines from serial terminal 0\n\r"); while(1){ upgets(up, string); uprints(up, " "); uprints(up, string); uprints(up, "\n\r"); if(strcmp(string, "end")==0){ break; } } uprints(up, "Compute sum of array:\n\r"); sum = 0; for(i=0; i<10; i++){ sum += v[i]; } uprints(up, "sum = "); uputc(up, (sum/10)+'0'); uputc(up, (sum%10)+'0'); uprints(up, "\n\rEND OF RUN\n\r"); }
90abea2014fe4deab438de28fa28be577d31f654
09133107bcfa5f6c20a5dc88e0c03a3aea8f5137
/Basic-/reverpoiarr.c
1c940d754359eaa8c974c0cbbe97c716741ed4f9
[]
no_license
Sahitya7A/Practic_Problems
7cc511ec02eaf9176fd1953066eb545bcefddb31
dd609a007e8743b8aeea747672f1f8cd46da74d5
refs/heads/main
2023-07-16T01:55:14.906847
2021-08-31T09:05:39
2021-08-31T09:05:39
365,297,676
0
0
null
null
null
null
UTF-8
C
false
false
307
c
reverpoiarr.c
#include<stdio.h> void main() { int a[20],i,n,*p; printf("enter n value\n"); scanf("%d",&n); p=&a[0]; for(i=0;i<n;i++) { scanf("%d",p); p++; } p=&a[n-1]; for(i=n-1;i>=0;i--) { printf("%d at %d\n",i,*p); p--; } }
b235c7cb91f58fa520fb5605e8f849887eb1e8bd
202b96b76fc7e3270b7a4eec77d6e1fd7d080b12
/modules/rootstore/defcert/vsign_i2009_ssca.h
4bf49a0e00988d50d4bfd96995e78154519c65d3
[]
no_license
prestocore/browser
4a28dc7521137475a1be72a6fbb19bbe15ca9763
8c5977d18f4ed8aea10547829127d52bc612a725
refs/heads/master
2016-08-09T12:55:21.058966
1995-06-22T00:00:00
1995-06-22T00:00:00
51,481,663
98
66
null
null
null
null
UTF-8
C
false
false
6,758
h
vsign_i2009_ssca.h
/** vsign_i2009_ssca.h * Defines static array VERISIGN_INTERMEDIATE_2009_SSCA * Generated from binary file vsign_ssca_2009.pem * Date: Thu Jul 23 01:34:55 2009 */ #ifndef VSIGN_I2009_SSCA_H #define VSIGN_I2009_SSCA_H static const unsigned char VERISIGN_INTERMEDIATE_2009_SSCA[] = { 0x30, 0x82, 0x04, 0x17, 0x30, 0x82, 0x03, 0x80, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x7a, 0xa3, 0x6c, 0x63, 0x30, 0x1a, 0x83, 0x3e, 0xee, 0xf2, 0xe1, 0xcf, 0xd2, 0xad, 0x7e, 0x8e, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x35, 0x30, 0x31, 0x31, 0x39, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x31, 0x35, 0x30, 0x31, 0x31, 0x38, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x81, 0xb0, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x16, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x31, 0x3b, 0x30, 0x39, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x32, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x74, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x70, 0x61, 0x20, 0x28, 0x63, 0x29, 0x30, 0x35, 0x31, 0x2a, 0x30, 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x21, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0x95, 0xc3, 0x21, 0x12, 0x8e, 0x40, 0xc5, 0x0d, 0x01, 0x5f, 0x76, 0x5e, 0x66, 0x94, 0xd9, 0x73, 0x2c, 0x58, 0x19, 0x22, 0xb8, 0xc9, 0xfc, 0x7a, 0x39, 0x90, 0x2a, 0x77, 0x72, 0x7c, 0x1d, 0x3e, 0xf7, 0xd8, 0x55, 0xe3, 0xaf, 0x42, 0xcb, 0x87, 0x30, 0x02, 0xdc, 0x5b, 0xac, 0x70, 0xe6, 0xb8, 0x44, 0xb4, 0x2b, 0x35, 0xeb, 0x93, 0xd2, 0x17, 0x05, 0x7e, 0xcb, 0x46, 0xd6, 0x5c, 0x53, 0xa0, 0x32, 0x51, 0x9d, 0x74, 0x64, 0x58, 0xf9, 0x0c, 0x9a, 0x00, 0xea, 0x5e, 0x44, 0x49, 0x64, 0x72, 0xf4, 0xcd, 0x10, 0xe2, 0x85, 0x0a, 0xf9, 0x34, 0xee, 0xb3, 0x88, 0x66, 0xa9, 0xa5, 0xa4, 0x5a, 0xd0, 0x0e, 0x98, 0x7f, 0x58, 0x0d, 0x2b, 0x52, 0xbb, 0x86, 0xa9, 0x7e, 0x2e, 0xfa, 0xb2, 0x48, 0x7c, 0x8d, 0xdb, 0x2d, 0x5f, 0x01, 0x75, 0xa2, 0x8d, 0x06, 0x3b, 0x8b, 0xb4, 0x61, 0x07, 0xc9, 0xbe, 0x22, 0x99, 0xf8, 0x1b, 0xd1, 0xb5, 0x57, 0x66, 0x04, 0x4d, 0x35, 0xf4, 0x91, 0x71, 0x96, 0xb5, 0x99, 0x08, 0x25, 0x9b, 0x97, 0xc8, 0x3a, 0xf3, 0x20, 0xb1, 0xdd, 0x9e, 0x98, 0x0c, 0x4a, 0x63, 0xb7, 0xa6, 0xce, 0xb0, 0x01, 0xce, 0xf8, 0x93, 0x6a, 0xf3, 0x0c, 0x6e, 0x9f, 0xb1, 0xe9, 0x84, 0x7b, 0x81, 0x98, 0x41, 0xe6, 0x81, 0xdc, 0x3d, 0x2c, 0xe7, 0xb4, 0x6b, 0xe3, 0x9e, 0xfc, 0x08, 0x16, 0xd7, 0xb3, 0xd5, 0xb9, 0x66, 0x12, 0x99, 0x7c, 0x6d, 0x71, 0xc8, 0x4d, 0xbe, 0xc7, 0x0f, 0xe3, 0xfb, 0x37, 0xad, 0xd5, 0x75, 0x87, 0x21, 0x6b, 0x86, 0xd0, 0x44, 0x14, 0x5a, 0x54, 0x79, 0x39, 0x96, 0x69, 0x56, 0xc9, 0xb9, 0x31, 0xcd, 0x89, 0x61, 0x58, 0xe1, 0xd9, 0x76, 0x05, 0x05, 0xad, 0xf7, 0xb9, 0x02, 0xaf, 0xa7, 0xfd, 0x47, 0x91, 0xa2, 0x22, 0x34, 0x5a, 0x31, 0xd1, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xfd, 0x30, 0x81, 0xfa, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x44, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x3d, 0x30, 0x3b, 0x30, 0x39, 0x06, 0x0b, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x45, 0x01, 0x07, 0x17, 0x03, 0x30, 0x2a, 0x30, 0x28, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x70, 0x61, 0x30, 0x31, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x2a, 0x30, 0x28, 0x30, 0x26, 0xa0, 0x24, 0xa0, 0x22, 0x86, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x63, 0x61, 0x33, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x29, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x22, 0x30, 0x20, 0xa4, 0x1e, 0x30, 0x1c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x33, 0x43, 0x41, 0x32, 0x30, 0x34, 0x38, 0x2d, 0x31, 0x2d, 0x34, 0x35, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x6f, 0xec, 0xaf, 0xa0, 0xdd, 0x8a, 0xa4, 0xef, 0xf5, 0x2a, 0x10, 0x67, 0x2d, 0x3f, 0x55, 0x82, 0xbc, 0xd7, 0xef, 0x25, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x26, 0xfc, 0xd8, 0x94, 0x35, 0xea, 0x6c, 0xf8, 0x77, 0x84, 0x83, 0x4a, 0x61, 0x00, 0x17, 0xef, 0x2d, 0x26, 0xae, 0xae, 0x86, 0x60, 0xfc, 0x1a, 0x90, 0xd6, 0x9d, 0x01, 0xf6, 0xf9, 0xd1, 0x4e, 0x11, 0x28, 0xc3, 0x2f, 0x35, 0xd5, 0xe9, 0xd3, 0x45, 0x0f, 0x6b, 0x19, 0x33, 0xc0, 0xfe, 0xa2, 0xa5, 0x3b, 0x13, 0xa2, 0x95, 0x76, 0xc7, 0x8b, 0x94, 0x05, 0x7b, 0xbc, 0x0d, 0xfc, 0x47, 0x49, 0xdc, 0x9a, 0x4e, 0x99, 0xf0, 0x3c, 0xa9, 0x35, 0xbd, 0x1a, 0xfb, 0x15, 0xa9, 0x26, 0x8c, 0xe7, 0xed, 0xf7, 0x55, 0x5d, 0x20, 0x8c, 0x07, 0x9f, 0x8e, 0x9c, 0xf3, 0xb5, 0xaf, 0x47, 0xdf, 0x3c, 0xac, 0xbf, 0xfa, 0x40, 0xc8, 0x99, 0x3f, 0x09, 0xeb, 0x79, 0x91, 0x42, 0xc9, 0xb0, 0xfe, 0x60, 0xaa, 0x59, 0xe1, 0xfc, 0x03, 0x7a, 0xc8, 0xdb, 0x8b, 0x03, 0xcb, 0xd6, 0x5d, 0xe6, 0x37, 0xe8, }; #endif // VSIGN_I2009_SSCA_H
3a73680b96567f4733975c4542d5b6660c7898d1
1d1670da4f2d7b4888f22fb05246fd263600d9df
/core/kernel_linux/clients/umbra/table.h
a936ae980dadf52d9843e92cddbf059d2b9069b5
[ "BSD-3-Clause" ]
permissive
DynamoRIO/drk
f4f781aab6ffad87cdad03015d42c87b7a168c85
8a01088dfad44bc1e51fce0db62f3fdb46862b9d
refs/heads/drk
2023-03-26T14:53:58.447230
2015-02-24T17:59:36
2015-02-24T17:59:36
27,658,927
41
19
null
2015-02-24T17:59:38
2014-12-07T04:12:45
C
UTF-8
C
false
false
3,524
h
table.h
/********************************************************************* * Copyright (c) 2010 Massachusetts Institute of Technology * * * * 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. * *********************************************************************/ /* * Module Name: * Table -- table.h * * Description: * Manage internal data sturcture. * * Author: * Qin Zhao * */ #ifndef _TABLE_H_ #define _TABLE_H_ 1 #include "global.h" #include "umbra.h" #define INIT_BB_TABLE_SIZE 8192 #define INIT_EDGE_TABLE_SIZE (INIT_BB_TABLE_SIZE * 2) #define INIT_REF_TABLE_SIZE INIT_EDGE_TABLE_SIZE #define INIT_FUNC_TABLE_SIZE 1024 #define INIT_REF_CACHE_SIZE INIT_REF_TABLE_SIZE #define INIT_HASH_TABLE_SIZE 4096 #define MAX_BYTES_TABLE_SIZE (1 << 20) #define CODE_HASH_FUNC(val, mask) ((val) & (mask)) void table_init(void); void table_exit(void); void table_thread_init(void *drcontext, umbra_info_t *info); void table_thread_exit(void *drcontext, umbra_info_t *info); basic_block_t * table_alloc_bb(void *drcontext, umbra_info_t *info); link_edge_t * table_alloc_edge(void *drcontext, umbra_info_t *info); mem_ref_t * table_alloc_ref(void *drcontext, umbra_info_t *info); func_t * table_alloc_func(void *drcontext, umbra_info_t *info); ref_cache_t * table_alloc_ref_cache(void *drcontext, umbra_info_t *info); app_pc table_alloc_bytes(umbra_info_t *info, int size); basic_block_t * table_get_bb(umbra_info_t *info, int id); mem_ref_t * table_get_ref(umbra_info_t *info, int id); func_t * table_get_func(umbra_info_t *info, int id); basic_block_t * table_bb_tag_lookup(umbra_info_t *info, app_pc tag); void table_bb_add_to_hashtable(void *drcontext, umbra_info_t *info, basic_block_t *bb); link_edge_t * table_get_edge(umbra_info_t *info, int id); void table_edge_add_to_hashtable(void *drcontext, umbra_info_t *info, link_edge_t *edge); link_edge_t * table_edge_lookup_remove(void *drcontext, umbra_info_t *info, app_pc tag); bool addr_in_ref_cache(umbra_info_t *info, void *addr); #endif /* _TABLE_H_ */
792f7186cb77f12ecc86e428510a1ea218e5df1e
c9ea514e012ae6819910cb09718956b88dee033b
/SWD2015_APP/src/_lib_adl/adl_AppliInit.h
7fbc39e939fdfff3caade17cab267492344ef70f
[]
no_license
panmaya/SWR3G
bf0c869bbc1ac91a1633e8858d644206d54407ec
195b8ab63996aecb7b88698154fdf2f81e266038
refs/heads/master
2021-09-02T14:11:18.462046
2018-01-03T04:09:41
2018-01-03T04:09:41
104,835,116
0
0
null
null
null
null
UTF-8
C
false
false
22,537
h
adl_AppliInit.h
/* * adl_AppliInit.h * * Created: 3/10/2557 17:29:55 * Author: pan */ /**********************************************************************************************************************/ /* adl_AppliInit.h - Copyright Sierra Wireless Inc. (c) 2010 */ /* */ /* */ /* LICENSE */ /* ======= */ /* If no specific agreement has been signed, this Source Code is subject to the following license terms: */ /* http://www.sierrawireless.com/productsandservices/AirPrime/Sierra_Wireless_Software_Suite/License/Userlicense.aspx */ /* If you modify this file, you are subject to the contribution rules described into this license */ /**********************************************************************************************************************/ /** @file adl_AppliInit.h @brief ADL Application Entry Points public interface header file @ingroup adl_AppliInit_public_IFS */ /** @ifnot GLOBAL_IFS @mainpage @else @defgroup adl_AppliInit_public_IFS ADL Application Entry Points Interface Specification @endif @section adl_AppliInit_public_IFS_OVERVIEW Overview This document describes the public Application Entry Points interface of the ADL software element. @version 02.00 @author SUB Infosys AT Maintenance @section adl_AppliInit_public_IFS_HISTORY History <table> <tr> <td><b>Rev<br>XX.YY</b></td> <td><b>FH Rev<br>X</b></td> <td><b>Date<br>YYYY/MM/DD</b></td> <td><b>Updates</b></td> <td><b>Author</b></td> </tr> <tr> <td>01.00</td> <td>N/A</td> <td>2007/11/05</td> <td>Creation</td> <td>DPO</td> </tr> <tr> <td>01.01</td> <td>N/A</td> <td>2008/01/15</td> <td>Minor Update:<br> History added.<br> Multitasking lock removed.<br> New @link adl_AppliInit_public_IFS_Naming Name & Version @endlink interfaces definition. </td> <td>DPO</td> </tr> <tr> <td>01.02</td> <td>N/A</td> <td>2009/07/03</td> <td>Minor Update:<br> Add @link adl_AppliInit_public_IFS_IrqPrio FW interrupt priorities @endlink change. </td> <td>FDU</td> </tr> <tr> <td>01.03</td> <td>N/A</td> <td>2010/12/06</td> <td>Minor Update:<br> Remove all details on Real Time Enhancement feature (commercial feature removal).<br> Removal in #adl_InitIRQLowLevelStackSize, #adl_InitIRQHighLevelStackSize description. </td> <td>FDU</td> </tr> <tr> <td>01.04</td> <td>N/A</td> <td>2010/12/23</td> <td>Minor Update:<br> Add macro for stack size declaration: #ADL_DECLARE_CALL_STACK, #ADL_DECLARE_LOWIRQ_STACK, #ADL_DECLARE_HIGHIRQ_STACK. </td> <td>FDU</td> </tr> <tr> <td>01.05</td> <td>N/A</td> <td>2010/12/23</td> <td>Minor Update:<br> Well format the compilation flag paragraph.<br> Set to deprecated the Interrupt priority change feature. </td> <td>FDU</td> </tr> <tr> <td>01.06</td> <td>N/A</td> <td>2012/04/20</td> <td>Minor Update:<br> Removed reference to RTE. </td> <td>SUB Infosys AT Maintenance</td> </tr> <tr> <td>01.07</td> <td>N/A</td> <td>2012/06/11</td> <td>Minor Update:<br> Remove the Interrupt priority change feature. </td> <td>FDU</td> </tr> <tr> <td>02.00</td> <td>N/A</td> <td>2013/03/13</td> <td>Major Update:<br> Updated name and revision table as per records management guidelines. </td> <td>SUB Infosys AT Maintenance</td> </tr> </table> @section adl_AppliInit_public_IFS_INTRODUCTION Introduction @subsection adl_AppliInit_public_IFS_REMINDER Reminder Interfaces are the means by which software elements interact. An interface is a list of operations providing a coherent service. Software elements should have as much (independent) interfaces than of managed services. Uses the interface specification - To software element developers: provides the contract that states what the provider has to implement to meet the services promised by the interface. - To software element users: provides the contract that states what the client needs to do to use the interface. @subsection adl_AppliInit_public_IFS_RELATED_DOCUMENTS Related documents references Here are the documents referenced in this interface specification. -# @anchor DocRef1 <a href="Notes://domino-arc/C1256B52003391E9/C12570D1004A006DC1256A94004F97ED/40423885831E1EDCC1257321003F9043">[WM_DEV_OAT_FCS_055] Applicative tasks services</a> @subsection adl_AppliInit_public_IFS_ABBR_AND_GLOSSARY Abbreviations and glossary - <b>N.A.</b>\n Not appliable - <b>N.U.</b>\n Not used - <b>IFS</b>\n Interface Specification - <b>SE</b>\n Software Element */ /** @ifnot GLOBAL_IFS @defgroup adl_AppliInit_public_IFS ADL Application Entry Points Interface Specification @else @addtogroup adl_AppliInit_public_IFS @{ @endif @section adl_AppliInit_public_IFS_ftr Features ADL supplies Application Entry Points interface to allow applications to define the generic settings of the application tasks and contexts. The application will have to define its entry points settings using the #adl_InitTasks table. Each line of this table represents a task, which is characterized by the folloing parameters: - the task entry point, called at the Wireless CPU boot time, in the priority order - the task call stack size - the task priority level - the task name If the application wishes to use the IRQ service, it will also have to define the call stack sizes for it low level (#adl_InitIRQLowLevelStackSize) and high level (#adl_InitIRQHighLevelStackSize) interrupt handlers. Moreover, some operation related to the initialization are available: - A <b>Init type check</b> function (adl_InitGetType()) to retrieve at any time the Wireless CPU initialization type. @section adl_AppliInit_public_IFS_sample Code Sample The code sample below illustrates a nominal use case of the ADL Application Entry Points public interface @code // Application tasks declaration table const adl_InitTasks_t adl_InitTasks [] = { { MyFirstEntryPoint, 1024, "MYTASK1", 3 }, { MySecondEntryPoint, 1024, "MYTASK2", 2 }, { MyThirdEntryPoint, 1024, "MYTASK3", 1 }, { 0, 0, 0, 0 } }; // Low level handlers execution context call stack size const u32 adl_InitIRQLowLevelStackSize = 1024; // High level handlers execution context call stack size const u32 adl_InitIRQHighLevelStackSize = 1024; @endcode @if GLOBAL_IFS @} @endif */ #ifndef __adl_AppliInit_H__ #define __adl_AppliInit_H__ #ifdef __CC_ARM #pragma import(setlocale) #endif /** @defgroup adl_AppliInit_public_IFS_TaskTable Tasks declaration @ingroup adl_AppliInit_public_IFS Interfaces dedicated to the application tasks declaration */ /** * @addtogroup adl_AppliInit_public_IFS_TaskTable * @{ */ /** @brief Tasks declaration structure @par Description: Open AT application's tasks declaration structure, used to format the #adl_InitTasks table. */ typedef struct _adl_InitTasks_t { /** @brief Task entry point @par Description: Task initialization handler, which aims to be called each time the Wireless CPU boots, as soon as the application is started with the <b>AT+WOPEN=1</b> command. @note A task entry point function is NOT like a standard "C" main function. The task does not end when returns. An Open AT application is stopped only if the <b>AT+WOPEN=0</b> command is used. Such a call-back function is only the application entry point, and has to subscribe to some services and events to go further. In addition the whole software is protected by a watchdog mechanism, the application shall not use infinite loops and loops having a too long duration, the Wireless CPU will reset due to the watchdog hardware security (please refer to Hardware Security: Watchdog Protection for more information). */ void ( * EntryPoint ) ( void * ); /** @brief Task call stack size @par Description: Used to provide to the system the required call stack size (in bytes) for the current task. A call stack is the Open AT RAM area which contains the local variables and return addresses for function calls. Call stack sizes are deduced from the total available RAM size for the Open AT application. @note The GCC compiler and GNU Newlib (standard C library) implementation require more stack size than ARM compilers. If the GCC compiler is used, the Open AT application has to be declared with greater stack sizes. @note Call stack sizes shall be declared with some extra bytes margin. It is not recommended to try to reckon exactly the required call stack size of each task. @note @{ If the total call stack sizes (including the tasks ones & the interrupt contexts ones) is too large, the Firmware will refuse to launch the application, and the application launch status will be set to 9 (Bad memory configuration)\n (cf. <code><b>AT+WOPEN=7</b></code> description in AT Commands Interface Guide for more information) @} @note Stack memory is limited to 64 kBytes and if allocated above 64 kBytes correct behavior is not guaranteed. */ u32 StackSize; /** @brief Task name @par Description: Task identification string, used for debug purpose with Traces & Errors services. */ const ascii * Name; /** @brief Task relative priority level @par Description: Task priority level, relatively to the other tasks declared in the table. The higher is the number, the higher is the priority level. Priorities values declared in the table should be from 1 to the tasks count. This priority determines the order in which the events are notified to the several tasks when several ones receive information at the same time. @note @{ All the priorities declared in the table have to be different (two tasks can not have the same priority level).\n If there is an error in the priorities declaration, the Firmware will refuse to launch the application, and the application launch status will be set to 17 (Bad priority value)\n (cf. <code><b>AT+WOPEN=7</b></code> description in AT Commands Interface Guide for more information) @} */ u8 Priority; } adl_InitTasks_t; /** @brief Tasks definition table @par Description: Mandatory tasks definition table to be provided by the application. For more information on each task's parameters, please refer to the #adl_InitTasks_t description. Each line of this table allows to intialize one task. To let the system know how many tasks are required, all the elements of the last line of this table have to be set to 0.\n Task entry points declared in the table will be called on Wireless CPU boot, in the priority order (the highest priority level is called first).\n @note @{ At least one task shall be declared in this table. If no tasks are declared in the table, the Firmware will refuse to launch the application, and the application launch status will be set to 16 (No task declared)\n (cf. <code><b>AT+WOPEN=7</b></code> description in AT Commands Interface Guide for more information) @} @note @{ There is a maximum limit to the number of tasks which shall be declared in this table (Please refer to the Resources chapter for more information).\n If more tasks than the authorized maximum are declared in the table, the Firmware will refuse to launch the application, and the application launch status will be set to 5 (Too many tasks)\n (cf. <code><b>AT+WOPEN=7</b></code> description in AT Commands Interface Guide for more information) @} @warning @{ Since ADL processing is running in the first application's task context, this one has always to be declared with the highest priority level, otherwise the Firmware will refuse to launch the application, and the application launch status will be set to 11 (Application binary init failure)\n (cf. <code><b>AT+WOPEN=7</b></code> description in AT Commands Interface Guide for more information) @} */ extern const adl_InitTasks_t adl_InitTasks []; /** * @} */ /** @defgroup adl_AppliInit_public_IFS_IRQStacks Interrupt handlers call stack sizes declaration. @ingroup adl_AppliInit_public_IFS Interfaces dedicated to the interrupt handlers call stack sizes declaration */ /** * @addtogroup adl_AppliInit_public_IFS_IRQStacks * @{ */ /** @brief Low level interrupt handler call stack size @par Description: Call stack size (in bytes) of the Low level interrupt handler execution context. If the application whishes to handle interrupts (cf. IRQ service chapter & Execution context service chapter), it has also to define the required contexts (low level and/or high level) call stack sizes. @note This definition is optional if the application does not plan to use the IRQ service. */ //extern const u32 adl_InitIRQLowLevelStackSize; /** @brief High level interrupt handler call stack size @par Description: Call stack size (in bytes) of the High level interrupt handler execution context. If the application whishes to handle interrupts (cf. IRQ service chapter & Execution context service chapter), it has also to define the required contexts (low level and/or high level) call stack sizes. @note This definition is optional if the application does not plan to use the IRQ service, or just low level interrupt handlers. */ //extern const u32 adl_InitIRQHighLevelStackSize; /** * @} */ /** @defgroup adl_AppliInit_public_IFS_InitType Initialization information @ingroup adl_AppliInit_public_IFS Initialization information related interfaces. */ /** * @addtogroup adl_AppliInit_public_IFS_InitType * @{ */ /** @brief Wireless CPU power-on or reset reason @par Description: Details the reason of the Wireless CPU boot. */ typedef enum _adl_InitType_e { ADL_INIT_POWER_ON, ///< Normal power-on ADL_INIT_REBOOT_FROM_EXCEPTION, ///< Reboot after an exception ADL_INIT_DOWNLOAD_SUCCESS, ///< Reboot after a successful install process (cf. adl_adInstall() API) ADL_INIT_DOWNLOAD_ERROR, ///< Reboot after an error in install process (cf. adl_adInstall() API) ADL_INIT_RTC ///< Power-on due to an RTC alarm (cf. the <b>AT+CALA</b> command documentation for more information) } adl_InitType_e; /** @brief Initialization type retrieve function @par Description: Returns the last Wireless CPU power-on or reset reason. @return The Wireless CPU reset reason. Please refer to #adl_InitType_e for more information. @section adl_InitGetType_sample Code Sample This example demonstrates how to use the function adl_InitGetType() in a nominal case. @code // Anywhere in the application code, to retrieve init type. adl_InitType_e InitType = adl_InitGetType(); @endcode */ adl_InitType_e adl_InitGetType ( void ); /** * @} */ /** @defgroup adl_AppliInit_public_IFS_Naming Miscellaneous name & version information @ingroup adl_AppliInit_public_IFS @section adl_AppliInit_public_IFS_Naming_Overview Name & version related interfaces. The constants defined below allows the application to define some information readable by the Sierra Wireless Firmware. These constants definitions are optional, and automatically considered as empty strings if not provided by the application. @section adl_AppliInit_public_IFS_Naming_Samples Code sample @code // Application name definition const ascii adl_InitApplicationName[] = "My Application"; // Company name definition const ascii adl_InitCompanyName[] = "My Company"; // Application version definition const ascii adl_InitApplicationVersion[] = "v1.0.0"; @endcode */ /** * @addtogroup adl_AppliInit_public_IFS_Naming * @{ */ /** @brief Application name @par Description: This constant string should be defined by the application in order to provide a name readable by the Sierra Wireless Firmware. */ extern const ascii adl_InitApplicationName[]; /** @brief Company name @par Description: This constant string should be defined by the application, in order to provide a company name readable by the Sierra Wireless Firmware. */ extern const ascii adl_InitCompanyName[]; /** @brief Application version @par Description: This constant string should be defined by the application in order to provide a version readable by the Sierra Wireless Firmware. */ extern const ascii adl_InitApplicationVersion[]; /** * @} */ /** @defgroup adl_AppliInit_public_IFS_Deprecated Deprecated entry points interfaces @ingroup adl_AppliInit_public_IFS Former ways to handle the application entry point configuration. */ /** * @addtogroup adl_AppliInit_public_IFS_Deprecated * @{ */ /** @brief Single task application entry point @deprecated Former way to declare the entry point of a single task application, kept for ascendant compatibility. If this function is used, the #adl_InitTasks table has not to be declared. @param[in] adlInitType Wireless CPU initialization type (please refer to #adl_InitType_e description for more information) */ //void adl_main ( adl_InitType_e adlInitType ); /** @brief Single task application stack size @deprecated Former way to declare the stack size of a single task application, kept for ascendant compatibility. If this contant is used, the #adl_InitTasks table has not to be declared. */ //extern const u16 wm_apmCustomStackSize; /** @brief Low level interrupt handler call stack size @deprecated Former way to declare the stack size of the low level interrupt execution context, kept for ascendant compatibility. */ //#define wm_apmIRQLowLevelStackSize adl_InitIRQLowLevelStackSize /** @brief High level interrupt handler call stack size @deprecated Former way to declare the stack size of the high level interrupt execution context, kept for ascendant compatibility. */ //#define wm_apmIRQHighLevelStackSize adl_InitIRQHighLevelStackSize /** * @} */ /** @defgroup adl_AppliInit_public_IFS_StackSize Stack sizes macro @ingroup adl_AppliInit_public_IFS @section adl_AppliInit_public_IFS_StackSize_Overview Stack sizes macros. The constants defined below allows the application to define the stack sizes. */ /** * @addtogroup adl_AppliInit_public_IFS_StackSize * @{ */ /** @brief Application stack size Macro @par Description: This macro declares the right #wm_apmCustomStackSize value according to the compilers.\n The GCC compiler and GNU Newlib (standard C library) implementation require more stack size than ARM compilers.\n If the GCC compiler is used, the allocation has to be declared with greater stack sizes (the #X parameter is then multiplied by 3). */ //#ifdef __GNU_GCC__ #ifdef __GNUC__ //#define ADL_DECLARE_CALL_STACK(X) const u16 wm_apmCustomStackSize = X*3 #else /* #ifndef __GNU_GCC__ */ #define ADL_DECLARE_CALL_STACK(X) const u16 wm_apmCustomStackSize = X #endif /* #ifndef __GNU_GCC__ */ /** @brief Low level interrupt handler call stack size Macro @par Description: This macro declares the right #adl_InitIRQLowLevelStackSize value according to the compilers.\n The GCC compiler and GNU Newlib (standard C library) implementation require more stack size than ARM compilers.\n If the GCC compiler is used, the allocation has to be declared with greater stack sizes (the #X parameter is then multiplied by 3). */ //#ifdef __GNU_GCC__ #ifdef __GNUC__ //#define ADL_DECLARE_LOWIRQ_STACK(X) const u32 adl_InitIRQLowLevelStackSize = X*3 #else /* #ifndef __GNU_GCC__ */ #define ADL_DECLARE_LOWIRQ_STACK(X) const u32 adl_InitIRQLowLevelStackSize = X #endif /* #ifndef __GNU_GCC__ */ /** @brief High level interrupt handler call stack size Macro @par Description: This macro declares the right #adl_InitIRQHighLevelStackSize value according to the compilers.\n The GCC compiler and GNU Newlib (standard C library) implementation require more stack size than ARM compilers.\n If the GCC compiler is used, the allocation has to be declared with greater stack sizes (the #X parameter is then multiplied by 3). */ //#ifdef __GNU_GCC__ #ifdef __GNUC__ //#define ADL_DECLARE_HIGHIRQ_STACK(X) const u32 adl_InitIRQHighLevelStackSize = X*3 #else /* #ifndef __GNU_GCC__ */ #define ADL_DECLARE_HIGHIRQ_STACK(X) const u32 adl_InitIRQHighLevelStackSize = X #endif /* #ifndef __GNU_GCC__ */ /** * @} */ /** @defgroup adl_AppliInit_public_IFS_CompilationFlag Compilation flag @ingroup adl_AppliInit_public_IFS @section adl_AppliInit_public_IFS_CompilationFlag_Overview Compilation flag for GDB */ /** * @addtogroup adl_AppliInit_public_IFS_CompilationFlag * @{ */ /** @brief Compilation flag definition @par Description: This enum shall be used for the #adl_CompilationMode variable to define the compilation flag */ typedef enum { ADL_COMPILATION_MODE_UNKNOWN = 0x0DEADBEF, ///< Unknown compilation mode ADL_COMPILATION_MODE_DEBUG = 0x0CAFEBAB, ///< Debug compilation mode ADL_COMPILATION_MODE_RELEASE = 0x0C0FEEEE ///< Release compilation mode }adl_CompilationMode_e; /** @brief Is the Open AT compiled with Debug or Release mode (or unknown) @par Description: this global variable is used to define the compilation flag */ //extern const adl_CompilationMode_e adl_CompilationMode; /** * @} */ // Don't use semihosting SWI for RVDS (only defined in application) #ifndef __OAT_LIBRARY_BUILD__ #ifdef __ARMCC_VERSION #pragma import(__use_no_semihosting_swi) #endif #endif #endif
1a1288bebd2523f39838373934241979ba63ee56
7616411cf71518505a5ec44b6a2d238142bcdb95
/main.c
cc94de7e927963d1f600371106602473035c2589
[]
no_license
Hoop77/Graphs-in-C
ca5af19872184588c7c44ed9b5471a165f33dde0
e90689e442a0558cdd2b61080d53450927ad8447
refs/heads/master
2021-01-20T19:40:01.209673
2016-06-10T12:36:15
2016-06-10T12:36:15
60,349,203
1
0
null
null
null
null
UTF-8
C
false
false
17,299
c
main.c
/** * @file main.h * @author Philipp Badenhoop * @date 6 Jun 2016 * @brief This program loads a graph from text file and outputs an eulerian path if it exists. */ #include "string.h" #include "basic.h" #include "edge.h" #include "vertex.h" #include "graph.h" #include "path.h" #include "pathelement.h" #include "dlistiterator.h" #include "comparator.h" /** * @brief This is defined when the program is compiled in release mode. */ #define NDEBUG /** * @brief Just a simple flag which should indicate if a vertex number is not valid. */ #define VERTEX_UNDEFINED -1 /** * @brief We have to categorize the input graph to see whether an eulerian path * could potentially exist or whether we have to convert the graph so that we can use * the algorithm to find an eulerian cycle first and print an eulerian path afterwards. */ typedef enum { GRAPH_TYPE_NO_VERTICES_WITH_UNEVEN_DEGREE, GRAPH_TYPE_TWO_VERTICES_WITH_UNEVEN_DEGREE, GRAPH_TYPE_MORE_THAN_TWO_VERTICES_WITH_UNEVEN_DEGREE, GRAPH_TYPE_ALL_VERTICES_WITH_ZERO_DEGREE } GraphType; /** * @brief To evaluate the graph type, we have to walk over the vertices * to get certain information which we store in this struct. */ typedef struct { GraphType graphType; /**< The graph type. */ int startOrEndVertexNum1; /**< The first potential start or end vertex of an eulerian path. */ int startOrEndVertexNum2; /**< The second potential start or end vertex of an eulerian path. */ int vertexWithMaxDegree; /**< The vertex with max degree in the a graph. */ } GraphInformation; /** * @brief A structure that stores the output of the algorithm which tries to find an eulerian cycle in a graph. */ typedef struct { bool exists; /**< Tells if an eulerian cycle exists. */ Path *eulerianCycle; /**< The result path. */ } EulerianCycleResult; #ifdef __cplusplus extern "C" { #endif /** * @brief Loads a graph from file. * The file must have the following structure: * In the first line, there must be exactly one integer which represents the vertex count. * In each following line there must be exactly two intergers which represent a pair of edges, * between the first number (=vertex 1) and the second number (=vertex 2). * @param filename * @return The pointer to the created graph if it there're no problems with the file, else NULL. */ Graph *loadGraph( char *filename ); /** * @brief This function goes through each vertex in a graph and creates the graph information. * @param graph * @return The graph information, which is used to evaluate whether there's potential for an * eulerian path in a graph and needed for the following algorithms. */ GraphInformation checkVertexDegrees( Graph *graph ); /** * @brief We know an algorithm to find an eulerian cycle in a graph where all vertices * have even degree. However, this may not work on a graph where only two vertices have uneven degree which * is the criteria for finding an eulerian path. So having a graph where only two vertices have uneven degree, * we simply convert it to a graph with completely even degrees by adding a new vertex to the graph and connecting * the two vertices with uneven degree to that new vertex. Now we can find an eulerian cycle and later * when we want to print it, we can simply ommit the added vertex. * @param graph * @param graphInfo */ void convertGraph( Graph *graph, GraphInformation graphInfo ); /** * @brief This function will find an eulerian cycle in a graph where all vertices have even degrees. * It uses the hierholzer algorithm to do that. * Since we're removing the edges from the graph, we can figure out easily if the graph is disconnected * (in this case, an eulerian cycle/path doesn't exist). * @param graph * @param graphInfo * @return A result structure which stores an indicator whether an eulerian cycle exists and the final graph. */ EulerianCycleResult findEulerianCycle( Graph *graph, GraphInformation graphInfo ); /** * @brief A subroutine of the algorithm to find an eulerian cycle. * This generates a sub-circle-path of the graph and removes the edges which belong to that path. * @param graph * @param startVertexNum * @return The extracted sub-circle-path. */ Path *extractSubCircle( Graph *graph, int startVertexNum ); /** * @brief Prints an eulerian cycle. * @param eulerianCycle */ void printEulerianCycle( Path *eulerianCycle ); /** * @brief Prints an eulerian path. * @param eulerianCylce * @param addedVertexNum */ void printEulerianPath( Path *eulerianCylce, int addedVertexNum ); #ifdef __cplusplus } #endif int main( int argc, char *argv[] ) { Graph *graph; // Check argument size: we specified that the first argument is the filename to our graph data. if( argc >= 2 ) { // load graph graph = loadGraph( argv[1] ); } else { fprintf( stderr, "Ungueltiges Eingabeformat\n" ); return 0; } // We check if the graph was successfully loaded. if( graph == NULL ) return 0; // Now that we have the graph in memory, we check if we canNOT find an eulerian path. // It has no eulerian path if more than two vertices have an uneven degree. GraphInformation graphInfo = checkVertexDegrees( graph ); bool proceed = true; if( graphInfo.graphType != GRAPH_TYPE_NO_VERTICES_WITH_UNEVEN_DEGREE && graphInfo.graphType != GRAPH_TYPE_TWO_VERTICES_WITH_UNEVEN_DEGREE ) { if( graphInfo.graphType == GRAPH_TYPE_MORE_THAN_TWO_VERTICES_WITH_UNEVEN_DEGREE ) { printf( "-1" ); } printf( "\n" ); proceed = false; } // Now there's potential for an eulerian cycle but we cannot be completely sure because the graph must also be connected. // However, there might be some vertices that do not have any edges - which is valid. Our algorithm handles that. if( proceed ) { EulerianCycleResult eulerianCycleResult = findEulerianCycle( graph, graphInfo ); // Outputting. if( eulerianCycleResult.exists ) { if( graphInfo.graphType == GRAPH_TYPE_TWO_VERTICES_WITH_UNEVEN_DEGREE ) { // We have to specify the vertex number of the added vertex which is always the last vertex. printEulerianPath( eulerianCycleResult.eulerianCycle, graph->vertexCount - 1 ); } else { printEulerianCycle( eulerianCycleResult.eulerianCycle ); } } else { printf( "-1" ); } printf( "\n" ); // Destroy complete the path. path_destroyAll( eulerianCycleResult.eulerianCycle ); } // Destroy the complete graph. graph_destroyAll( graph ); return 0; } Graph *loadGraph( char *filename ) { // Opening the file. FILE *f = fopen( filename, "r" ); if( f == NULL ) { fprintf( stderr, "Ungueltiges Eingabeformat\n" ); return NULL; } // We start by reading the number of vertices. int vertexCount; if( fscanf( f, "%d\n", &vertexCount ) != 1 ) { fprintf( stderr, "Ungueltiges Eingabeformat\n" ); return NULL; } // Create the graph. Graph *graph = graph_new( vertexCount ); // Now we are creating the edges by reading the file. // An edge in a file is a line with two deciaml numbers seperated by a whitespace. // // Make sure we read exactly 2 decimal in each line. int vertexNum1, vertexNum2; while( fscanf( f, "%d %d\n", &vertexNum1, &vertexNum2 ) == 2 ) { if( vertexNum1 >= vertexCount || vertexNum2 >= vertexCount ) { fprintf( stderr, "Ungueltiges Eingabeformat\n" ); return NULL; } // Create one edge going from vertex 1 to vertex 2 // and one edge going from vertex 2 to vertex 1. graph_addEdgePair( graph, vertexNum1, vertexNum2 ); } fclose( f ); return graph; } GraphInformation checkVertexDegrees( Graph *graph ) { // We're optimistic and assume that two or less vertices with uneven degree at the beginning. GraphInformation graphInfo = { GRAPH_TYPE_NO_VERTICES_WITH_UNEVEN_DEGREE, VERTEX_UNDEFINED, VERTEX_UNDEFINED, VERTEX_UNDEFINED }; int unevenDegreeCount = 0; int maxDegree = 0; int vertexWithMaxDegree = VERTEX_UNDEFINED; // Loop through every vertex int currVertexNum; for( currVertexNum = 0; currVertexNum < graph_getVertexCount( graph ); currVertexNum++ ) { int degree = vertex_getDegree( graph_getVertex( graph, currVertexNum )); // The vertex has an uneven degree? if( (degree % 2) > 0 ) { // Now that we've encountered a vertex with uneven degree, // it must be a start or end vertex (as long as there're only two of these vertices). unevenDegreeCount++; // Found the first vertex with uneven degrree? if( unevenDegreeCount == 1 ) { graphInfo.graphType = GRAPH_TYPE_TWO_VERTICES_WITH_UNEVEN_DEGREE; // This vertex will be a possible start or end vertex of the eulerian path. graphInfo.startOrEndVertexNum1 = currVertexNum; } // Found the second vertex with uneven degrree? else if( unevenDegreeCount == 2 ) { // This vertex will be another possible start or end vertex of the eulerian path. graphInfo.startOrEndVertexNum2 = currVertexNum; } // Found more than 2 vertices with uneven degree? else { graphInfo.graphType = GRAPH_TYPE_MORE_THAN_TWO_VERTICES_WITH_UNEVEN_DEGREE; // We reset these values because they wouldn't make sense now. graphInfo.startOrEndVertexNum1 = VERTEX_UNDEFINED; graphInfo.startOrEndVertexNum2 = VERTEX_UNDEFINED; break; } } // Update maximum degree. if( degree > maxDegree ) { maxDegree = degree; vertexWithMaxDegree = currVertexNum; } } // It could happen that we get a graph with no edges at all. if( maxDegree <= 0 ) graphInfo.graphType = GRAPH_TYPE_ALL_VERTICES_WITH_ZERO_DEGREE; else graphInfo.vertexWithMaxDegree = vertexWithMaxDegree; return graphInfo; } void convertGraph( Graph *graph, GraphInformation graphInfo ) { graph_addVertex( graph ); // Add the edges between the possible start or end vertices and the new vertex. int addedVertexNum = graph_getVertexCount( graph ) - 1; graph_addEdgePair( graph, addedVertexNum, graphInfo.startOrEndVertexNum1 ); graph_addEdgePair( graph, addedVertexNum, graphInfo.startOrEndVertexNum2 ); return; } EulerianCycleResult findEulerianCycle( Graph *graph, GraphInformation graphInfo ) { // If the graph has two vertices with uneven degree, we add an edge between those so that we can find an eulerian cycle. if( graphInfo.graphType == GRAPH_TYPE_TWO_VERTICES_WITH_UNEVEN_DEGREE ) convertGraph( graph, graphInfo ); // The path's first element will be the vertex with the max degree. int mergingVertexNum = graphInfo.vertexWithMaxDegree; // We start by extracting the first sub-circle of the graph as the base of our path. Path *path = extractSubCircle( graph, mergingVertexNum ); // We go through each element of the current path and extract sub-circle-paths. // Note that when we obtain a sub-circle, all edges where that path came along will be removed, // so the graph keeps 'shrinking'. // Every sub-circle-path is merged with the current path after we obtained it. // We do this until we reached the end of our extending path and // are not able to extract any further sub-circles. // // First create an iterator to go through the elements of the extending path. DList *pathElements = path_getElements( path ); DListIterator *pathIterator = dListIterator_getIteratorFromList( pathElements ); // Until we reached the end of the path. while( !dListIterator_isAtEnd( pathIterator, pathElements )) { PathElement *currElement = (PathElement *) dListIterator_get( pathIterator ); // Get vertex number and degree of the vertex of the path where we want to merge the next sub-circle-path. int mergingVertexNum = pathElement_getVertexNum( currElement ); int degree = vertex_getDegree( graph_getVertex( graph, mergingVertexNum )); // We skip this obviously if there're no (more) edges at the current vertex. if( degree > 0 ) { // Extract a sub-circle-path. Path *subCircle = extractSubCircle( graph, mergingVertexNum ); // Merge the current path with the sub-circle-path. dListIterator_merge( &pathIterator, pathElements, path_getElements( subCircle )); // Since we have merged the paths, we can get rid of the sub-circle instance. path_destroy( subCircle ); } dListIterator_increment( pathIterator ); } // Assume that we found a path. EulerianCycleResult result = { true, path }; // Now we have to check if there're no more edges inside the graph. // This is important because it could be a disconnected graph // which we haven't been able to recognize yet. if( graph_hasEdges( graph )) { result.exists = false; result.eulerianCycle = NULL; } return result; } Path *extractSubCircle( Graph *graph, int startVertexNum ) { Path *subCircle = path_new(); // We append the first vertex to the sub-circle. path_append( subCircle, startVertexNum ); // Setting start values. int currVertexNum = startVertexNum; Vertex *currVertex = graph_getVertex( graph, startVertexNum ); // We only stop if we're back on the start vertex and there are no more edges left. while( !( currVertexNum == startVertexNum && vertex_getDegree( currVertex ) == 0 )) { // Due to the condition that we had a graph whos vertices have an even degree, we can assert // that the current vertex has at least one edge leading us to the next vertex. assert( vertex_getDegree( currVertex ) > 0 ); DList *edges = vertex_getEdges( currVertex ); Edge *firstEdge = (Edge *) dList_get( edges, 0 ); // Simply select the first edge to get to the next vertex. int nextVertexNum = edge_getToVertexNum( firstEdge ); // Append the next vertex to the sub-circle. path_append( subCircle, nextVertexNum ); // And now we remove the edges between the vertices so we won't take it again. graph_removeEdgePair( graph, currVertexNum, nextVertexNum ); // Finally we update the current vertex. currVertexNum = nextVertexNum; currVertex = graph_getVertex( graph, nextVertexNum ); } return subCircle; } void printEulerianCycle( Path *eulerianCycle ) { DList *pathElements = path_getElements( eulerianCycle ); DListIterator *pathIterator = dListIterator_getIteratorFromList( pathElements ); dList_foreach( pathIterator, pathElements ) { PathElement *currElement = (PathElement *) dListIterator_get( pathIterator ); printf( "%d ", currElement->vertexNum ); } return; } void printEulerianPath( Path *eulerianCylce, int addedVertexNum ) { // Since we got an eulerian cyclce the first and the last elements are equal. // However this cannot occur on a graph which has 2 vertices with uneven degree. // So we will simply remove the last element of the path. DList *pathElements = path_getElements( eulerianCylce ); DListIterator *pathIterator = dListIterator_getIteratorFromList( pathElements ); dListIterator_toLast( pathIterator, pathElements ); dListIterator_destroy( pathIterator, pathElements ); // We have to find the added vertex element in the path. PathElement searchElement = { addedVertexNum }; Comparator *comparator = comparator_new( &searchElement, (CompareFunction) pathElement_equals ); dListIterator_toFirst( pathIterator, pathElements ); PathElement *addedVertexElement = (PathElement *) dListIterator_search( &pathIterator, pathElements, comparator ); assert( addedVertexElement != NULL ); // Now we are going to print out the path. while( true ) { dListIterator_increment( pathIterator ); // If we're at the end of the path, we jump back to the beginning. if( dListIterator_isAtEnd( pathIterator, pathElements )) dListIterator_toFirst( pathIterator, pathElements ); PathElement *currElement = (PathElement *) dListIterator_get( pathIterator ); // Stop if find the added vertex which we do NOT want to print obviously. if( currElement == addedVertexElement ) break; printf( "%d ", pathElement_getVertexNum( currElement )); } // Clean up. comparator_destroy( comparator ); return; }
e3df870ee4f59f263a4f9a0050163a569a4288f4
fb3caa66ac0b2254b422303d670a70e597067758
/201903_研究生入学考试_复试_PTA机试/《C语言程序设计实验与习题指导》(第3版)题目集/02编程题/实验11-1-7 藏头诗.c
0658dd202770a40efcafa40bfe97eb4174b18fef
[]
no_license
dyngq/Competitions
065ec9f153919950b161aaa9fff6a9de9e29ba32
e9b7ff8fbe038e148bc61b21b077f35cdc5368a9
refs/heads/master
2021-06-13T13:55:11.352531
2021-05-08T09:49:24
2021-05-08T09:49:24
186,392,400
0
0
null
null
null
null
UTF-8
C
false
false
284
c
实验11-1-7 藏头诗.c
#include <stdio.h> int main() { char a[100], b[100], c[100], d[100]; scanf("%s %s %s %s",a,b,c,d); //printf("%s\n%s\n%s\n%s\n",a,b,c,d); printf("%c%c",a[0],a[1]); printf("%c%c",b[0],b[1]); printf("%c%c",c[0],c[1]); printf("%c%c",d[0],d[1]); }
22215e34ccbce95a3f14f2f02f941e1bac0692ef
2b9823b63a4856696e9d4ead7795310b2c72ad79
/home3/rwang/rhvec/apps/streak/streak.c
781130927e22402b33badbe202ede61794597787
[]
no_license
anykine/radiationHybrid
1e4645f67661805a71a64fa830e158d9d3dd3a3c
6ef1732127b90c039ce865dcf22ccb32ffbd263f
refs/heads/master
2020-04-29T06:03:07.692782
2019-03-15T23:20:07
2019-03-15T23:20:07
175,903,410
0
0
null
null
null
null
UTF-8
C
false
false
7,010
c
streak.c
#include <stdio.h> /********************************************* Richard Wang Creates a 2d matrix of 1's and 0's of rhvec data and then marks horizontal and vertical streaks. y 0 0 0 0 0 0 1 1 0 0 x 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 ***********************************************/ /* globals */ #define MAX 20 #define debug 1 char* matrix[MAX]; //holds our matrix data int max_x = MAX-1; //indexing is 0based, so -1 int max_y = MAX-1; int usage(){ printf("program <input file> <num markers>\n"); exit(1); } //trace void t(char* msg){ if (debug){ printf("test: %s\n", msg); } } void errout(char * err){ printf("error: %s\n", err); exit(1); } /* -------------------------- Outputs the marked markers ----------------------------*/ void readout() { int x,y; for (x=0; x<=max_x; x++){ for (y=x; y<=max_y; y++){ //add 1 to match input file if (matrix[x][y] == 2) printf("%d\t%d\n", x+1,y+1); } } } /* -------------------------- Outputs the current matrix ----------------------------*/ void print_matrix(char** matrix){ int i,j, tab; //rows for (i=0; i < MAX; i++){ //print out the spaces to align the 1/2 matrix for(tab = 0; tab <= i; tab++){ printf(" "); } //cols for (j=i; j<MAX; j++){ //prints out as digit (ascii -> num) printf("%d ", matrix[i][j]); } printf("\n"); } printf("\n"); } /* -------------------------- reserve memory for matrix creates 2d array 00000000 0000000 00000 0000 000 00 0 ----------------------------*/ void alloc_matrix(){ //create 2d matrix and init to 0 //to be efficient, i can create 1/2 matrix int index1,index2; for (index1=0; index1<MAX; index1++){ matrix[index1] = malloc(MAX-index1 * sizeof(char)); if (matrix[index1]==NULL){ errout("mem allocation failed for matrix!"); } } } /*-------------------------- initialize matrix to zero ---------------------------*/ void init_matrix(){ //init to 0 int index1,index2; for (index1=0; index1<MAX; index1++){ for (index2=index1; index2<MAX; index2++){ matrix[index1][index2] = 0; } } } /*-------------------------- load file into matrix markers are number 1..n but matrix is 0-based ---------------------------*/ void load_matrix(char* file){ FILE *fp; fp = fopen(file, "r"); if (fp==NULL) errout("could not open input file\n"); //read file unsigned int m1=0, m2=0; //store marker1,marker1 float f1=0, f2=0; //throwaway while(!feof(fp)){ fscanf(fp, "%d %d %f %f", &m1, &m2, &f1, &f2); //subtract 1 matrix[m1-1][m2-1] = 1; } } //x,y are always pos, starting in upper left int search_horiz(int x, int y){ int count; if (x<0 ||x>max_x || y<0 || y>max_y){ t("out of bounds"); count=0; } else if (matrix[x][y] == 0) { t("val is zero"); count=0; printf("%s ", "zero"); } else { t("testing"); // top left if (x==0 && y==0 && matrix[x+1][y]==0 && matrix[x+1][y+1]==0) { t("top left"); matrix[x][y]=2; count = 1 + search_horiz(x,y+1); } // top right else if (x==0 && y==max_y && (matrix[x][y-1]==0 || matrix[x][y-1]==2) && matrix[x+1][y-1]==0 && matrix[x+1][y]==0){ t("top right"); if (matrix[x][y] == 1){ t("top right2"); matrix[x][y]=2; count = 1; } } // top else if (x==0 && (matrix[x][y-1]==0 || matrix[x][y-1]==2) && matrix[x+1][y-1]==0 && matrix[x+1][y]==0 && matrix[x+1][y+1]==0) { t("top"); matrix[x][y]=2; count = 1 + search_horiz(x,y+1); } //bot left else if (x==max_x && matrix[x-1][y]==0 && matrix[x-1][y+1]==0 && y==0){ matrix[x][y]=2; count = 1 + search_horiz(x,y+1); } //close to bot right else if (x==max_x && (matrix[x][y-1]==0 || matrix[x][y-1]==2) && matrix[x-1][y-1]==0 && matrix[x-1][y]==0 && y==max_y){ if (matrix[x][y] == 1) { count = 1; matrix[x][y]=2; } } // bottom else if (x==max_x && (matrix[x][y-1]==0 || matrix[x][y-1]==2) && matrix[x-1][y-1]==0 && matrix[x-1][y]==0 && matrix[x-1][y+1] ==0) { t("x @ bottom"); matrix[x][y]=2; count = 1 + search_horiz(x, y+1); } // left else if (y==0 && matrix[x-1][y]==0 && matrix[x-1][y+1]==0 && matrix[x+1][y]==0 && matrix[x+1][y+1]==0) { t("left"); matrix[x][y]=2; count = 1 + search_horiz(x, y+1); } //right else if (y==max_y && matrix[x-1][y]==0 && matrix[x-1][y-1]==0 && matrix[x+1][y-1]==0 && matrix[x+1][y]==0) { t("right"); matrix[x][y]=2; count = 1 + search_horiz(x, y+1); } //8 of 9 are 0, right side is 1 else if (matrix[x-1][y+1]==0 && matrix[x-1][y] ==0 && matrix[x-1][y-1]==0 && (matrix[x][y-1]==0 || matrix[x][y-1]==2) && matrix[x+1][y-1]==0 && matrix[x+1][y]==0 && matrix[x+1][y+1]==0) { t("1found one"); matrix[x][y]=2; count = 1 + search_horiz(x, y+1); } else { t("exiting"); } //mark for deletion } return count; } /************************************************* //if spot has no neighbors, mark for deletion *************************************************/ int remove_speck(int x, int y){ int count = 0; //8 exceptional cases, plus the norm t("starting"); //top left corner if (x == 0 && y==0) { t("one"); count = matrix[x][y+1] + matrix[x+1][y+1] + matrix[x+1][y]; //top right corner } else if (x == 0 && y == max_y) { t("two"); count = matrix[x][y-1] + matrix[x+1][y-1] + matrix[x+1][y]; //bottom left corner } else if (x == max_x && y == 0){ t("three"); count = matrix[x-1][y] + matrix[x-1][y-1] + matrix[x][y+1]; //bottom right corner } else if (x == max_x && y == max_y) { t("four"); count = matrix[x][y-1] + matrix[x-1][y-1] + matrix[x-1][y]; //left side } else if (x == 0) { t("five"); count = matrix[x][y-1] + matrix[x+1][y-1] + matrix[x+1][y] + matrix[x+1][y+1] + matrix[x][y+1]; //top } else if (y == 0) { t("six"); count = matrix[x][y-1] + matrix[x-1][y+1] + matrix[x+1][y] + matrix[x+1][y+1] + matrix[x][y+1]; //right side } else if (x == max_x) { t("seven"); count = matrix[x][y-1] + matrix[x-1][y-1] + matrix[x-1][y] + matrix[x-1][y+1] + matrix[x][y+1]; //bottom } else if (y == max_y) { t("eight"); count = matrix[x-1][y] + matrix[x-1][y-1] + matrix[x][y-1] + matrix[x+1][y-1] + matrix[x+1][y]; //all other cases... } else { t("case Z"); count = matrix[x-1][y-1] + matrix[x-1][y] + matrix[x-1][y+1] + matrix[x][y-1] + matrix[x][y+1] + matrix[x+1][y-1] + matrix[x+1][y] + matrix[x+1][y+1]; } if (count ==0) { matrix[x][y] = 2; t("setting to zero"); } return count; } void readout(); int main(int argc, char** argv){ if (argc != 3) usage(); alloc_matrix(); init_matrix(); load_matrix(argv[1]); print_matrix(matrix); //int c = search_horiz(1,1); // use matrix coords (subtract 1 from marker #) //remove speck code works int x,y; for (x=0; x<=max_x; x++){ for (y=x; y <=max_y; y++){ int c= remove_speck(x,y); } } // start from left, top // search horiz works //int c =search_horiz(5,10); //printf("count=%d\n", c); //int c = remove_speck(0,9); print_matrix(matrix); //readout(); }
b0a5e988a299b0613e234b8bfe423a5f9e9574fe
8a9b824c98e24a20cc93d929fb05a111c09823ce
/linkedlist/removekth.c
163972249bd6f4683d8fb5ace88e7e3018cbba61
[]
no_license
mohankri/goc
ebf02e13055f9c76c84203a72e22b49b9c0f3a0f
6eb3531a28c45aa808f865688bd2576a108a4444
refs/heads/master
2020-06-03T05:01:00.026272
2019-03-21T07:38:18
2019-03-21T07:38:18
41,529,900
0
0
null
null
null
null
UTF-8
C
false
false
1,022
c
removekth.c
#include <stdio.h> #include <stdlib.h> typedef struct node { int val; struct node *next; } node_t; node_t * alloc_node(int val) { node_t *node = malloc(sizeof(node_t)); node->val = val; node->next = NULL; return node; } node_t * remove_elem(node_t **root, int k) { node_t *temp = *root; node_t *head = temp; node_t *prev = head; int count = 0; if (temp == NULL) { return NULL; } while (temp) { count++; if (count == k) { if (temp == head) { prev = temp; temp = temp->next; free(prev); head = temp; } else { prev->next = temp->next; free(temp); } } prev = temp; temp = temp->next; } *root = head; return (head); } int main() { node_t *temp; node_t *root = alloc_node(1); root->next = alloc_node(2); root->next->next = alloc_node(3); root->next->next->next = alloc_node(4); root->next->next->next->next = alloc_node(5); root = remove_elem(&root, 1); for (temp = root; temp != NULL; temp = temp->next) { printf("%d \n", temp->val); } }
a0ea7b3114be40de0115742850046428d54e3ed0
5b048304d313179fb14bbc19734194601de549f7
/ndirfil/mdir/M_sklearn__grid_search.c
0a16a9fb4570187a3fc510f8053f20ac6692682c
[]
no_license
codezakh/Movie-Database-Production-SVM
08a4a574624212d354267fa2a65d6a32c7d39bdc
46647074a932e0b300dd194606363c4188aa5b1a
refs/heads/master
2016-09-05T16:21:26.953448
2014-04-04T06:01:33
2014-04-04T06:01:33
null
0
0
null
null
null
null
UTF-8
C
false
false
109,977
c
M_sklearn__grid_search.c
unsigned char M_sklearn__grid_search[] = { 99,0,0,0,0,0,0,0,0,6,0,0,0,64,0,1, 0,115,46,2,0,0,100,0,0,90,0,0,100,1,0,100, 2,0,108,1,0,109,2,0,90,2,0,1,100,1,0,100, 3,0,108,3,0,109,4,0,90,4,0,109,5,0,90,5, 0,1,100,1,0,100,4,0,108,6,0,109,7,0,90,7, 0,109,8,0,90,8,0,109,9,0,90,9,0,1,100,1, 0,100,5,0,108,10,0,109,11,0,90,11,0,109,12,0, 90,12,0,1,100,1,0,100,6,0,108,13,0,109,14,0, 90,14,0,1,100,1,0,100,7,0,108,15,0,90,15,0, 100,1,0,100,7,0,108,16,0,90,16,0,100,1,0,100, 7,0,108,17,0,90,17,0,100,1,0,100,7,0,108,18, 0,90,18,0,100,1,0,100,7,0,108,19,0,90,20,0, 100,8,0,100,9,0,108,21,0,109,22,0,90,22,0,109, 23,0,90,23,0,109,24,0,90,24,0,1,100,8,0,100, 10,0,108,21,0,109,25,0,90,25,0,1,100,8,0,100, 11,0,108,26,0,109,27,0,90,27,0,1,100,8,0,100, 12,0,108,28,0,109,29,0,90,29,0,109,30,0,90,30, 0,109,31,0,90,31,0,1,100,8,0,100,13,0,108,32, 0,109,33,0,90,33,0,1,100,8,0,100,14,0,108,34, 0,109,35,0,90,35,0,109,36,0,90,36,0,1,100,8, 0,100,15,0,108,37,0,109,38,0,90,38,0,109,39,0, 90,39,0,1,100,8,0,100,16,0,108,40,0,109,41,0, 90,41,0,1,100,17,0,100,18,0,100,19,0,100,20,0, 100,21,0,103,5,0,90,42,0,100,18,0,101,43,0,102, 1,0,100,22,0,132,0,0,131,0,0,89,90,44,0,100, 23,0,101,44,0,102,1,0,100,24,0,132,0,0,131,0, 0,89,90,45,0,100,20,0,101,43,0,102,1,0,100,25, 0,132,0,0,131,0,0,89,90,46,0,100,7,0,100,26, 0,132,1,0,90,48,0,100,27,0,132,0,0,90,49,0, 100,28,0,101,8,0,100,28,0,100,37,0,131,2,0,102, 1,0,100,32,0,132,0,0,131,0,0,89,90,50,0,100, 33,0,101,33,0,106,51,0,101,4,0,101,22,0,101,25, 0,131,3,0,102,1,0,100,34,0,132,0,0,131,0,0, 89,90,52,0,100,17,0,101,52,0,102,1,0,100,35,0, 132,0,0,131,0,0,89,90,53,0,100,21,0,101,52,0, 102,1,0,100,36,0,132,0,0,131,0,0,89,90,54,0, 100,7,0,83,40,38,0,0,0,115,96,0,0,0,10,84, 104,101,32,58,109,111,100,58,96,115,107,108,101,97,114,110, 46,103,114,105,100,95,115,101,97,114,99,104,96,32,105,110, 99,108,117,100,101,115,32,117,116,105,108,105,116,105,101,115, 32,116,111,32,102,105,110,101,45,116,117,110,101,32,116,104, 101,32,112,97,114,97,109,101,116,101,114,115,10,111,102,32, 97,110,32,101,115,116,105,109,97,116,111,114,46,10,105,255, 255,255,255,40,1,0,0,0,116,14,0,0,0,112,114,105, 110,116,95,102,117,110,99,116,105,111,110,40,2,0,0,0, 116,7,0,0,0,65,66,67,77,101,116,97,116,14,0,0, 0,97,98,115,116,114,97,99,116,109,101,116,104,111,100,40, 3,0,0,0,116,7,0,0,0,77,97,112,112,105,110,103, 116,10,0,0,0,110,97,109,101,100,116,117,112,108,101,116, 5,0,0,0,83,105,122,101,100,40,2,0,0,0,116,7, 0,0,0,112,97,114,116,105,97,108,116,6,0,0,0,114, 101,100,117,99,101,40,1,0,0,0,116,7,0,0,0,112, 114,111,100,117,99,116,78,105,1,0,0,0,40,3,0,0, 0,116,13,0,0,0,66,97,115,101,69,115,116,105,109,97, 116,111,114,116,13,0,0,0,105,115,95,99,108,97,115,115, 105,102,105,101,114,116,5,0,0,0,99,108,111,110,101,40, 1,0,0,0,116,18,0,0,0,77,101,116,97,69,115,116, 105,109,97,116,111,114,77,105,120,105,110,40,1,0,0,0, 116,8,0,0,0,99,104,101,99,107,95,99,118,40,3,0, 0,0,116,8,0,0,0,80,97,114,97,108,108,101,108,116, 7,0,0,0,100,101,108,97,121,101,100,116,6,0,0,0, 108,111,103,103,101,114,40,1,0,0,0,116,3,0,0,0, 115,105,120,40,2,0,0,0,116,9,0,0,0,115,97,102, 101,95,109,97,115,107,116,18,0,0,0,99,104,101,99,107, 95,114,97,110,100,111,109,95,115,116,97,116,101,40,2,0, 0,0,116,12,0,0,0,95,110,117,109,95,115,97,109,112, 108,101,115,116,12,0,0,0,99,104,101,99,107,95,97,114, 114,97,121,115,40,1,0,0,0,116,31,0,0,0,95,100, 101,112,114,101,99,97,116,101,95,108,111,115,115,95,97,110, 100,95,115,99,111,114,101,95,102,117,110,99,115,116,12,0, 0,0,71,114,105,100,83,101,97,114,99,104,67,86,116,13, 0,0,0,80,97,114,97,109,101,116,101,114,71,114,105,100, 116,14,0,0,0,102,105,116,95,103,114,105,100,95,112,111, 105,110,116,116,16,0,0,0,80,97,114,97,109,101,116,101, 114,83,97,109,112,108,101,114,116,18,0,0,0,82,97,110, 100,111,109,105,122,101,100,83,101,97,114,99,104,67,86,99, 0,0,0,0,0,0,0,0,1,0,0,0,66,0,1,0, 115,41,0,0,0,101,0,0,90,1,0,100,0,0,90,2, 0,100,1,0,132,0,0,90,3,0,100,2,0,132,0,0, 90,4,0,100,3,0,132,0,0,90,5,0,82,83,40,4, 0,0,0,115,92,5,0,0,71,114,105,100,32,111,102,32, 112,97,114,97,109,101,116,101,114,115,32,119,105,116,104,32, 97,32,100,105,115,99,114,101,116,101,32,110,117,109,98,101, 114,32,111,102,32,118,97,108,117,101,115,32,102,111,114,32, 101,97,99,104,46,10,10,32,32,32,32,67,97,110,32,98, 101,32,117,115,101,100,32,116,111,32,105,116,101,114,97,116, 101,32,111,118,101,114,32,112,97,114,97,109,101,116,101,114, 32,118,97,108,117,101,32,99,111,109,98,105,110,97,116,105, 111,110,115,32,119,105,116,104,32,116,104,101,10,32,32,32, 32,80,121,116,104,111,110,32,98,117,105,108,116,45,105,110, 32,102,117,110,99,116,105,111,110,32,105,116,101,114,46,10, 10,32,32,32,32,80,97,114,97,109,101,116,101,114,115,10, 32,32,32,32,45,45,45,45,45,45,45,45,45,45,10,32, 32,32,32,112,97,114,97,109,95,103,114,105,100,32,58,32, 100,105,99,116,32,111,102,32,115,116,114,105,110,103,32,116, 111,32,115,101,113,117,101,110,99,101,44,32,111,114,32,115, 101,113,117,101,110,99,101,32,111,102,32,115,117,99,104,10, 32,32,32,32,32,32,32,32,84,104,101,32,112,97,114,97, 109,101,116,101,114,32,103,114,105,100,32,116,111,32,101,120, 112,108,111,114,101,44,32,97,115,32,97,32,100,105,99,116, 105,111,110,97,114,121,32,109,97,112,112,105,110,103,32,101, 115,116,105,109,97,116,111,114,10,32,32,32,32,32,32,32, 32,112,97,114,97,109,101,116,101,114,115,32,116,111,32,115, 101,113,117,101,110,99,101,115,32,111,102,32,97,108,108,111, 119,101,100,32,118,97,108,117,101,115,46,10,10,32,32,32, 32,32,32,32,32,65,110,32,101,109,112,116,121,32,100,105, 99,116,32,115,105,103,110,105,102,105,101,115,32,100,101,102, 97,117,108,116,32,112,97,114,97,109,101,116,101,114,115,46, 10,10,32,32,32,32,32,32,32,32,65,32,115,101,113,117, 101,110,99,101,32,111,102,32,100,105,99,116,115,32,115,105, 103,110,105,102,105,101,115,32,97,32,115,101,113,117,101,110, 99,101,32,111,102,32,103,114,105,100,115,32,116,111,32,115, 101,97,114,99,104,44,32,97,110,100,32,105,115,10,32,32, 32,32,32,32,32,32,117,115,101,102,117,108,32,116,111,32, 97,118,111,105,100,32,101,120,112,108,111,114,105,110,103,32, 112,97,114,97,109,101,116,101,114,32,99,111,109,98,105,110, 97,116,105,111,110,115,32,116,104,97,116,32,109,97,107,101, 32,110,111,32,115,101,110,115,101,10,32,32,32,32,32,32, 32,32,111,114,32,104,97,118,101,32,110,111,32,101,102,102, 101,99,116,46,32,83,101,101,32,116,104,101,32,101,120,97, 109,112,108,101,115,32,98,101,108,111,119,46,10,10,32,32, 32,32,69,120,97,109,112,108,101,115,10,32,32,32,32,45, 45,45,45,45,45,45,45,10,32,32,32,32,62,62,62,32, 102,114,111,109,32,115,107,108,101,97,114,110,46,103,114,105, 100,95,115,101,97,114,99,104,32,105,109,112,111,114,116,32, 80,97,114,97,109,101,116,101,114,71,114,105,100,10,32,32, 32,32,62,62,62,32,112,97,114,97,109,95,103,114,105,100, 32,61,32,123,39,97,39,58,32,91,49,44,32,50,93,44, 32,39,98,39,58,32,91,84,114,117,101,44,32,70,97,108, 115,101,93,125,10,32,32,32,32,62,62,62,32,108,105,115, 116,40,80,97,114,97,109,101,116,101,114,71,114,105,100,40, 112,97,114,97,109,95,103,114,105,100,41,41,32,61,61,32, 40,10,32,32,32,32,46,46,46,32,32,32,32,91,123,39, 97,39,58,32,49,44,32,39,98,39,58,32,84,114,117,101, 125,44,32,123,39,97,39,58,32,49,44,32,39,98,39,58, 32,70,97,108,115,101,125,44,10,32,32,32,32,46,46,46, 32,32,32,32,32,123,39,97,39,58,32,50,44,32,39,98, 39,58,32,84,114,117,101,125,44,32,123,39,97,39,58,32, 50,44,32,39,98,39,58,32,70,97,108,115,101,125,93,41, 10,32,32,32,32,84,114,117,101,10,10,32,32,32,32,62, 62,62,32,103,114,105,100,32,61,32,91,123,39,107,101,114, 110,101,108,39,58,32,91,39,108,105,110,101,97,114,39,93, 125,44,32,123,39,107,101,114,110,101,108,39,58,32,91,39, 114,98,102,39,93,44,32,39,103,97,109,109,97,39,58,32, 91,49,44,32,49,48,93,125,93,10,32,32,32,32,62,62, 62,32,108,105,115,116,40,80,97,114,97,109,101,116,101,114, 71,114,105,100,40,103,114,105,100,41,41,32,61,61,32,91, 123,39,107,101,114,110,101,108,39,58,32,39,108,105,110,101, 97,114,39,125,44,10,32,32,32,32,46,46,46,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,123,39,107,101, 114,110,101,108,39,58,32,39,114,98,102,39,44,32,39,103, 97,109,109,97,39,58,32,49,125,44,10,32,32,32,32,46, 46,46,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,123,39,107,101,114,110,101,108,39,58,32,39,114,98,102, 39,44,32,39,103,97,109,109,97,39,58,32,49,48,125,93, 10,32,32,32,32,84,114,117,101,10,10,32,32,32,32,83, 101,101,32,97,108,115,111,10,32,32,32,32,45,45,45,45, 45,45,45,45,10,32,32,32,32,58,99,108,97,115,115,58, 96,71,114,105,100,83,101,97,114,99,104,67,86,96,58,10, 32,32,32,32,32,32,32,32,117,115,101,115,32,96,96,80, 97,114,97,109,101,116,101,114,71,114,105,100,96,96,32,116, 111,32,112,101,114,102,111,114,109,32,97,32,102,117,108,108, 32,112,97,114,97,108,108,101,108,105,122,101,100,32,112,97, 114,97,109,101,116,101,114,32,115,101,97,114,99,104,46,10, 32,32,32,32,99,2,0,0,0,2,0,0,0,3,0,0, 0,67,0,1,0,115,40,0,0,0,116,0,0,124,1,0, 116,1,0,131,2,0,114,27,0,124,1,0,103,1,0,125, 1,0,110,0,0,124,1,0,124,0,0,95,2,0,100,0, 0,83,40,1,0,0,0,78,40,3,0,0,0,116,10,0, 0,0,105,115,105,110,115,116,97,110,99,101,82,3,0,0, 0,116,10,0,0,0,112,97,114,97,109,95,103,114,105,100, 40,2,0,0,0,116,4,0,0,0,115,101,108,102,82,29, 0,0,0,40,0,0,0,0,40,0,0,0,0,115,61,0, 0,0,47,117,115,114,47,108,111,99,97,108,47,108,105,98, 47,112,121,116,104,111,110,50,46,55,47,100,105,115,116,45, 112,97,99,107,97,103,101,115,47,115,107,108,101,97,114,110, 47,103,114,105,100,95,115,101,97,114,99,104,46,112,121,116, 8,0,0,0,95,95,105,110,105,116,95,95,77,0,0,0, 115,6,0,0,0,0,1,15,4,12,1,99,1,0,0,0, 7,0,0,0,6,0,0,0,99,0,1,0,115,123,0,0, 0,120,116,0,124,0,0,106,0,0,68,93,105,0,125,1, 0,116,1,0,124,1,0,106,2,0,131,0,0,131,1,0, 125,2,0,124,2,0,115,48,0,105,0,0,86,1,113,10, 0,116,3,0,124,2,0,140,0,0,92,2,0,125,3,0, 125,4,0,120,46,0,116,4,0,124,4,0,140,0,0,68, 93,32,0,125,5,0,116,5,0,116,3,0,124,3,0,124, 5,0,131,2,0,131,1,0,125,6,0,124,6,0,86,1, 113,79,0,87,113,10,0,87,100,1,0,83,40,2,0,0, 0,115,238,0,0,0,73,116,101,114,97,116,101,32,111,118, 101,114,32,116,104,101,32,112,111,105,110,116,115,32,105,110, 32,116,104,101,32,103,114,105,100,46,10,10,32,32,32,32, 32,32,32,32,82,101,116,117,114,110,115,10,32,32,32,32, 32,32,32,32,45,45,45,45,45,45,45,10,32,32,32,32, 32,32,32,32,112,97,114,97,109,115,32,58,32,105,116,101, 114,97,116,111,114,32,111,118,101,114,32,100,105,99,116,32, 111,102,32,115,116,114,105,110,103,32,116,111,32,97,110,121, 10,32,32,32,32,32,32,32,32,32,32,32,32,89,105,101, 108,100,115,32,100,105,99,116,105,111,110,97,114,105,101,115, 32,109,97,112,112,105,110,103,32,101,97,99,104,32,101,115, 116,105,109,97,116,111,114,32,112,97,114,97,109,101,116,101, 114,32,116,111,32,111,110,101,32,111,102,32,105,116,115,10, 32,32,32,32,32,32,32,32,32,32,32,32,97,108,108,111, 119,101,100,32,118,97,108,117,101,115,46,10,32,32,32,32, 32,32,32,32,78,40,6,0,0,0,82,29,0,0,0,116, 6,0,0,0,115,111,114,116,101,100,116,5,0,0,0,105, 116,101,109,115,116,3,0,0,0,122,105,112,82,8,0,0, 0,116,4,0,0,0,100,105,99,116,40,7,0,0,0,82, 30,0,0,0,116,1,0,0,0,112,82,33,0,0,0,116, 4,0,0,0,107,101,121,115,116,6,0,0,0,118,97,108, 117,101,115,116,1,0,0,0,118,116,6,0,0,0,112,97, 114,97,109,115,40,0,0,0,0,40,0,0,0,0,115,61, 0,0,0,47,117,115,114,47,108,111,99,97,108,47,108,105, 98,47,112,121,116,104,111,110,50,46,55,47,100,105,115,116, 45,112,97,99,107,97,103,101,115,47,115,107,108,101,97,114, 110,47,103,114,105,100,95,115,101,97,114,99,104,46,112,121, 116,8,0,0,0,95,95,105,116,101,114,95,95,85,0,0, 0,115,16,0,0,0,0,9,16,2,18,1,6,1,8,2, 18,1,19,1,21,1,99,1,0,0,0,1,0,0,0,3, 0,0,0,3,0,1,0,115,47,0,0,0,116,0,0,116, 1,0,116,2,0,106,3,0,131,2,0,137,0,0,116,4, 0,135,0,0,102,1,0,100,1,0,134,0,0,124,0,0, 106,5,0,68,131,1,0,131,1,0,83,40,2,0,0,0, 115,29,0,0,0,78,117,109,98,101,114,32,111,102,32,112, 111,105,110,116,115,32,111,110,32,116,104,101,32,103,114,105, 100,46,99,1,0,0,0,2,0,0,0,4,0,0,0,51, 0,1,0,115,55,0,0,0,124,0,0,93,45,0,125,1, 0,124,1,0,114,43,0,136,0,0,100,0,0,132,0,0, 124,1,0,106,0,0,131,0,0,68,131,1,0,131,1,0, 110,3,0,100,1,0,86,1,113,3,0,100,2,0,83,40, 3,0,0,0,99,1,0,0,0,2,0,0,0,3,0,0, 0,115,0,1,0,115,27,0,0,0,124,0,0,93,17,0, 125,1,0,116,0,0,124,1,0,131,1,0,86,1,113,3, 0,100,0,0,83,40,1,0,0,0,78,40,1,0,0,0, 116,3,0,0,0,108,101,110,40,2,0,0,0,116,2,0, 0,0,46,48,82,39,0,0,0,40,0,0,0,0,40,0, 0,0,0,115,61,0,0,0,47,117,115,114,47,108,111,99, 97,108,47,108,105,98,47,112,121,116,104,111,110,50,46,55, 47,100,105,115,116,45,112,97,99,107,97,103,101,115,47,115, 107,108,101,97,114,110,47,103,114,105,100,95,115,101,97,114, 99,104,46,112,121,115,9,0,0,0,60,103,101,110,101,120, 112,114,62,109,0,0,0,115,2,0,0,0,6,0,105,1, 0,0,0,78,40,1,0,0,0,82,38,0,0,0,40,2, 0,0,0,82,43,0,0,0,82,36,0,0,0,40,1,0, 0,0,82,8,0,0,0,40,0,0,0,0,115,61,0,0, 0,47,117,115,114,47,108,111,99,97,108,47,108,105,98,47, 112,121,116,104,111,110,50,46,55,47,100,105,115,116,45,112, 97,99,107,97,103,101,115,47,115,107,108,101,97,114,110,47, 103,114,105,100,95,115,101,97,114,99,104,46,112,121,115,9, 0,0,0,60,103,101,110,101,120,112,114,62,109,0,0,0, 115,2,0,0,0,6,1,40,6,0,0,0,82,6,0,0, 0,82,7,0,0,0,116,8,0,0,0,111,112,101,114,97, 116,111,114,116,3,0,0,0,109,117,108,116,3,0,0,0, 115,117,109,82,29,0,0,0,40,1,0,0,0,82,30,0, 0,0,40,0,0,0,0,40,1,0,0,0,82,8,0,0, 0,115,61,0,0,0,47,117,115,114,47,108,111,99,97,108, 47,108,105,98,47,112,121,116,104,111,110,50,46,55,47,100, 105,115,116,45,112,97,99,107,97,103,101,115,47,115,107,108, 101,97,114,110,47,103,114,105,100,95,115,101,97,114,99,104, 46,112,121,116,7,0,0,0,95,95,108,101,110,95,95,105, 0,0,0,115,6,0,0,0,0,3,18,1,15,1,40,6, 0,0,0,116,8,0,0,0,95,95,110,97,109,101,95,95, 116,10,0,0,0,95,95,109,111,100,117,108,101,95,95,116, 7,0,0,0,95,95,100,111,99,95,95,82,31,0,0,0, 82,41,0,0,0,82,47,0,0,0,40,0,0,0,0,40, 0,0,0,0,40,0,0,0,0,115,61,0,0,0,47,117, 115,114,47,108,111,99,97,108,47,108,105,98,47,112,121,116, 104,111,110,50,46,55,47,100,105,115,116,45,112,97,99,107, 97,103,101,115,47,115,107,108,101,97,114,110,47,103,114,105, 100,95,115,101,97,114,99,104,46,112,121,82,24,0,0,0, 38,0,0,0,115,8,0,0,0,6,37,6,2,9,8,9, 20,116,8,0,0,0,73,116,101,114,71,114,105,100,99,0, 0,0,0,0,0,0,0,1,0,0,0,66,0,1,0,115, 23,0,0,0,101,0,0,90,1,0,100,0,0,90,2,0, 100,1,0,132,0,0,90,3,0,82,83,40,2,0,0,0, 115,203,3,0,0,71,101,110,101,114,97,116,111,114,115,32, 111,110,32,116,104,101,32,99,111,109,98,105,110,97,116,105, 111,110,32,111,102,32,116,104,101,32,118,97,114,105,111,117, 115,32,112,97,114,97,109,101,116,101,114,32,108,105,115,116, 115,32,103,105,118,101,110,46,10,10,32,32,32,32,84,104, 105,115,32,99,108,97,115,115,32,105,115,32,68,69,80,82, 69,67,65,84,69,68,46,32,73,116,32,119,97,115,32,114, 101,110,97,109,101,100,32,116,111,32,96,96,80,97,114,97, 109,101,116,101,114,71,114,105,100,96,96,46,32,84,104,101, 32,110,97,109,101,10,32,32,32,32,96,96,73,116,101,114, 71,114,105,100,96,96,32,119,105,108,108,32,98,101,32,114, 101,109,111,118,101,100,32,105,110,32,48,46,49,53,46,10, 10,32,32,32,32,80,97,114,97,109,101,116,101,114,115,10, 32,32,32,32,45,45,45,45,45,45,45,45,45,45,10,32, 32,32,32,112,97,114,97,109,95,103,114,105,100,32,58,32, 100,105,99,116,32,111,102,32,115,116,114,105,110,103,32,116, 111,32,115,101,113,117,101,110,99,101,10,32,32,32,32,32, 32,32,32,84,104,101,32,112,97,114,97,109,101,116,101,114, 32,103,114,105,100,32,116,111,32,101,120,112,108,111,114,101, 44,32,97,115,32,97,32,100,105,99,116,105,111,110,97,114, 121,32,109,97,112,112,105,110,103,32,101,115,116,105,109,97, 116,111,114,10,32,32,32,32,32,32,32,32,112,97,114,97, 109,101,116,101,114,115,32,116,111,32,115,101,113,117,101,110, 99,101,115,32,111,102,32,97,108,108,111,119,101,100,32,118, 97,108,117,101,115,46,10,10,32,32,32,32,82,101,116,117, 114,110,115,10,32,32,32,32,45,45,45,45,45,45,45,10, 32,32,32,32,112,97,114,97,109,115,32,58,32,100,105,99, 116,32,111,102,32,115,116,114,105,110,103,32,116,111,32,97, 110,121,10,32,32,32,32,32,32,32,32,42,42,89,105,101, 108,100,115,42,42,32,100,105,99,116,105,111,110,97,114,105, 101,115,32,109,97,112,112,105,110,103,32,101,97,99,104,32, 101,115,116,105,109,97,116,111,114,32,112,97,114,97,109,101, 116,101,114,32,116,111,32,111,110,101,32,111,102,32,105,116, 115,10,32,32,32,32,32,32,32,32,97,108,108,111,119,101, 100,32,118,97,108,117,101,115,46,10,10,32,32,32,32,69, 120,97,109,112,108,101,115,10,32,32,32,32,45,45,45,45, 45,45,45,45,10,32,32,32,32,62,62,62,32,102,114,111, 109,32,115,107,108,101,97,114,110,46,103,114,105,100,95,115, 101,97,114,99,104,32,105,109,112,111,114,116,32,73,116,101, 114,71,114,105,100,10,32,32,32,32,62,62,62,32,112,97, 114,97,109,95,103,114,105,100,32,61,32,123,39,97,39,58, 91,49,44,32,50,93,44,32,39,98,39,58,91,84,114,117, 101,44,32,70,97,108,115,101,93,125,10,32,32,32,32,62, 62,62,32,108,105,115,116,40,73,116,101,114,71,114,105,100, 40,112,97,114,97,109,95,103,114,105,100,41,41,32,61,61, 32,40,10,32,32,32,32,46,46,46,32,32,32,32,91,123, 39,97,39,58,32,49,44,32,39,98,39,58,32,84,114,117, 101,125,44,32,123,39,97,39,58,32,49,44,32,39,98,39, 58,32,70,97,108,115,101,125,44,10,32,32,32,32,46,46, 46,32,32,32,32,32,123,39,97,39,58,32,50,44,32,39, 98,39,58,32,84,114,117,101,125,44,32,123,39,97,39,58, 32,50,44,32,39,98,39,58,32,70,97,108,115,101,125,93, 41,10,32,32,32,32,84,114,117,101,10,10,32,32,32,32, 83,101,101,32,97,108,115,111,10,32,32,32,32,45,45,45, 45,45,45,45,45,10,32,32,32,32,58,99,108,97,115,115, 58,96,71,114,105,100,83,101,97,114,99,104,67,86,96,58, 10,32,32,32,32,32,32,32,32,117,115,101,115,32,96,96, 73,116,101,114,71,114,105,100,96,96,32,116,111,32,112,101, 114,102,111,114,109,32,97,32,102,117,108,108,32,112,97,114, 97,108,108,101,108,105,122,101,100,32,112,97,114,97,109,101, 116,101,114,32,115,101,97,114,99,104,46,10,32,32,32,32, 99,2,0,0,0,2,0,0,0,3,0,0,0,67,0,1, 0,115,42,0,0,0,116,0,0,106,1,0,100,1,0,116, 2,0,131,2,0,1,116,3,0,116,4,0,124,0,0,131, 2,0,106,5,0,124,1,0,131,1,0,1,100,0,0,83, 40,2,0,0,0,78,115,66,0,0,0,73,116,101,114,71, 114,105,100,32,119,97,115,32,114,101,110,97,109,101,100,32, 116,111,32,80,97,114,97,109,101,116,101,114,71,114,105,100, 32,97,110,100,32,119,105,108,108,32,98,101,32,114,101,109, 111,118,101,100,32,105,110,32,48,46,49,53,46,40,6,0, 0,0,116,8,0,0,0,119,97,114,110,105,110,103,115,116, 4,0,0,0,119,97,114,110,116,18,0,0,0,68,101,112, 114,101,99,97,116,105,111,110,87,97,114,110,105,110,103,116, 5,0,0,0,115,117,112,101,114,82,51,0,0,0,82,31, 0,0,0,40,2,0,0,0,82,30,0,0,0,82,29,0, 0,0,40,0,0,0,0,40,0,0,0,0,115,61,0,0, 0,47,117,115,114,47,108,111,99,97,108,47,108,105,98,47, 112,121,116,104,111,110,50,46,55,47,100,105,115,116,45,112, 97,99,107,97,103,101,115,47,115,107,108,101,97,114,110,47, 103,114,105,100,95,115,101,97,114,99,104,46,112,121,82,31, 0,0,0,146,0,0,0,115,6,0,0,0,0,1,9,1, 7,1,40,4,0,0,0,82,48,0,0,0,82,49,0,0, 0,82,50,0,0,0,82,31,0,0,0,40,0,0,0,0, 40,0,0,0,0,40,0,0,0,0,115,61,0,0,0,47, 117,115,114,47,108,111,99,97,108,47,108,105,98,47,112,121, 116,104,111,110,50,46,55,47,100,105,115,116,45,112,97,99, 107,97,103,101,115,47,115,107,108,101,97,114,110,47,103,114, 105,100,95,115,101,97,114,99,104,46,112,121,82,51,0,0, 0,113,0,0,0,115,4,0,0,0,6,31,6,2,99,0, 0,0,0,0,0,0,0,2,0,0,0,66,0,1,0,115, 44,0,0,0,101,0,0,90,1,0,100,0,0,90,2,0, 100,4,0,100,1,0,132,1,0,90,4,0,100,2,0,132, 0,0,90,5,0,100,3,0,132,0,0,90,6,0,82,83, 40,5,0,0,0,115,127,7,0,0,71,101,110,101,114,97, 116,111,114,32,111,110,32,112,97,114,97,109,101,116,101,114, 115,32,115,97,109,112,108,101,100,32,102,114,111,109,32,103, 105,118,101,110,32,100,105,115,116,114,105,98,117,116,105,111, 110,115,46,10,10,32,32,32,32,78,111,110,45,100,101,116, 101,114,109,105,110,105,115,116,105,99,32,105,116,101,114,97, 98,108,101,32,111,118,101,114,32,114,97,110,100,111,109,32, 99,97,110,100,105,100,97,116,101,32,99,111,109,98,105,110, 97,116,105,111,110,115,32,102,111,114,32,104,121,112,101,114, 45,10,32,32,32,32,112,97,114,97,109,101,116,101,114,32, 115,101,97,114,99,104,46,10,10,32,32,32,32,78,111,116, 101,32,116,104,97,116,32,97,115,32,111,102,32,83,99,105, 80,121,32,48,46,49,50,44,32,116,104,101,32,96,96,115, 99,105,112,121,46,115,116,97,116,115,46,100,105,115,116,114, 105,98,117,116,105,111,110,115,96,96,32,100,111,32,110,111, 116,32,97,99,99,101,112,116,10,32,32,32,32,97,32,99, 117,115,116,111,109,32,82,78,71,32,105,110,115,116,97,110, 99,101,32,97,110,100,32,97,108,119,97,121,115,32,117,115, 101,32,116,104,101,32,115,105,110,103,108,101,116,111,110,32, 82,78,71,32,102,114,111,109,10,32,32,32,32,96,96,110, 117,109,112,121,46,114,97,110,100,111,109,96,96,46,32,72, 101,110,99,101,32,115,101,116,116,105,110,103,32,96,96,114, 97,110,100,111,109,95,115,116,97,116,101,96,96,32,119,105, 108,108,32,110,111,116,32,103,117,97,114,97,110,116,101,101, 32,97,10,32,32,32,32,100,101,116,101,114,109,105,110,105, 115,116,105,99,32,105,116,101,114,97,116,105,111,110,32,119, 104,101,110,101,118,101,114,32,96,96,115,99,105,112,121,46, 115,116,97,116,115,96,96,32,100,105,115,116,114,105,98,117, 116,105,111,110,115,32,97,114,101,32,117,115,101,100,32,116, 111,10,32,32,32,32,100,101,102,105,110,101,32,116,104,101, 32,112,97,114,97,109,101,116,101,114,32,115,101,97,114,99, 104,32,115,112,97,99,101,46,10,10,32,32,32,32,80,97, 114,97,109,101,116,101,114,115,10,32,32,32,32,45,45,45, 45,45,45,45,45,45,45,10,32,32,32,32,112,97,114,97, 109,95,100,105,115,116,114,105,98,117,116,105,111,110,115,32, 58,32,100,105,99,116,10,32,32,32,32,32,32,32,32,68, 105,99,116,105,111,110,97,114,121,32,119,104,101,114,101,32, 116,104,101,32,107,101,121,115,32,97,114,101,32,112,97,114, 97,109,101,116,101,114,115,32,97,110,100,32,118,97,108,117, 101,115,10,32,32,32,32,32,32,32,32,97,114,101,32,100, 105,115,116,114,105,98,117,116,105,111,110,115,32,102,114,111, 109,32,119,104,105,99,104,32,97,32,112,97,114,97,109,101, 116,101,114,32,105,115,32,116,111,32,98,101,32,115,97,109, 112,108,101,100,46,10,32,32,32,32,32,32,32,32,68,105, 115,116,114,105,98,117,116,105,111,110,115,32,101,105,116,104, 101,114,32,104,97,118,101,32,116,111,32,112,114,111,118,105, 100,101,32,97,32,96,96,114,118,115,96,96,32,102,117,110, 99,116,105,111,110,10,32,32,32,32,32,32,32,32,116,111, 32,115,97,109,112,108,101,32,102,114,111,109,32,116,104,101, 109,44,32,111,114,32,99,97,110,32,98,101,32,103,105,118, 101,110,32,97,115,32,97,32,108,105,115,116,32,111,102,32, 118,97,108,117,101,115,44,10,32,32,32,32,32,32,32,32, 119,104,101,114,101,32,97,32,117,110,105,102,111,114,109,32, 100,105,115,116,114,105,98,117,116,105,111,110,32,105,115,32, 97,115,115,117,109,101,100,46,10,10,32,32,32,32,110,95, 105,116,101,114,32,58,32,105,110,116,101,103,101,114,10,32, 32,32,32,32,32,32,32,78,117,109,98,101,114,32,111,102, 32,112,97,114,97,109,101,116,101,114,32,115,101,116,116,105, 110,103,115,32,116,104,97,116,32,97,114,101,32,112,114,111, 100,117,99,101,100,46,10,10,32,32,32,32,114,97,110,100, 111,109,95,115,116,97,116,101,32,58,32,105,110,116,32,111, 114,32,82,97,110,100,111,109,83,116,97,116,101,10,32,32, 32,32,32,32,32,32,80,115,101,117,100,111,32,114,97,110, 100,111,109,32,110,117,109,98,101,114,32,103,101,110,101,114, 97,116,111,114,32,115,116,97,116,101,32,117,115,101,100,32, 102,111,114,32,114,97,110,100,111,109,32,117,110,105,102,111, 114,109,32,115,97,109,112,108,105,110,103,10,32,32,32,32, 32,32,32,32,102,114,111,109,32,108,105,115,116,115,32,111, 102,32,112,111,115,115,105,98,108,101,32,118,97,108,117,101, 115,32,105,110,115,116,101,97,100,32,111,102,32,115,99,105, 112,121,46,115,116,97,116,115,32,100,105,115,116,114,105,98, 117,116,105,111,110,115,46,10,10,32,32,32,32,82,101,116, 117,114,110,115,10,32,32,32,32,45,45,45,45,45,45,45, 10,32,32,32,32,112,97,114,97,109,115,32,58,32,100,105, 99,116,32,111,102,32,115,116,114,105,110,103,32,116,111,32, 97,110,121,10,32,32,32,32,32,32,32,32,42,42,89,105, 101,108,100,115,42,42,32,100,105,99,116,105,111,110,97,114, 105,101,115,32,109,97,112,112,105,110,103,32,101,97,99,104, 32,101,115,116,105,109,97,116,111,114,32,112,97,114,97,109, 101,116,101,114,32,116,111,10,32,32,32,32,32,32,32,32, 97,115,32,115,97,109,112,108,101,100,32,118,97,108,117,101, 46,10,10,32,32,32,32,69,120,97,109,112,108,101,115,10, 32,32,32,32,45,45,45,45,45,45,45,45,10,32,32,32, 32,62,62,62,32,102,114,111,109,32,115,107,108,101,97,114, 110,46,103,114,105,100,95,115,101,97,114,99,104,32,105,109, 112,111,114,116,32,80,97,114,97,109,101,116,101,114,83,97, 109,112,108,101,114,10,32,32,32,32,62,62,62,32,102,114, 111,109,32,115,99,105,112,121,46,115,116,97,116,115,46,100, 105,115,116,114,105,98,117,116,105,111,110,115,32,105,109,112, 111,114,116,32,101,120,112,111,110,10,32,32,32,32,62,62, 62,32,105,109,112,111,114,116,32,110,117,109,112,121,32,97, 115,32,110,112,10,32,32,32,32,62,62,62,32,110,112,46, 114,97,110,100,111,109,46,115,101,101,100,40,48,41,10,32, 32,32,32,62,62,62,32,112,97,114,97,109,95,103,114,105, 100,32,61,32,123,39,97,39,58,91,49,44,32,50,93,44, 32,39,98,39,58,32,101,120,112,111,110,40,41,125,10,32, 32,32,32,62,62,62,32,112,97,114,97,109,95,108,105,115, 116,32,61,32,108,105,115,116,40,80,97,114,97,109,101,116, 101,114,83,97,109,112,108,101,114,40,112,97,114,97,109,95, 103,114,105,100,44,32,110,95,105,116,101,114,61,52,41,41, 10,32,32,32,32,62,62,62,32,114,111,117,110,100,101,100, 95,108,105,115,116,32,61,32,91,100,105,99,116,40,40,107, 44,32,114,111,117,110,100,40,118,44,32,54,41,41,32,102, 111,114,32,40,107,44,32,118,41,32,105,110,32,100,46,105, 116,101,109,115,40,41,41,10,32,32,32,32,46,46,46,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 102,111,114,32,100,32,105,110,32,112,97,114,97,109,95,108, 105,115,116,93,10,32,32,32,32,62,62,62,32,114,111,117, 110,100,101,100,95,108,105,115,116,32,61,61,32,91,123,39, 98,39,58,32,48,46,56,57,56,53,54,44,32,39,97,39, 58,32,49,125,44,10,32,32,32,32,46,46,46,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,123, 39,98,39,58,32,48,46,57,50,51,50,50,51,44,32,39, 97,39,58,32,49,125,44,10,32,32,32,32,46,46,46,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,123,39,98,39,58,32,49,46,56,55,56,57,54,52,44, 32,39,97,39,58,32,50,125,44,10,32,32,32,32,46,46, 46,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,123,39,98,39,58,32,49,46,48,51,56,49,53, 57,44,32,39,97,39,58,32,50,125,93,10,32,32,32,32, 84,114,117,101,10,32,32,32,32,99,4,0,0,0,4,0, 0,0,2,0,0,0,67,0,1,0,115,31,0,0,0,124, 1,0,124,0,0,95,0,0,124,2,0,124,0,0,95,1, 0,124,3,0,124,0,0,95,2,0,100,0,0,83,40,1, 0,0,0,78,40,3,0,0,0,116,19,0,0,0,112,97, 114,97,109,95,100,105,115,116,114,105,98,117,116,105,111,110, 115,116,6,0,0,0,110,95,105,116,101,114,116,12,0,0, 0,114,97,110,100,111,109,95,115,116,97,116,101,40,4,0, 0,0,82,30,0,0,0,82,56,0,0,0,82,57,0,0, 0,82,58,0,0,0,40,0,0,0,0,40,0,0,0,0, 115,61,0,0,0,47,117,115,114,47,108,111,99,97,108,47, 108,105,98,47,112,121,116,104,111,110,50,46,55,47,100,105, 115,116,45,112,97,99,107,97,103,101,115,47,115,107,108,101, 97,114,110,47,103,114,105,100,95,115,101,97,114,99,104,46, 112,121,82,31,0,0,0,202,0,0,0,115,6,0,0,0, 0,1,9,1,9,1,99,1,0,0,0,7,0,0,0,6, 0,0,0,99,0,1,0,115,166,0,0,0,116,0,0,124, 0,0,106,1,0,131,1,0,125,1,0,116,2,0,124,0, 0,106,3,0,106,4,0,131,0,0,131,1,0,125,2,0, 120,123,0,116,5,0,124,0,0,106,6,0,131,1,0,68, 93,106,0,125,3,0,116,7,0,131,0,0,125,4,0,120, 83,0,124,2,0,68,93,75,0,92,2,0,125,5,0,125, 6,0,116,8,0,124,6,0,100,1,0,131,2,0,114,120, 0,124,6,0,106,9,0,131,0,0,124,4,0,124,5,0, 60,113,74,0,124,6,0,124,1,0,106,10,0,116,11,0, 124,6,0,131,1,0,131,1,0,25,124,4,0,124,5,0, 60,113,74,0,87,124,4,0,86,1,113,52,0,87,100,0, 0,83,40,2,0,0,0,78,116,3,0,0,0,114,118,115, 40,12,0,0,0,82,19,0,0,0,82,58,0,0,0,82, 32,0,0,0,82,56,0,0,0,82,33,0,0,0,116,5, 0,0,0,114,97,110,103,101,82,57,0,0,0,82,35,0, 0,0,116,7,0,0,0,104,97,115,97,116,116,114,82,59, 0,0,0,116,7,0,0,0,114,97,110,100,105,110,116,82, 42,0,0,0,40,7,0,0,0,82,30,0,0,0,116,3, 0,0,0,114,110,100,82,33,0,0,0,116,1,0,0,0, 95,82,40,0,0,0,116,1,0,0,0,107,82,39,0,0, 0,40,0,0,0,0,40,0,0,0,0,115,61,0,0,0, 47,117,115,114,47,108,111,99,97,108,47,108,105,98,47,112, 121,116,104,111,110,50,46,55,47,100,105,115,116,45,112,97, 99,107,97,103,101,115,47,115,107,108,101,97,114,110,47,103, 114,105,100,95,115,101,97,114,99,104,46,112,121,82,41,0, 0,0,207,0,0,0,115,18,0,0,0,0,1,15,2,21, 1,22,1,9,1,19,1,15,1,19,2,33,1,99,1,0, 0,0,1,0,0,0,1,0,0,0,67,0,1,0,115,7, 0,0,0,124,0,0,106,0,0,83,40,1,0,0,0,115, 38,0,0,0,78,117,109,98,101,114,32,111,102,32,112,111, 105,110,116,115,32,116,104,97,116,32,119,105,108,108,32,98, 101,32,115,97,109,112,108,101,100,46,40,1,0,0,0,82, 57,0,0,0,40,1,0,0,0,82,30,0,0,0,40,0, 0,0,0,40,0,0,0,0,115,61,0,0,0,47,117,115, 114,47,108,111,99,97,108,47,108,105,98,47,112,121,116,104, 111,110,50,46,55,47,100,105,115,116,45,112,97,99,107,97, 103,101,115,47,115,107,108,101,97,114,110,47,103,114,105,100, 95,115,101,97,114,99,104,46,112,121,82,47,0,0,0,220, 0,0,0,115,2,0,0,0,0,2,78,40,7,0,0,0, 82,48,0,0,0,82,49,0,0,0,82,50,0,0,0,116, 4,0,0,0,78,111,110,101,82,31,0,0,0,82,41,0, 0,0,82,47,0,0,0,40,0,0,0,0,40,0,0,0, 0,40,0,0,0,0,115,61,0,0,0,47,117,115,114,47, 108,111,99,97,108,47,108,105,98,47,112,121,116,104,111,110, 50,46,55,47,100,105,115,116,45,112,97,99,107,97,103,101, 115,47,115,107,108,101,97,114,110,47,103,114,105,100,95,115, 101,97,114,99,104,46,112,121,82,26,0,0,0,152,0,0, 0,115,8,0,0,0,6,49,6,1,12,5,9,13,99,9, 0,0,0,20,0,0,0,6,0,0,0,75,0,1,0,115, 22,3,0,0,124,7,0,100,1,0,107,4,0,114,96,0, 116,0,0,106,0,0,131,0,0,125,10,0,100,2,0,100, 3,0,106,1,0,100,4,0,132,0,0,124,3,0,106,2, 0,131,0,0,68,131,1,0,131,1,0,22,125,11,0,116, 3,0,100,5,0,124,11,0,100,6,0,116,4,0,124,11, 0,131,1,0,24,100,7,0,20,102,2,0,22,131,1,0, 1,110,0,0,116,5,0,124,2,0,131,1,0,125,12,0, 124,12,0,106,6,0,124,3,0,141,0,0,1,116,7,0, 124,2,0,100,8,0,131,2,0,114,166,0,116,8,0,124, 2,0,106,9,0,131,1,0,114,166,0,116,10,0,100,9, 0,131,1,0,130,1,0,110,0,0,116,7,0,124,0,0, 100,10,0,131,2,0,115,19,1,116,11,0,124,2,0,100, 11,0,116,12,0,131,3,0,114,214,0,116,10,0,100,12, 0,131,1,0,130,1,0,110,0,0,103,0,0,124,4,0, 68,93,16,0,125,13,0,124,0,0,124,13,0,25,94,2, 0,113,221,0,125,14,0,103,0,0,124,5,0,68,93,16, 0,125,13,0,124,0,0,124,13,0,25,94,2,0,113,250, 0,125,15,0,110,144,0,116,11,0,124,2,0,100,11,0, 116,12,0,131,3,0,114,125,1,124,0,0,106,13,0,100, 13,0,25,124,0,0,106,13,0,100,1,0,25,107,3,0, 114,78,1,116,10,0,100,14,0,131,1,0,130,1,0,110, 0,0,124,0,0,116,14,0,106,15,0,124,4,0,124,4, 0,131,2,0,25,125,14,0,124,0,0,116,14,0,106,15, 0,124,5,0,124,4,0,131,2,0,25,125,15,0,110,38, 0,124,0,0,116,16,0,124,0,0,124,4,0,131,2,0, 25,125,14,0,124,0,0,116,16,0,124,0,0,124,5,0, 131,2,0,25,125,15,0,124,1,0,100,19,0,107,9,0, 114,30,2,124,1,0,116,16,0,124,1,0,124,5,0,131, 2,0,25,125,16,0,124,1,0,116,16,0,124,1,0,124, 4,0,131,2,0,25,125,17,0,124,12,0,106,18,0,124, 14,0,124,17,0,124,9,0,141,2,0,1,124,6,0,100, 19,0,107,9,0,114,9,2,124,6,0,124,12,0,124,15, 0,124,16,0,131,3,0,125,18,0,113,91,2,124,12,0, 106,19,0,124,15,0,124,16,0,131,2,0,125,18,0,110, 61,0,124,12,0,106,18,0,124,14,0,124,9,0,141,1, 0,1,124,6,0,100,19,0,107,9,0,114,76,2,124,6, 0,124,12,0,124,15,0,131,2,0,125,18,0,110,15,0, 124,12,0,106,19,0,124,15,0,131,1,0,125,18,0,116, 20,0,124,18,0,116,21,0,106,22,0,131,2,0,115,146, 2,116,10,0,100,15,0,116,23,0,124,18,0,131,1,0, 116,24,0,124,18,0,131,1,0,102,2,0,22,131,1,0, 130,1,0,110,0,0,124,7,0,100,16,0,107,4,0,114, 175,2,124,11,0,100,17,0,124,18,0,22,55,125,11,0, 110,0,0,124,7,0,100,1,0,107,4,0,114,3,3,100, 18,0,124,11,0,116,25,0,106,26,0,116,0,0,106,0, 0,131,0,0,124,10,0,24,131,1,0,102,2,0,22,125, 19,0,116,3,0,100,5,0,100,6,0,116,4,0,124,19, 0,131,1,0,24,100,7,0,20,124,19,0,102,2,0,22, 131,1,0,1,110,0,0,124,18,0,124,3,0,116,27,0, 124,15,0,131,1,0,102,3,0,83,40,20,0,0,0,115, 86,4,0,0,82,117,110,32,102,105,116,32,111,110,32,111, 110,101,32,115,101,116,32,111,102,32,112,97,114,97,109,101, 116,101,114,115,46,10,10,32,32,32,32,80,97,114,97,109, 101,116,101,114,115,10,32,32,32,32,45,45,45,45,45,45, 45,45,45,45,10,32,32,32,32,88,32,58,32,97,114,114, 97,121,45,108,105,107,101,44,32,115,112,97,114,115,101,32, 109,97,116,114,105,120,32,111,114,32,108,105,115,116,10,32, 32,32,32,32,32,32,32,73,110,112,117,116,32,100,97,116, 97,46,10,10,32,32,32,32,121,32,58,32,97,114,114,97, 121,45,108,105,107,101,32,111,114,32,78,111,110,101,10,32, 32,32,32,32,32,32,32,84,97,114,103,101,116,115,32,102, 111,114,32,105,110,112,117,116,32,100,97,116,97,46,10,10, 32,32,32,32,98,97,115,101,95,101,115,116,105,109,97,116, 111,114,32,58,32,101,115,116,105,109,97,116,111,114,32,111, 98,106,101,99,116,10,32,32,32,32,32,32,32,32,84,104, 105,115,32,101,115,116,105,109,97,116,111,114,32,119,105,108, 108,32,98,101,32,99,108,111,110,101,100,32,97,110,100,32, 116,104,101,110,32,102,105,116,116,101,100,46,10,10,32,32, 32,32,112,97,114,97,109,101,116,101,114,115,32,58,32,100, 105,99,116,10,32,32,32,32,32,32,32,32,80,97,114,97, 109,101,116,101,114,115,32,116,111,32,98,101,32,115,101,116, 32,111,110,32,98,97,115,101,95,101,115,116,105,109,97,116, 111,114,32,99,108,111,110,101,32,102,111,114,32,116,104,105, 115,32,103,114,105,100,32,112,111,105,110,116,46,10,10,32, 32,32,32,116,114,97,105,110,32,58,32,110,100,97,114,114, 97,121,44,32,100,116,121,112,101,32,105,110,116,32,111,114, 32,98,111,111,108,10,32,32,32,32,32,32,32,32,66,111, 111,108,101,97,110,32,109,97,115,107,32,111,114,32,105,110, 100,105,99,101,115,32,102,111,114,32,116,114,97,105,110,105, 110,103,32,115,101,116,46,10,10,32,32,32,32,116,101,115, 116,32,58,32,110,100,97,114,114,97,121,44,32,100,116,121, 112,101,32,105,110,116,32,111,114,32,98,111,111,108,10,32, 32,32,32,32,32,32,32,66,111,111,108,101,97,110,32,109, 97,115,107,32,111,114,32,105,110,100,105,99,101,115,32,102, 111,114,32,116,101,115,116,32,115,101,116,46,10,10,32,32, 32,32,115,99,111,114,101,114,32,58,32,99,97,108,108,97, 98,108,101,32,111,114,32,78,111,110,101,46,10,32,32,32, 32,32,32,32,32,73,102,32,112,114,111,118,105,100,101,100, 32,109,117,115,116,32,98,101,32,97,32,115,99,111,114,101, 114,32,99,97,108,108,97,98,108,101,32,111,98,106,101,99, 116,32,47,32,102,117,110,99,116,105,111,110,32,119,105,116, 104,32,115,105,103,110,97,116,117,114,101,10,32,32,32,32, 32,32,32,32,96,96,115,99,111,114,101,114,40,101,115,116, 105,109,97,116,111,114,44,32,88,44,32,121,41,96,96,46, 10,10,32,32,32,32,118,101,114,98,111,115,101,32,58,32, 105,110,116,10,32,32,32,32,32,32,32,32,86,101,114,98, 111,115,105,116,121,32,108,101,118,101,108,46,10,10,32,32, 32,32,42,42,102,105,116,95,112,97,114,97,109,115,32,58, 32,107,119,97,114,103,115,10,32,32,32,32,32,32,32,32, 65,100,100,105,116,105,111,110,97,108,32,112,97,114,97,109, 101,116,101,114,32,112,97,115,115,101,100,32,116,111,32,116, 104,101,32,102,105,116,32,102,117,110,99,116,105,111,110,32, 111,102,32,116,104,101,32,101,115,116,105,109,97,116,111,114, 46,10,10,10,32,32,32,32,82,101,116,117,114,110,115,10, 32,32,32,32,45,45,45,45,45,45,45,10,32,32,32,32, 115,99,111,114,101,32,58,32,102,108,111,97,116,10,32,32, 32,32,32,32,32,32,83,99,111,114,101,32,111,102,32,116, 104,105,115,32,112,97,114,97,109,101,116,101,114,32,115,101, 116,116,105,110,103,32,111,110,32,103,105,118,101,110,32,116, 114,97,105,110,105,110,103,32,47,32,116,101,115,116,32,115, 112,108,105,116,46,10,10,32,32,32,32,112,97,114,97,109, 101,116,101,114,115,32,58,32,100,105,99,116,10,32,32,32, 32,32,32,32,32,84,104,101,32,112,97,114,97,109,101,116, 101,114,115,32,116,104,97,116,32,104,97,118,101,32,98,101, 101,110,32,101,118,97,108,117,97,116,101,100,46,10,10,32, 32,32,32,110,95,115,97,109,112,108,101,115,95,116,101,115, 116,32,58,32,105,110,116,10,32,32,32,32,32,32,32,32, 78,117,109,98,101,114,32,111,102,32,116,101,115,116,32,115, 97,109,112,108,101,115,32,105,110,32,116,104,105,115,32,115, 112,108,105,116,46,10,32,32,32,32,105,1,0,0,0,115, 2,0,0,0,37,115,115,2,0,0,0,44,32,99,1,0, 0,0,3,0,0,0,4,0,0,0,115,0,1,0,115,37, 0,0,0,124,0,0,93,27,0,92,2,0,125,1,0,125, 2,0,100,0,0,124,1,0,124,2,0,102,2,0,22,86, 1,113,3,0,100,1,0,83,40,2,0,0,0,115,5,0, 0,0,37,115,61,37,115,78,40,0,0,0,0,40,3,0, 0,0,82,43,0,0,0,82,65,0,0,0,82,39,0,0, 0,40,0,0,0,0,40,0,0,0,0,115,61,0,0,0, 47,117,115,114,47,108,111,99,97,108,47,108,105,98,47,112, 121,116,104,111,110,50,46,55,47,100,105,115,116,45,112,97, 99,107,97,103,101,115,47,115,107,108,101,97,114,110,47,103, 114,105,100,95,115,101,97,114,99,104,46,112,121,115,9,0, 0,0,60,103,101,110,101,120,112,114,62,17,1,0,0,115, 2,0,0,0,6,1,115,20,0,0,0,91,71,114,105,100, 83,101,97,114,99,104,67,86,93,32,37,115,32,37,115,105, 64,0,0,0,116,1,0,0,0,46,116,6,0,0,0,107, 101,114,110,101,108,115,74,0,0,0,67,97,110,110,111,116, 32,117,115,101,32,97,32,99,117,115,116,111,109,32,107,101, 114,110,101,108,32,102,117,110,99,116,105,111,110,46,32,80, 114,101,99,111,109,112,117,116,101,32,116,104,101,32,107,101, 114,110,101,108,32,109,97,116,114,105,120,32,105,110,115,116, 101,97,100,46,116,5,0,0,0,115,104,97,112,101,116,9, 0,0,0,95,112,97,105,114,119,105,115,101,115,88,0,0, 0,80,114,101,99,111,109,112,117,116,101,100,32,107,101,114, 110,101,108,115,32,111,114,32,97,102,102,105,110,105,116,121, 32,109,97,116,114,105,99,101,115,32,104,97,118,101,32,116, 111,32,98,101,32,112,97,115,115,101,100,32,97,115,32,97, 114,114,97,121,115,32,111,114,32,115,112,97,114,115,101,32, 109,97,116,114,105,99,101,115,46,105,0,0,0,0,115,34, 0,0,0,88,32,115,104,111,117,108,100,32,98,101,32,97, 32,115,113,117,97,114,101,32,107,101,114,110,101,108,32,109, 97,116,114,105,120,115,50,0,0,0,115,99,111,114,105,110, 103,32,109,117,115,116,32,114,101,116,117,114,110,32,97,32, 110,117,109,98,101,114,44,32,103,111,116,32,37,115,32,40, 37,115,41,32,105,110,115,116,101,97,100,46,105,2,0,0, 0,115,10,0,0,0,44,32,115,99,111,114,101,61,37,102, 115,6,0,0,0,37,115,32,45,37,115,78,40,28,0,0, 0,116,4,0,0,0,116,105,109,101,116,4,0,0,0,106, 111,105,110,82,33,0,0,0,116,5,0,0,0,112,114,105, 110,116,82,42,0,0,0,82,11,0,0,0,116,10,0,0, 0,115,101,116,95,112,97,114,97,109,115,82,61,0,0,0, 116,8,0,0,0,99,97,108,108,97,98,108,101,82,68,0, 0,0,116,10,0,0,0,86,97,108,117,101,69,114,114,111, 114,116,7,0,0,0,103,101,116,97,116,116,114,116,5,0, 0,0,70,97,108,115,101,82,69,0,0,0,116,2,0,0, 0,110,112,116,3,0,0,0,105,120,95,82,18,0,0,0, 82,66,0,0,0,116,3,0,0,0,102,105,116,116,5,0, 0,0,115,99,111,114,101,82,28,0,0,0,116,7,0,0, 0,110,117,109,98,101,114,115,116,6,0,0,0,78,117,109, 98,101,114,116,3,0,0,0,115,116,114,116,4,0,0,0, 116,121,112,101,82,16,0,0,0,116,17,0,0,0,115,104, 111,114,116,95,102,111,114,109,97,116,95,116,105,109,101,82, 20,0,0,0,40,20,0,0,0,116,1,0,0,0,88,116, 1,0,0,0,121,116,14,0,0,0,98,97,115,101,95,101, 115,116,105,109,97,116,111,114,116,10,0,0,0,112,97,114, 97,109,101,116,101,114,115,116,5,0,0,0,116,114,97,105, 110,116,4,0,0,0,116,101,115,116,116,6,0,0,0,115, 99,111,114,101,114,116,7,0,0,0,118,101,114,98,111,115, 101,116,9,0,0,0,108,111,115,115,95,102,117,110,99,116, 10,0,0,0,102,105,116,95,112,97,114,97,109,115,116,10, 0,0,0,115,116,97,114,116,95,116,105,109,101,116,3,0, 0,0,109,115,103,116,3,0,0,0,99,108,102,116,3,0, 0,0,105,100,120,116,7,0,0,0,88,95,116,114,97,105, 110,116,6,0,0,0,88,95,116,101,115,116,116,6,0,0, 0,121,95,116,101,115,116,116,7,0,0,0,121,95,116,114, 97,105,110,116,10,0,0,0,116,104,105,115,95,115,99,111, 114,101,116,7,0,0,0,101,110,100,95,109,115,103,40,0, 0,0,0,40,0,0,0,0,115,61,0,0,0,47,117,115, 114,47,108,111,99,97,108,47,108,105,98,47,112,121,116,104, 111,110,50,46,55,47,100,105,115,116,45,112,97,99,107,97, 103,101,115,47,115,107,108,101,97,114,110,47,103,114,105,100, 95,115,101,97,114,99,104,46,112,121,82,25,0,0,0,225, 0,0,0,115,86,0,0,0,0,46,12,1,12,1,15,1, 20,1,37,3,12,1,13,2,30,2,15,3,15,1,18,1, 15,2,29,1,32,2,18,2,26,1,15,1,22,1,25,2, 19,1,19,2,12,1,19,1,19,1,19,2,12,1,21,2, 21,2,16,1,12,1,18,2,15,2,18,1,6,1,31,2, 12,1,17,1,12,1,6,1,15,1,14,1,37,1,99,1, 0,0,0,5,0,0,0,8,0,0,0,67,0,1,0,115, 225,0,0,0,116,0,0,124,0,0,100,1,0,131,2,0, 114,27,0,124,0,0,103,1,0,125,0,0,110,0,0,120, 191,0,124,0,0,68,93,183,0,125,1,0,120,174,0,124, 1,0,106,1,0,131,0,0,68,93,160,0,125,2,0,116, 2,0,124,2,0,116,3,0,106,4,0,131,2,0,114,107, 0,124,2,0,106,5,0,100,2,0,107,4,0,114,107,0, 116,6,0,100,3,0,131,1,0,130,1,0,110,0,0,103, 0,0,116,7,0,116,8,0,116,3,0,106,4,0,102,3, 0,68,93,21,0,125,3,0,116,2,0,124,2,0,124,3, 0,131,2,0,94,2,0,113,126,0,125,4,0,116,9,0, 124,4,0,107,7,0,114,180,0,116,6,0,100,4,0,131, 1,0,130,1,0,110,0,0,116,10,0,124,2,0,131,1, 0,100,5,0,107,2,0,114,53,0,116,6,0,100,6,0, 131,1,0,130,1,0,113,53,0,113,53,0,87,113,34,0, 87,100,0,0,83,40,7,0,0,0,78,82,33,0,0,0, 105,1,0,0,0,115,42,0,0,0,80,97,114,97,109,101, 116,101,114,32,97,114,114,97,121,32,115,104,111,117,108,100, 32,98,101,32,111,110,101,45,100,105,109,101,110,115,105,111, 110,97,108,46,115,34,0,0,0,80,97,114,97,109,101,116, 101,114,32,118,97,108,117,101,115,32,115,104,111,117,108,100, 32,98,101,32,97,32,108,105,115,116,46,105,0,0,0,0, 115,44,0,0,0,80,97,114,97,109,101,116,101,114,32,118, 97,108,117,101,115,32,115,104,111,117,108,100,32,98,101,32, 97,32,110,111,110,45,101,109,112,116,121,32,108,105,115,116, 46,40,11,0,0,0,82,61,0,0,0,82,38,0,0,0, 82,28,0,0,0,82,79,0,0,0,116,7,0,0,0,110, 100,97,114,114,97,121,116,4,0,0,0,110,100,105,109,82, 76,0,0,0,116,4,0,0,0,108,105,115,116,116,5,0, 0,0,116,117,112,108,101,116,4,0,0,0,84,114,117,101, 82,42,0,0,0,40,5,0,0,0,82,29,0,0,0,82, 36,0,0,0,82,39,0,0,0,82,65,0,0,0,116,5, 0,0,0,99,104,101,99,107,40,0,0,0,0,40,0,0, 0,0,115,61,0,0,0,47,117,115,114,47,108,111,99,97, 108,47,108,105,98,47,112,121,116,104,111,110,50,46,55,47, 100,105,115,116,45,112,97,99,107,97,103,101,115,47,115,107, 108,101,97,114,110,47,103,114,105,100,95,115,101,97,114,99, 104,46,112,121,116,17,0,0,0,95,99,104,101,99,107,95, 112,97,114,97,109,95,103,114,105,100,77,1,0,0,115,22, 0,0,0,0,1,15,1,12,2,13,1,19,1,33,1,15, 2,46,1,12,1,15,2,18,1,116,13,0,0,0,95,67, 86,83,99,111,114,101,84,117,112,108,101,82,91,0,0,0, 116,21,0,0,0,109,101,97,110,95,118,97,108,105,100,97, 116,105,111,110,95,115,99,111,114,101,116,20,0,0,0,99, 118,95,118,97,108,105,100,97,116,105,111,110,95,115,99,111, 114,101,115,99,0,0,0,0,0,0,0,0,1,0,0,0, 66,0,1,0,115,23,0,0,0,101,0,0,90,1,0,100, 1,0,90,2,0,100,0,0,132,0,0,90,3,0,82,83, 40,2,0,0,0,99,1,0,0,0,1,0,0,0,4,0, 0,0,67,0,1,0,115,37,0,0,0,100,1,0,106,0, 0,124,0,0,106,1,0,116,2,0,106,3,0,124,0,0, 106,4,0,131,1,0,124,0,0,106,5,0,131,3,0,83, 40,2,0,0,0,115,45,0,0,0,83,105,109,112,108,101, 32,99,117,115,116,111,109,32,114,101,112,114,32,116,111,32, 115,117,109,109,97,114,105,122,101,32,116,104,101,32,109,97, 105,110,32,105,110,102,111,115,40,0,0,0,109,101,97,110, 58,32,123,48,58,46,53,102,125,44,32,115,116,100,58,32, 123,49,58,46,53,102,125,44,32,112,97,114,97,109,115,58, 32,123,50,125,40,6,0,0,0,116,6,0,0,0,102,111, 114,109,97,116,82,116,0,0,0,82,79,0,0,0,116,3, 0,0,0,115,116,100,82,117,0,0,0,82,91,0,0,0, 40,1,0,0,0,82,30,0,0,0,40,0,0,0,0,40, 0,0,0,0,115,61,0,0,0,47,117,115,114,47,108,111, 99,97,108,47,108,105,98,47,112,121,116,104,111,110,50,46, 55,47,100,105,115,116,45,112,97,99,107,97,103,101,115,47, 115,107,108,101,97,114,110,47,103,114,105,100,95,115,101,97, 114,99,104,46,112,121,116,8,0,0,0,95,95,114,101,112, 114,95,95,109,1,0,0,115,8,0,0,0,0,2,6,1, 6,1,15,1,40,0,0,0,0,40,4,0,0,0,82,48, 0,0,0,82,49,0,0,0,116,9,0,0,0,95,95,115, 108,111,116,115,95,95,82,120,0,0,0,40,0,0,0,0, 40,0,0,0,0,40,0,0,0,0,115,61,0,0,0,47, 117,115,114,47,108,111,99,97,108,47,108,105,98,47,112,121, 116,104,111,110,50,46,55,47,100,105,115,116,45,112,97,99, 107,97,103,101,115,47,115,107,108,101,97,114,110,47,103,114, 105,100,95,115,101,97,114,99,104,46,112,121,82,115,0,0, 0,95,1,0,0,115,4,0,0,0,6,12,6,2,116,12, 0,0,0,66,97,115,101,83,101,97,114,99,104,67,86,99, 0,0,0,0,0,0,0,0,12,0,0,0,66,0,1,0, 115,149,0,0,0,101,0,0,90,1,0,100,0,0,90,2, 0,101,3,0,100,12,0,100,12,0,100,12,0,100,12,0, 100,1,0,101,5,0,101,5,0,100,12,0,100,2,0,100, 3,0,100,4,0,132,10,0,131,1,0,90,6,0,100,12, 0,100,5,0,132,1,0,90,7,0,101,8,0,100,6,0, 132,0,0,131,1,0,90,9,0,101,8,0,100,7,0,132, 0,0,131,1,0,90,10,0,101,8,0,100,8,0,132,0, 0,131,1,0,90,11,0,101,8,0,100,9,0,132,0,0, 131,1,0,90,12,0,100,10,0,132,0,0,90,13,0,100, 11,0,132,0,0,90,14,0,82,83,40,13,0,0,0,115, 60,0,0,0,66,97,115,101,32,99,108,97,115,115,32,102, 111,114,32,104,121,112,101,114,32,112,97,114,97,109,101,116, 101,114,32,115,101,97,114,99,104,32,119,105,116,104,32,99, 114,111,115,115,45,118,97,108,105,100,97,116,105,111,110,46, 105,1,0,0,0,105,0,0,0,0,115,8,0,0,0,50, 42,110,95,106,111,98,115,99,12,0,0,0,12,0,0,0, 2,0,0,0,67,0,1,0,115,131,0,0,0,124,2,0, 124,0,0,95,0,0,124,1,0,124,0,0,95,1,0,124, 3,0,124,0,0,95,2,0,124,4,0,124,0,0,95,3, 0,124,6,0,124,0,0,95,4,0,124,5,0,100,0,0, 107,9,0,114,63,0,124,5,0,110,3,0,105,0,0,124, 0,0,95,6,0,124,7,0,124,0,0,95,7,0,124,8, 0,124,0,0,95,8,0,124,9,0,124,0,0,95,9,0, 124,10,0,124,0,0,95,10,0,124,11,0,124,0,0,95, 11,0,124,0,0,106,12,0,131,0,0,1,100,0,0,83, 40,1,0,0,0,78,40,13,0,0,0,116,7,0,0,0, 115,99,111,114,105,110,103,116,9,0,0,0,101,115,116,105, 109,97,116,111,114,82,96,0,0,0,116,10,0,0,0,115, 99,111,114,101,95,102,117,110,99,116,6,0,0,0,110,95, 106,111,98,115,82,66,0,0,0,82,97,0,0,0,116,3, 0,0,0,105,105,100,116,5,0,0,0,114,101,102,105,116, 116,2,0,0,0,99,118,82,95,0,0,0,116,12,0,0, 0,112,114,101,95,100,105,115,112,97,116,99,104,116,16,0, 0,0,95,99,104,101,99,107,95,101,115,116,105,109,97,116, 111,114,40,12,0,0,0,82,30,0,0,0,82,124,0,0, 0,82,123,0,0,0,82,96,0,0,0,82,125,0,0,0, 82,97,0,0,0,82,126,0,0,0,82,127,0,0,0,82, 128,0,0,0,82,129,0,0,0,82,95,0,0,0,82,130, 0,0,0,40,0,0,0,0,40,0,0,0,0,115,61,0, 0,0,47,117,115,114,47,108,111,99,97,108,47,108,105,98, 47,112,121,116,104,111,110,50,46,55,47,100,105,115,116,45, 112,97,99,107,97,103,101,115,47,115,107,108,101,97,114,110, 47,103,114,105,100,95,115,101,97,114,99,104,46,112,121,82, 31,0,0,0,121,1,0,0,115,24,0,0,0,0,5,9, 1,9,1,9,1,9,1,9,1,27,1,9,1,9,1,9, 1,9,1,9,1,99,3,0,0,0,3,0,0,0,4,0, 0,0,67,0,1,0,115,96,0,0,0,116,0,0,124,0, 0,106,1,0,100,1,0,131,2,0,114,37,0,124,0,0, 106,1,0,106,2,0,124,1,0,124,2,0,131,2,0,83, 124,0,0,106,3,0,100,3,0,107,8,0,114,74,0,116, 5,0,100,2,0,124,0,0,106,1,0,22,131,1,0,130, 1,0,110,0,0,124,0,0,106,3,0,124,0,0,106,1, 0,124,1,0,124,2,0,131,3,0,83,40,4,0,0,0, 115,168,2,0,0,82,101,116,117,114,110,115,32,116,104,101, 32,115,99,111,114,101,32,111,110,32,116,104,101,32,103,105, 118,101,110,32,116,101,115,116,32,100,97,116,97,32,97,110, 100,32,108,97,98,101,108,115,44,32,105,102,32,116,104,101, 32,115,101,97,114,99,104,10,32,32,32,32,32,32,32,32, 101,115,116,105,109,97,116,111,114,32,104,97,115,32,98,101, 101,110,32,114,101,102,105,116,46,32,84,104,101,32,96,96, 115,99,111,114,101,96,96,32,102,117,110,99,116,105,111,110, 32,111,102,32,116,104,101,32,98,101,115,116,32,101,115,116, 105,109,97,116,111,114,10,32,32,32,32,32,32,32,32,105, 115,32,117,115,101,100,44,32,111,114,32,116,104,101,32,96, 96,115,99,111,114,105,110,103,96,96,32,112,97,114,97,109, 101,116,101,114,32,119,104,101,114,101,32,117,110,97,118,97, 105,108,97,98,108,101,46,10,10,32,32,32,32,32,32,32, 32,80,97,114,97,109,101,116,101,114,115,10,32,32,32,32, 32,32,32,32,45,45,45,45,45,45,45,45,45,45,10,32, 32,32,32,32,32,32,32,88,32,58,32,97,114,114,97,121, 45,108,105,107,101,44,32,115,104,97,112,101,32,61,32,91, 110,95,115,97,109,112,108,101,115,44,32,110,95,102,101,97, 116,117,114,101,115,93,10,32,32,32,32,32,32,32,32,32, 32,32,32,73,110,112,117,116,32,100,97,116,97,44,32,119, 104,101,114,101,32,110,95,115,97,109,112,108,101,115,32,105, 115,32,116,104,101,32,110,117,109,98,101,114,32,111,102,32, 115,97,109,112,108,101,115,32,97,110,100,10,32,32,32,32, 32,32,32,32,32,32,32,32,110,95,102,101,97,116,117,114, 101,115,32,105,115,32,116,104,101,32,110,117,109,98,101,114, 32,111,102,32,102,101,97,116,117,114,101,115,46,10,10,32, 32,32,32,32,32,32,32,121,32,58,32,97,114,114,97,121, 45,108,105,107,101,44,32,115,104,97,112,101,32,61,32,91, 110,95,115,97,109,112,108,101,115,93,32,111,114,32,91,110, 95,115,97,109,112,108,101,115,44,32,110,95,111,117,116,112, 117,116,93,44,32,111,112,116,105,111,110,97,108,10,32,32, 32,32,32,32,32,32,32,32,32,32,84,97,114,103,101,116, 32,114,101,108,97,116,105,118,101,32,116,111,32,88,32,102, 111,114,32,99,108,97,115,115,105,102,105,99,97,116,105,111, 110,32,111,114,32,114,101,103,114,101,115,115,105,111,110,59, 10,32,32,32,32,32,32,32,32,32,32,32,32,78,111,110, 101,32,102,111,114,32,117,110,115,117,112,101,114,118,105,115, 101,100,32,108,101,97,114,110,105,110,103,46,10,10,32,32, 32,32,32,32,32,32,82,101,116,117,114,110,115,10,32,32, 32,32,32,32,32,32,45,45,45,45,45,45,45,10,32,32, 32,32,32,32,32,32,115,99,111,114,101,32,58,32,102,108, 111,97,116,10,10,32,32,32,32,32,32,32,32,82,82,0, 0,0,115,78,0,0,0,78,111,32,115,99,111,114,101,32, 102,117,110,99,116,105,111,110,32,101,120,112,108,105,99,105, 116,108,121,32,100,101,102,105,110,101,100,44,32,97,110,100, 32,116,104,101,32,101,115,116,105,109,97,116,111,114,32,100, 111,101,115,110,39,116,32,112,114,111,118,105,100,101,32,111, 110,101,32,37,115,78,40,6,0,0,0,82,61,0,0,0, 116,15,0,0,0,98,101,115,116,95,101,115,116,105,109,97, 116,111,114,95,82,82,0,0,0,116,7,0,0,0,115,99, 111,114,101,114,95,82,66,0,0,0,82,76,0,0,0,40, 3,0,0,0,82,30,0,0,0,82,88,0,0,0,82,89, 0,0,0,40,0,0,0,0,40,0,0,0,0,115,61,0, 0,0,47,117,115,114,47,108,111,99,97,108,47,108,105,98, 47,112,121,116,104,111,110,50,46,55,47,100,105,115,116,45, 112,97,99,107,97,103,101,115,47,115,107,108,101,97,114,110, 47,103,114,105,100,95,115,101,97,114,99,104,46,112,121,82, 82,0,0,0,139,1,0,0,115,12,0,0,0,0,20,18, 1,19,1,15,1,6,2,16,1,99,1,0,0,0,1,0, 0,0,1,0,0,0,67,0,1,0,115,10,0,0,0,124, 0,0,106,0,0,106,1,0,83,40,1,0,0,0,78,40, 2,0,0,0,82,132,0,0,0,116,7,0,0,0,112,114, 101,100,105,99,116,40,1,0,0,0,82,30,0,0,0,40, 0,0,0,0,40,0,0,0,0,115,61,0,0,0,47,117, 115,114,47,108,111,99,97,108,47,108,105,98,47,112,121,116, 104,111,110,50,46,55,47,100,105,115,116,45,112,97,99,107, 97,103,101,115,47,115,107,108,101,97,114,110,47,103,114,105, 100,95,115,101,97,114,99,104,46,112,121,82,134,0,0,0, 167,1,0,0,115,2,0,0,0,0,2,99,1,0,0,0, 1,0,0,0,1,0,0,0,67,0,1,0,115,10,0,0, 0,124,0,0,106,0,0,106,1,0,83,40,1,0,0,0, 78,40,2,0,0,0,82,132,0,0,0,116,13,0,0,0, 112,114,101,100,105,99,116,95,112,114,111,98,97,40,1,0, 0,0,82,30,0,0,0,40,0,0,0,0,40,0,0,0, 0,115,61,0,0,0,47,117,115,114,47,108,111,99,97,108, 47,108,105,98,47,112,121,116,104,111,110,50,46,55,47,100, 105,115,116,45,112,97,99,107,97,103,101,115,47,115,107,108, 101,97,114,110,47,103,114,105,100,95,115,101,97,114,99,104, 46,112,121,82,135,0,0,0,171,1,0,0,115,2,0,0, 0,0,2,99,1,0,0,0,1,0,0,0,1,0,0,0, 67,0,1,0,115,10,0,0,0,124,0,0,106,0,0,106, 1,0,83,40,1,0,0,0,78,40,2,0,0,0,82,132, 0,0,0,116,17,0,0,0,100,101,99,105,115,105,111,110, 95,102,117,110,99,116,105,111,110,40,1,0,0,0,82,30, 0,0,0,40,0,0,0,0,40,0,0,0,0,115,61,0, 0,0,47,117,115,114,47,108,111,99,97,108,47,108,105,98, 47,112,121,116,104,111,110,50,46,55,47,100,105,115,116,45, 112,97,99,107,97,103,101,115,47,115,107,108,101,97,114,110, 47,103,114,105,100,95,115,101,97,114,99,104,46,112,121,82, 136,0,0,0,175,1,0,0,115,2,0,0,0,0,2,99, 1,0,0,0,1,0,0,0,1,0,0,0,67,0,1,0, 115,10,0,0,0,124,0,0,106,0,0,106,1,0,83,40, 1,0,0,0,78,40,2,0,0,0,82,132,0,0,0,116, 9,0,0,0,116,114,97,110,115,102,111,114,109,40,1,0, 0,0,82,30,0,0,0,40,0,0,0,0,40,0,0,0, 0,115,61,0,0,0,47,117,115,114,47,108,111,99,97,108, 47,108,105,98,47,112,121,116,104,111,110,50,46,55,47,100, 105,115,116,45,112,97,99,107,97,103,101,115,47,115,107,108, 101,97,114,110,47,103,114,105,100,95,115,101,97,114,99,104, 46,112,121,82,137,0,0,0,179,1,0,0,115,2,0,0, 0,0,2,99,1,0,0,0,1,0,0,0,7,0,0,0, 67,0,1,0,115,185,0,0,0,116,0,0,124,0,0,106, 1,0,100,1,0,131,2,0,12,115,56,0,116,0,0,124, 0,0,106,1,0,100,2,0,131,2,0,112,52,0,116,0, 0,124,0,0,106,1,0,100,3,0,131,2,0,12,114,93, 0,116,2,0,100,4,0,124,0,0,106,1,0,116,3,0, 124,0,0,106,1,0,131,1,0,102,2,0,22,131,1,0, 130,1,0,110,0,0,124,0,0,106,4,0,100,6,0,107, 8,0,114,181,0,124,0,0,106,6,0,100,6,0,107,8, 0,114,181,0,124,0,0,106,7,0,100,6,0,107,8,0, 114,181,0,116,0,0,124,0,0,106,1,0,100,3,0,131, 2,0,115,181,0,116,2,0,100,5,0,124,0,0,106,1, 0,22,131,1,0,130,1,0,113,181,0,110,0,0,100,6, 0,83,40,7,0,0,0,115,61,0,0,0,67,104,101,99, 107,32,116,104,97,116,32,101,115,116,105,109,97,116,111,114, 32,99,97,110,32,98,101,32,102,105,116,116,101,100,32,97, 110,100,32,115,99,111,114,101,32,99,97,110,32,98,101,32, 99,111,109,112,117,116,101,100,46,82,81,0,0,0,82,134, 0,0,0,82,82,0,0,0,115,111,0,0,0,101,115,116, 105,109,97,116,111,114,32,115,104,111,117,108,100,32,97,32, 98,101,32,97,110,32,101,115,116,105,109,97,116,111,114,32, 105,109,112,108,101,109,101,110,116,105,110,103,32,39,102,105, 116,39,32,97,110,100,32,39,112,114,101,100,105,99,116,39, 32,111,114,32,39,115,99,111,114,101,39,32,109,101,116,104, 111,100,115,44,32,37,115,32,40,116,121,112,101,32,37,115, 41,32,119,97,115,32,112,97,115,115,101,100,115,105,0,0, 0,73,102,32,110,111,32,115,99,111,114,105,110,103,32,105, 115,32,115,112,101,99,105,102,105,101,100,44,32,116,104,101, 32,101,115,116,105,109,97,116,111,114,32,112,97,115,115,101, 100,32,115,104,111,117,108,100,32,104,97,118,101,32,97,32, 39,115,99,111,114,101,39,32,109,101,116,104,111,100,46,32, 84,104,101,32,101,115,116,105,109,97,116,111,114,32,37,115, 32,100,111,101,115,32,110,111,116,46,78,40,8,0,0,0, 82,61,0,0,0,82,124,0,0,0,116,9,0,0,0,84, 121,112,101,69,114,114,111,114,82,86,0,0,0,82,123,0, 0,0,82,66,0,0,0,82,96,0,0,0,82,125,0,0, 0,40,1,0,0,0,82,30,0,0,0,40,0,0,0,0, 40,0,0,0,0,115,61,0,0,0,47,117,115,114,47,108, 111,99,97,108,47,108,105,98,47,112,121,116,104,111,110,50, 46,55,47,100,105,115,116,45,112,97,99,107,97,103,101,115, 47,115,107,108,101,97,114,110,47,103,114,105,100,95,115,101, 97,114,99,104,46,112,121,82,131,0,0,0,183,1,0,0, 115,22,0,0,0,0,2,19,1,18,1,19,1,6,3,31, 1,36,1,9,1,18,1,3,1,3,2,99,4,0,0,0, 22,0,0,0,7,0,0,0,3,0,1,0,115,61,3,0, 0,136,3,0,106,0,0,125,4,0,136,3,0,106,1,0, 137,2,0,116,2,0,136,0,0,131,1,0,125,5,0,116, 3,0,136,0,0,136,4,0,100,1,0,116,4,0,100,2, 0,100,3,0,131,2,2,92,2,0,137,0,0,137,4,0, 116,5,0,136,3,0,106,6,0,136,3,0,106,7,0,136, 3,0,106,8,0,131,3,0,136,3,0,95,9,0,136,4, 0,100,15,0,107,9,0,114,172,0,116,11,0,136,4,0, 131,1,0,124,5,0,107,3,0,114,154,0,116,12,0,100, 4,0,116,11,0,136,4,0,131,1,0,124,5,0,102,2, 0,22,131,1,0,130,1,0,110,0,0,116,13,0,106,14, 0,136,4,0,131,1,0,137,4,0,110,0,0,116,15,0, 136,2,0,136,0,0,136,4,0,100,5,0,116,16,0,124, 4,0,131,1,0,131,3,1,137,2,0,136,3,0,106,17, 0,100,6,0,107,4,0,114,35,1,116,18,0,124,3,0, 116,19,0,131,2,0,114,35,1,116,11,0,124,3,0,131, 1,0,125,6,0,116,20,0,100,7,0,106,21,0,116,11, 0,136,2,0,131,1,0,124,6,0,124,6,0,116,11,0, 136,2,0,131,1,0,20,131,3,0,131,1,0,1,113,35, 1,110,0,0,116,22,0,136,3,0,106,0,0,131,1,0, 137,1,0,136,3,0,106,23,0,125,7,0,116,24,0,100, 8,0,136,3,0,106,25,0,100,9,0,136,3,0,106,17, 0,100,10,0,124,7,0,131,0,3,135,0,0,135,1,0, 135,2,0,135,3,0,135,4,0,102,5,0,100,11,0,134, 0,0,124,3,0,68,131,1,0,131,1,0,125,8,0,116, 11,0,124,8,0,131,1,0,125,9,0,116,11,0,136,2, 0,131,1,0,125,10,0,116,26,0,131,0,0,125,11,0, 116,26,0,131,0,0,125,12,0,120,233,0,116,27,0,100, 6,0,124,9,0,124,10,0,131,3,0,68,93,213,0,125, 13,0,100,6,0,125,14,0,100,6,0,125,15,0,103,0, 0,125,16,0,120,89,0,124,8,0,124,13,0,124,13,0, 124,10,0,23,33,68,93,70,0,92,3,0,125,17,0,125, 18,0,125,19,0,124,16,0,106,28,0,124,17,0,131,1, 0,1,136,3,0,106,29,0,114,33,2,124,17,0,124,19, 0,57,125,17,0,124,14,0,124,19,0,55,125,14,0,110, 0,0,124,15,0,124,17,0,55,125,15,0,113,229,1,87, 136,3,0,106,29,0,114,75,2,124,15,0,116,30,0,124, 14,0,131,1,0,58,125,15,0,110,16,0,124,15,0,116, 30,0,124,10,0,131,1,0,58,125,15,0,124,11,0,106, 28,0,124,15,0,124,18,0,102,2,0,131,1,0,1,124, 12,0,106,28,0,116,31,0,124,18,0,124,15,0,116,13, 0,106,32,0,124,16,0,131,1,0,131,3,0,131,1,0, 1,113,187,1,87,124,12,0,136,3,0,95,33,0,116,34, 0,124,12,0,100,12,0,100,13,0,132,0,0,100,14,0, 116,4,0,131,1,2,100,6,0,25,125,20,0,124,20,0, 106,35,0,136,3,0,95,36,0,124,20,0,106,37,0,136, 3,0,95,38,0,136,3,0,106,39,0,114,57,3,116,22, 0,136,1,0,131,1,0,106,40,0,124,20,0,106,35,0, 141,0,0,125,21,0,136,4,0,100,15,0,107,9,0,114, 26,3,124,21,0,106,41,0,136,0,0,136,4,0,136,3, 0,106,42,0,141,2,0,1,110,19,0,124,21,0,106,41, 0,136,0,0,136,3,0,106,42,0,141,1,0,1,124,21, 0,136,3,0,95,43,0,110,0,0,136,3,0,83,40,16, 0,0,0,115,55,0,0,0,65,99,116,117,97,108,32,102, 105,116,116,105,110,103,44,32,32,112,101,114,102,111,114,109, 105,110,103,32,116,104,101,32,115,101,97,114,99,104,32,111, 118,101,114,32,112,97,114,97,109,101,116,101,114,115,46,116, 11,0,0,0,97,108,108,111,119,95,108,105,115,116,115,116, 13,0,0,0,115,112,97,114,115,101,95,102,111,114,109,97, 116,116,3,0,0,0,99,115,114,115,84,0,0,0,84,97, 114,103,101,116,32,118,97,114,105,97,98,108,101,32,40,121, 41,32,104,97,115,32,97,32,100,105,102,102,101,114,101,110, 116,32,110,117,109,98,101,114,32,111,102,32,115,97,109,112, 108,101,115,32,40,37,105,41,32,116,104,97,110,32,100,97, 116,97,32,40,88,58,32,37,105,32,115,97,109,112,108,101, 115,41,116,10,0,0,0,99,108,97,115,115,105,102,105,101, 114,105,0,0,0,0,115,64,0,0,0,70,105,116,116,105, 110,103,32,123,48,125,32,102,111,108,100,115,32,102,111,114, 32,101,97,99,104,32,111,102,32,123,49,125,32,99,97,110, 100,105,100,97,116,101,115,44,32,116,111,116,97,108,108,105, 110,103,32,123,50,125,32,102,105,116,115,82,126,0,0,0, 82,95,0,0,0,82,130,0,0,0,99,1,0,0,0,4, 0,0,0,12,0,0,0,51,0,1,0,115,85,0,0,0, 124,0,0,93,75,0,125,1,0,136,2,0,68,93,62,0, 92,2,0,125,2,0,125,3,0,116,0,0,116,1,0,131, 1,0,136,0,0,136,4,0,136,1,0,124,1,0,124,2, 0,124,3,0,136,3,0,106,2,0,136,3,0,106,3,0, 136,3,0,106,4,0,141,8,0,86,1,113,13,0,113,3, 0,100,0,0,83,40,1,0,0,0,78,40,5,0,0,0, 82,15,0,0,0,82,25,0,0,0,82,133,0,0,0,82, 95,0,0,0,82,97,0,0,0,40,4,0,0,0,82,43, 0,0,0,82,91,0,0,0,82,92,0,0,0,82,93,0, 0,0,40,5,0,0,0,82,88,0,0,0,82,90,0,0, 0,82,129,0,0,0,82,30,0,0,0,82,89,0,0,0, 40,0,0,0,0,115,61,0,0,0,47,117,115,114,47,108, 111,99,97,108,47,108,105,98,47,112,121,116,104,111,110,50, 46,55,47,100,105,115,116,45,112,97,99,107,97,103,101,115, 47,115,107,108,101,97,114,110,47,103,114,105,100,95,115,101, 97,114,99,104,46,112,121,115,9,0,0,0,60,103,101,110, 101,120,112,114,62,234,1,0,0,115,4,0,0,0,6,3, 3,1,116,3,0,0,0,107,101,121,99,1,0,0,0,1, 0,0,0,1,0,0,0,83,0,1,0,115,7,0,0,0, 124,0,0,106,0,0,83,40,1,0,0,0,78,40,1,0, 0,0,82,116,0,0,0,40,1,0,0,0,116,1,0,0, 0,120,40,0,0,0,0,40,0,0,0,0,115,61,0,0, 0,47,117,115,114,47,108,111,99,97,108,47,108,105,98,47, 112,121,116,104,111,110,50,46,55,47,100,105,115,116,45,112, 97,99,107,97,103,101,115,47,115,107,108,101,97,114,110,47, 103,114,105,100,95,115,101,97,114,99,104,46,112,121,116,8, 0,0,0,60,108,97,109,98,100,97,62,16,2,0,0,115, 0,0,0,0,116,7,0,0,0,114,101,118,101,114,115,101, 78,40,44,0,0,0,82,124,0,0,0,82,129,0,0,0, 82,20,0,0,0,82,21,0,0,0,82,112,0,0,0,82, 22,0,0,0,82,96,0,0,0,82,125,0,0,0,82,123, 0,0,0,82,133,0,0,0,82,66,0,0,0,82,42,0, 0,0,82,76,0,0,0,82,79,0,0,0,116,7,0,0, 0,97,115,97,114,114,97,121,82,13,0,0,0,82,10,0, 0,0,82,95,0,0,0,82,28,0,0,0,82,5,0,0, 0,82,73,0,0,0,82,118,0,0,0,82,11,0,0,0, 82,130,0,0,0,82,14,0,0,0,82,126,0,0,0,82, 110,0,0,0,82,60,0,0,0,116,6,0,0,0,97,112, 112,101,110,100,82,127,0,0,0,116,5,0,0,0,102,108, 111,97,116,82,115,0,0,0,116,5,0,0,0,97,114,114, 97,121,116,12,0,0,0,103,114,105,100,95,115,99,111,114, 101,115,95,82,32,0,0,0,82,91,0,0,0,116,12,0, 0,0,98,101,115,116,95,112,97,114,97,109,115,95,82,116, 0,0,0,116,11,0,0,0,98,101,115,116,95,115,99,111, 114,101,95,82,128,0,0,0,82,74,0,0,0,82,81,0, 0,0,82,97,0,0,0,82,132,0,0,0,40,22,0,0, 0,82,30,0,0,0,82,88,0,0,0,82,89,0,0,0, 116,18,0,0,0,112,97,114,97,109,101,116,101,114,95,105, 116,101,114,97,98,108,101,82,124,0,0,0,116,9,0,0, 0,110,95,115,97,109,112,108,101,115,116,12,0,0,0,110, 95,99,97,110,100,105,100,97,116,101,115,82,130,0,0,0, 116,3,0,0,0,111,117,116,116,6,0,0,0,110,95,102, 105,116,115,116,7,0,0,0,110,95,102,111,108,100,115,116, 6,0,0,0,115,99,111,114,101,115,116,11,0,0,0,103, 114,105,100,95,115,99,111,114,101,115,116,10,0,0,0,103, 114,105,100,95,115,116,97,114,116,116,14,0,0,0,110,95, 116,101,115,116,95,115,97,109,112,108,101,115,82,82,0,0, 0,116,10,0,0,0,97,108,108,95,115,99,111,114,101,115, 82,106,0,0,0,82,91,0,0,0,116,19,0,0,0,116, 104,105,115,95,110,95,116,101,115,116,95,115,97,109,112,108, 101,115,116,4,0,0,0,98,101,115,116,116,14,0,0,0, 98,101,115,116,95,101,115,116,105,109,97,116,111,114,40,0, 0,0,0,40,5,0,0,0,82,88,0,0,0,82,90,0, 0,0,82,129,0,0,0,82,30,0,0,0,82,89,0,0, 0,115,61,0,0,0,47,117,115,114,47,108,111,99,97,108, 47,108,105,98,47,112,121,116,104,111,110,50,46,55,47,100, 105,115,116,45,112,97,99,107,97,103,101,115,47,115,107,108, 101,97,114,110,47,103,114,105,100,95,115,101,97,114,99,104, 46,112,121,116,4,0,0,0,95,102,105,116,200,1,0,0, 115,122,0,0,0,0,3,9,1,9,2,12,1,33,2,3, 1,27,2,12,1,18,1,6,2,25,1,18,1,30,2,15, 1,15,1,12,1,9,1,12,1,26,2,15,2,9,2,6, 1,18,1,6,1,24,3,13,4,12,1,12,2,9,1,9, 1,25,1,6,1,6,1,6,1,3,1,30,1,13,1,9, 1,10,1,13,1,14,1,9,1,19,2,16,1,19,2,9, 1,3,1,3,1,23,2,9,4,18,1,13,1,12,1,12, 2,9,3,12,1,12,1,12,1,25,2,19,1,12,1,78, 40,15,0,0,0,82,48,0,0,0,82,49,0,0,0,82, 50,0,0,0,82,2,0,0,0,82,66,0,0,0,82,112, 0,0,0,82,31,0,0,0,82,82,0,0,0,116,8,0, 0,0,112,114,111,112,101,114,116,121,82,134,0,0,0,82, 135,0,0,0,82,136,0,0,0,82,137,0,0,0,82,131, 0,0,0,82,168,0,0,0,40,0,0,0,0,40,0,0, 0,0,40,0,0,0,0,115,61,0,0,0,47,117,115,114, 47,108,111,99,97,108,47,108,105,98,47,112,121,116,104,111, 110,50,46,55,47,100,105,115,116,45,112,97,99,107,97,103, 101,115,47,115,107,108,101,97,114,110,47,103,114,105,100,95, 115,101,97,114,99,104,46,112,121,82,122,0,0,0,117,1, 0,0,115,24,0,0,0,6,2,6,2,3,1,6,1,12, 1,24,15,12,28,15,4,15,4,15,4,15,4,9,17,99, 0,0,0,0,0,0,0,0,11,0,0,0,66,0,1,0, 115,65,0,0,0,101,0,0,90,1,0,100,0,0,90,2, 0,100,6,0,100,6,0,100,6,0,100,6,0,100,1,0, 101,4,0,101,4,0,100,6,0,100,2,0,100,3,0,100, 4,0,132,10,0,90,5,0,100,6,0,100,5,0,132,1, 0,90,6,0,82,83,40,7,0,0,0,115,253,20,0,0, 69,120,104,97,117,115,116,105,118,101,32,115,101,97,114,99, 104,32,111,118,101,114,32,115,112,101,99,105,102,105,101,100, 32,112,97,114,97,109,101,116,101,114,32,118,97,108,117,101, 115,32,102,111,114,32,97,110,32,101,115,116,105,109,97,116, 111,114,46,10,10,32,32,32,32,73,109,112,111,114,116,97, 110,116,32,109,101,109,98,101,114,115,32,97,114,101,32,102, 105,116,44,32,112,114,101,100,105,99,116,46,10,10,32,32, 32,32,71,114,105,100,83,101,97,114,99,104,67,86,32,105, 109,112,108,101,109,101,110,116,115,32,97,32,34,102,105,116, 34,32,109,101,116,104,111,100,32,97,110,100,32,97,32,34, 112,114,101,100,105,99,116,34,32,109,101,116,104,111,100,32, 108,105,107,101,10,32,32,32,32,97,110,121,32,99,108,97, 115,115,105,102,105,101,114,32,101,120,99,101,112,116,32,116, 104,97,116,32,116,104,101,32,112,97,114,97,109,101,116,101, 114,115,32,111,102,32,116,104,101,32,99,108,97,115,115,105, 102,105,101,114,10,32,32,32,32,117,115,101,100,32,116,111, 32,112,114,101,100,105,99,116,32,105,115,32,111,112,116,105, 109,105,122,101,100,32,98,121,32,99,114,111,115,115,45,118, 97,108,105,100,97,116,105,111,110,46,10,10,32,32,32,32, 80,97,114,97,109,101,116,101,114,115,10,32,32,32,32,45, 45,45,45,45,45,45,45,45,45,10,32,32,32,32,101,115, 116,105,109,97,116,111,114,32,58,32,111,98,106,101,99,116, 32,116,121,112,101,32,116,104,97,116,32,105,109,112,108,101, 109,101,110,116,115,32,116,104,101,32,34,102,105,116,34,32, 97,110,100,32,34,112,114,101,100,105,99,116,34,32,109,101, 116,104,111,100,115,10,32,32,32,32,32,32,32,32,65,32, 111,98,106,101,99,116,32,111,102,32,116,104,97,116,32,116, 121,112,101,32,105,115,32,105,110,115,116,97,110,116,105,97, 116,101,100,32,102,111,114,32,101,97,99,104,32,103,114,105, 100,32,112,111,105,110,116,46,10,10,32,32,32,32,112,97, 114,97,109,95,103,114,105,100,32,58,32,100,105,99,116,32, 111,114,32,108,105,115,116,32,111,102,32,100,105,99,116,105, 111,110,97,114,105,101,115,10,32,32,32,32,32,32,32,32, 68,105,99,116,105,111,110,97,114,121,32,119,105,116,104,32, 112,97,114,97,109,101,116,101,114,115,32,110,97,109,101,115, 32,40,115,116,114,105,110,103,41,32,97,115,32,107,101,121, 115,32,97,110,100,32,108,105,115,116,115,32,111,102,10,32, 32,32,32,32,32,32,32,112,97,114,97,109,101,116,101,114, 32,115,101,116,116,105,110,103,115,32,116,111,32,116,114,121, 32,97,115,32,118,97,108,117,101,115,44,32,111,114,32,97, 32,108,105,115,116,32,111,102,32,115,117,99,104,10,32,32, 32,32,32,32,32,32,100,105,99,116,105,111,110,97,114,105, 101,115,44,32,105,110,32,119,104,105,99,104,32,99,97,115, 101,32,116,104,101,32,103,114,105,100,115,32,115,112,97,110, 110,101,100,32,98,121,32,101,97,99,104,32,100,105,99,116, 105,111,110,97,114,121,10,32,32,32,32,32,32,32,32,105, 110,32,116,104,101,32,108,105,115,116,32,97,114,101,32,101, 120,112,108,111,114,101,100,46,32,84,104,105,115,32,101,110, 97,98,108,101,115,32,115,101,97,114,99,104,105,110,103,32, 111,118,101,114,32,97,110,121,32,115,101,113,117,101,110,99, 101,10,32,32,32,32,32,32,32,32,111,102,32,112,97,114, 97,109,101,116,101,114,32,115,101,116,116,105,110,103,115,46, 10,10,32,32,32,32,115,99,111,114,105,110,103,32,58,32, 115,116,114,105,110,103,44,32,99,97,108,108,97,98,108,101, 32,111,114,32,78,111,110,101,44,32,111,112,116,105,111,110, 97,108,44,32,100,101,102,97,117,108,116,58,32,78,111,110, 101,10,32,32,32,32,32,32,32,32,65,32,115,116,114,105, 110,103,32,40,115,101,101,32,109,111,100,101,108,32,101,118, 97,108,117,97,116,105,111,110,32,100,111,99,117,109,101,110, 116,97,116,105,111,110,41,32,111,114,10,32,32,32,32,32, 32,32,32,97,32,115,99,111,114,101,114,32,99,97,108,108, 97,98,108,101,32,111,98,106,101,99,116,32,47,32,102,117, 110,99,116,105,111,110,32,119,105,116,104,32,115,105,103,110, 97,116,117,114,101,10,32,32,32,32,32,32,32,32,96,96, 115,99,111,114,101,114,40,101,115,116,105,109,97,116,111,114, 44,32,88,44,32,121,41,96,96,46,10,10,32,32,32,32, 102,105,116,95,112,97,114,97,109,115,32,58,32,100,105,99, 116,44,32,111,112,116,105,111,110,97,108,10,32,32,32,32, 32,32,32,32,80,97,114,97,109,101,116,101,114,115,32,116, 111,32,112,97,115,115,32,116,111,32,116,104,101,32,102,105, 116,32,109,101,116,104,111,100,46,10,10,32,32,32,32,110, 95,106,111,98,115,32,58,32,105,110,116,44,32,111,112,116, 105,111,110,97,108,10,32,32,32,32,32,32,32,32,78,117, 109,98,101,114,32,111,102,32,106,111,98,115,32,116,111,32, 114,117,110,32,105,110,32,112,97,114,97,108,108,101,108,32, 40,100,101,102,97,117,108,116,32,49,41,46,10,10,32,32, 32,32,112,114,101,95,100,105,115,112,97,116,99,104,32,58, 32,105,110,116,44,32,111,114,32,115,116,114,105,110,103,44, 32,111,112,116,105,111,110,97,108,10,32,32,32,32,32,32, 32,32,67,111,110,116,114,111,108,115,32,116,104,101,32,110, 117,109,98,101,114,32,111,102,32,106,111,98,115,32,116,104, 97,116,32,103,101,116,32,100,105,115,112,97,116,99,104,101, 100,32,100,117,114,105,110,103,32,112,97,114,97,108,108,101, 108,10,32,32,32,32,32,32,32,32,101,120,101,99,117,116, 105,111,110,46,32,82,101,100,117,99,105,110,103,32,116,104, 105,115,32,110,117,109,98,101,114,32,99,97,110,32,98,101, 32,117,115,101,102,117,108,32,116,111,32,97,118,111,105,100, 32,97,110,10,32,32,32,32,32,32,32,32,101,120,112,108, 111,115,105,111,110,32,111,102,32,109,101,109,111,114,121,32, 99,111,110,115,117,109,112,116,105,111,110,32,119,104,101,110, 32,109,111,114,101,32,106,111,98,115,32,103,101,116,32,100, 105,115,112,97,116,99,104,101,100,10,32,32,32,32,32,32, 32,32,116,104,97,110,32,67,80,85,115,32,99,97,110,32, 112,114,111,99,101,115,115,46,32,84,104,105,115,32,112,97, 114,97,109,101,116,101,114,32,99,97,110,32,98,101,58,10, 10,32,32,32,32,32,32,32,32,32,32,32,32,45,32,78, 111,110,101,44,32,105,110,32,119,104,105,99,104,32,99,97, 115,101,32,97,108,108,32,116,104,101,32,106,111,98,115,32, 97,114,101,32,105,109,109,101,100,105,97,116,101,108,121,10, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,99,114, 101,97,116,101,100,32,97,110,100,32,115,112,97,119,110,101, 100,46,32,85,115,101,32,116,104,105,115,32,102,111,114,32, 108,105,103,104,116,119,101,105,103,104,116,32,97,110,100,10, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,102,97, 115,116,45,114,117,110,110,105,110,103,32,106,111,98,115,44, 32,116,111,32,97,118,111,105,100,32,100,101,108,97,121,115, 32,100,117,101,32,116,111,32,111,110,45,100,101,109,97,110, 100,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 115,112,97,119,110,105,110,103,32,111,102,32,116,104,101,32, 106,111,98,115,10,10,32,32,32,32,32,32,32,32,32,32, 32,32,45,32,65,110,32,105,110,116,44,32,103,105,118,105, 110,103,32,116,104,101,32,101,120,97,99,116,32,110,117,109, 98,101,114,32,111,102,32,116,111,116,97,108,32,106,111,98, 115,32,116,104,97,116,32,97,114,101,10,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,115,112,97,119,110,101,100, 10,10,32,32,32,32,32,32,32,32,32,32,32,32,45,32, 65,32,115,116,114,105,110,103,44,32,103,105,118,105,110,103, 32,97,110,32,101,120,112,114,101,115,115,105,111,110,32,97, 115,32,97,32,102,117,110,99,116,105,111,110,32,111,102,32, 110,95,106,111,98,115,44,10,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,97,115,32,105,110,32,39,50,42,110, 95,106,111,98,115,39,10,10,32,32,32,32,105,105,100,32, 58,32,98,111,111,108,101,97,110,44,32,111,112,116,105,111, 110,97,108,10,32,32,32,32,32,32,32,32,73,102,32,84, 114,117,101,44,32,116,104,101,32,100,97,116,97,32,105,115, 32,97,115,115,117,109,101,100,32,116,111,32,98,101,32,105, 100,101,110,116,105,99,97,108,108,121,32,100,105,115,116,114, 105,98,117,116,101,100,32,97,99,114,111,115,115,10,32,32, 32,32,32,32,32,32,116,104,101,32,102,111,108,100,115,44, 32,97,110,100,32,116,104,101,32,108,111,115,115,32,109,105, 110,105,109,105,122,101,100,32,105,115,32,116,104,101,32,116, 111,116,97,108,32,108,111,115,115,32,112,101,114,32,115,97, 109,112,108,101,44,10,32,32,32,32,32,32,32,32,97,110, 100,32,110,111,116,32,116,104,101,32,109,101,97,110,32,108, 111,115,115,32,97,99,114,111,115,115,32,116,104,101,32,102, 111,108,100,115,46,10,10,32,32,32,32,99,118,32,58,32, 105,110,116,101,103,101,114,32,111,114,32,99,114,111,115,115, 45,118,97,108,105,100,97,116,105,111,110,32,103,101,110,101, 114,97,116,111,114,44,32,111,112,116,105,111,110,97,108,10, 32,32,32,32,32,32,32,32,73,102,32,97,110,32,105,110, 116,101,103,101,114,32,105,115,32,112,97,115,115,101,100,44, 32,105,116,32,105,115,32,116,104,101,32,110,117,109,98,101, 114,32,111,102,32,102,111,108,100,115,32,40,100,101,102,97, 117,108,116,32,51,41,46,10,32,32,32,32,32,32,32,32, 83,112,101,99,105,102,105,99,32,99,114,111,115,115,45,118, 97,108,105,100,97,116,105,111,110,32,111,98,106,101,99,116, 115,32,99,97,110,32,98,101,32,112,97,115,115,101,100,44, 32,115,101,101,10,32,32,32,32,32,32,32,32,115,107,108, 101,97,114,110,46,99,114,111,115,115,95,118,97,108,105,100, 97,116,105,111,110,32,109,111,100,117,108,101,32,102,111,114, 32,116,104,101,32,108,105,115,116,32,111,102,32,112,111,115, 115,105,98,108,101,32,111,98,106,101,99,116,115,10,10,32, 32,32,32,114,101,102,105,116,32,58,32,98,111,111,108,101, 97,110,10,32,32,32,32,32,32,32,32,82,101,102,105,116, 32,116,104,101,32,98,101,115,116,32,101,115,116,105,109,97, 116,111,114,32,119,105,116,104,32,116,104,101,32,101,110,116, 105,114,101,32,100,97,116,97,115,101,116,46,10,32,32,32, 32,32,32,32,32,73,102,32,34,70,97,108,115,101,34,44, 32,105,116,32,105,115,32,105,109,112,111,115,115,105,98,108, 101,32,116,111,32,109,97,107,101,32,112,114,101,100,105,99, 116,105,111,110,115,32,117,115,105,110,103,10,32,32,32,32, 32,32,32,32,116,104,105,115,32,71,114,105,100,83,101,97, 114,99,104,67,86,32,105,110,115,116,97,110,99,101,32,97, 102,116,101,114,32,102,105,116,116,105,110,103,46,10,10,32, 32,32,32,118,101,114,98,111,115,101,32,58,32,105,110,116, 101,103,101,114,10,32,32,32,32,32,32,32,32,67,111,110, 116,114,111,108,115,32,116,104,101,32,118,101,114,98,111,115, 105,116,121,58,32,116,104,101,32,104,105,103,104,101,114,44, 32,116,104,101,32,109,111,114,101,32,109,101,115,115,97,103, 101,115,46,10,10,32,32,32,32,69,120,97,109,112,108,101, 115,10,32,32,32,32,45,45,45,45,45,45,45,45,10,32, 32,32,32,62,62,62,32,102,114,111,109,32,115,107,108,101, 97,114,110,32,105,109,112,111,114,116,32,115,118,109,44,32, 103,114,105,100,95,115,101,97,114,99,104,44,32,100,97,116, 97,115,101,116,115,10,32,32,32,32,62,62,62,32,105,114, 105,115,32,61,32,100,97,116,97,115,101,116,115,46,108,111, 97,100,95,105,114,105,115,40,41,10,32,32,32,32,62,62, 62,32,112,97,114,97,109,101,116,101,114,115,32,61,32,123, 39,107,101,114,110,101,108,39,58,40,39,108,105,110,101,97, 114,39,44,32,39,114,98,102,39,41,44,32,39,67,39,58, 91,49,44,32,49,48,93,125,10,32,32,32,32,62,62,62, 32,115,118,114,32,61,32,115,118,109,46,83,86,67,40,41, 10,32,32,32,32,62,62,62,32,99,108,102,32,61,32,103, 114,105,100,95,115,101,97,114,99,104,46,71,114,105,100,83, 101,97,114,99,104,67,86,40,115,118,114,44,32,112,97,114, 97,109,101,116,101,114,115,41,10,32,32,32,32,62,62,62, 32,99,108,102,46,102,105,116,40,105,114,105,115,46,100,97, 116,97,44,32,105,114,105,115,46,116,97,114,103,101,116,41, 10,32,32,32,32,46,46,46,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,35,32,100,111,99,116,101,115,116,58,32, 43,78,79,82,77,65,76,73,90,69,95,87,72,73,84,69, 83,80,65,67,69,32,43,69,76,76,73,80,83,73,83,10, 32,32,32,32,71,114,105,100,83,101,97,114,99,104,67,86, 40,99,118,61,78,111,110,101,44,10,32,32,32,32,32,32, 32,32,32,32,32,101,115,116,105,109,97,116,111,114,61,83, 86,67,40,67,61,49,46,48,44,32,99,97,99,104,101,95, 115,105,122,101,61,46,46,46,44,32,99,108,97,115,115,95, 119,101,105,103,104,116,61,46,46,46,44,32,99,111,101,102, 48,61,46,46,46,44,32,100,101,103,114,101,101,61,46,46, 46,44,32,103,97,109,109,97,61,46,46,46,44,10,32,32, 32,32,32,32,32,107,101,114,110,101,108,61,39,114,98,102, 39,44,32,109,97,120,95,105,116,101,114,61,45,49,44,32, 112,114,111,98,97,98,105,108,105,116,121,61,70,97,108,115, 101,44,32,114,97,110,100,111,109,95,115,116,97,116,101,61, 78,111,110,101,44,10,32,32,32,32,32,32,32,115,104,114, 105,110,107,105,110,103,61,84,114,117,101,44,32,116,111,108, 61,46,46,46,44,32,118,101,114,98,111,115,101,61,70,97, 108,115,101,41,44,10,32,32,32,32,32,32,32,32,32,32, 32,102,105,116,95,112,97,114,97,109,115,61,123,125,44,32, 105,105,100,61,46,46,46,44,32,108,111,115,115,95,102,117, 110,99,61,46,46,46,44,32,110,95,106,111,98,115,61,49, 44,10,32,32,32,32,32,32,32,32,32,32,32,112,97,114, 97,109,95,103,114,105,100,61,46,46,46,44,32,112,114,101, 95,100,105,115,112,97,116,99,104,61,46,46,46,44,32,114, 101,102,105,116,61,46,46,46,44,32,115,99,111,114,101,95, 102,117,110,99,61,46,46,46,44,10,32,32,32,32,32,32, 32,32,32,32,32,115,99,111,114,105,110,103,61,46,46,46, 44,32,118,101,114,98,111,115,101,61,46,46,46,41,10,10, 10,32,32,32,32,65,116,116,114,105,98,117,116,101,115,10, 32,32,32,32,45,45,45,45,45,45,45,45,45,45,10,32, 32,32,32,96,103,114,105,100,95,115,99,111,114,101,115,95, 96,32,58,32,108,105,115,116,32,111,102,32,110,97,109,101, 100,32,116,117,112,108,101,115,10,32,32,32,32,32,32,32, 32,67,111,110,116,97,105,110,115,32,115,99,111,114,101,115, 32,102,111,114,32,97,108,108,32,112,97,114,97,109,101,116, 101,114,32,99,111,109,98,105,110,97,116,105,111,110,115,32, 105,110,32,112,97,114,97,109,95,103,114,105,100,46,10,32, 32,32,32,32,32,32,32,69,97,99,104,32,101,110,116,114, 121,32,99,111,114,114,101,115,112,111,110,100,115,32,116,111, 32,111,110,101,32,112,97,114,97,109,101,116,101,114,32,115, 101,116,116,105,110,103,46,10,32,32,32,32,32,32,32,32, 69,97,99,104,32,110,97,109,101,100,32,116,117,112,108,101, 32,104,97,115,32,116,104,101,32,97,116,116,114,105,98,117, 116,101,115,58,10,10,32,32,32,32,32,32,32,32,32,32, 32,32,42,32,96,96,112,97,114,97,109,101,116,101,114,115, 96,96,44,32,97,32,100,105,99,116,32,111,102,32,112,97, 114,97,109,101,116,101,114,32,115,101,116,116,105,110,103,115, 10,32,32,32,32,32,32,32,32,32,32,32,32,42,32,96, 96,109,101,97,110,95,118,97,108,105,100,97,116,105,111,110, 95,115,99,111,114,101,96,96,44,32,116,104,101,32,109,101, 97,110,32,115,99,111,114,101,32,111,118,101,114,32,116,104, 101,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 99,114,111,115,115,45,118,97,108,105,100,97,116,105,111,110, 32,102,111,108,100,115,10,32,32,32,32,32,32,32,32,32, 32,32,32,42,32,96,96,99,118,95,118,97,108,105,100,97, 116,105,111,110,95,115,99,111,114,101,115,96,96,44,32,116, 104,101,32,108,105,115,116,32,111,102,32,115,99,111,114,101, 115,32,102,111,114,32,101,97,99,104,32,102,111,108,100,10, 10,32,32,32,32,96,98,101,115,116,95,101,115,116,105,109, 97,116,111,114,95,96,32,58,32,101,115,116,105,109,97,116, 111,114,10,32,32,32,32,32,32,32,32,69,115,116,105,109, 97,116,111,114,32,116,104,97,116,32,119,97,115,32,99,104, 111,115,101,110,32,98,121,32,116,104,101,32,115,101,97,114, 99,104,44,32,105,46,101,46,32,101,115,116,105,109,97,116, 111,114,10,32,32,32,32,32,32,32,32,119,104,105,99,104, 32,103,97,118,101,32,104,105,103,104,101,115,116,32,115,99, 111,114,101,32,40,111,114,32,115,109,97,108,108,101,115,116, 32,108,111,115,115,32,105,102,32,115,112,101,99,105,102,105, 101,100,41,10,32,32,32,32,32,32,32,32,111,110,32,116, 104,101,32,108,101,102,116,32,111,117,116,32,100,97,116,97, 46,10,10,32,32,32,32,96,98,101,115,116,95,115,99,111, 114,101,95,96,32,58,32,102,108,111,97,116,10,32,32,32, 32,32,32,32,32,83,99,111,114,101,32,111,102,32,98,101, 115,116,95,101,115,116,105,109,97,116,111,114,32,111,110,32, 116,104,101,32,108,101,102,116,32,111,117,116,32,100,97,116, 97,46,10,10,32,32,32,32,96,98,101,115,116,95,112,97, 114,97,109,115,95,96,32,58,32,100,105,99,116,10,32,32, 32,32,32,32,32,32,80,97,114,97,109,101,116,101,114,32, 115,101,116,116,105,110,103,32,116,104,97,116,32,103,97,118, 101,32,116,104,101,32,98,101,115,116,32,114,101,115,117,108, 116,115,32,111,110,32,116,104,101,32,104,111,108,100,32,111, 117,116,32,100,97,116,97,46,10,10,32,32,32,32,78,111, 116,101,115,10,32,32,32,32,45,45,45,45,45,45,10,32, 32,32,32,84,104,101,32,112,97,114,97,109,101,116,101,114, 115,32,115,101,108,101,99,116,101,100,32,97,114,101,32,116, 104,111,115,101,32,116,104,97,116,32,109,97,120,105,109,105, 122,101,32,116,104,101,32,115,99,111,114,101,32,111,102,32, 116,104,101,32,108,101,102,116,32,111,117,116,10,32,32,32, 32,100,97,116,97,44,32,117,110,108,101,115,115,32,97,110, 32,101,120,112,108,105,99,105,116,32,115,99,111,114,101,32, 105,115,32,112,97,115,115,101,100,32,105,110,32,119,104,105, 99,104,32,99,97,115,101,32,105,116,32,105,115,32,117,115, 101,100,32,105,110,115,116,101,97,100,46,10,10,32,32,32, 32,73,102,32,96,110,95,106,111,98,115,96,32,119,97,115, 32,115,101,116,32,116,111,32,97,32,118,97,108,117,101,32, 104,105,103,104,101,114,32,116,104,97,110,32,111,110,101,44, 32,116,104,101,32,100,97,116,97,32,105,115,32,99,111,112, 105,101,100,32,102,111,114,32,101,97,99,104,10,32,32,32, 32,112,111,105,110,116,32,105,110,32,116,104,101,32,103,114, 105,100,32,40,97,110,100,32,110,111,116,32,96,110,95,106, 111,98,115,96,32,116,105,109,101,115,41,46,32,84,104,105, 115,32,105,115,32,100,111,110,101,32,102,111,114,32,101,102, 102,105,99,105,101,110,99,121,10,32,32,32,32,114,101,97, 115,111,110,115,32,105,102,32,105,110,100,105,118,105,100,117, 97,108,32,106,111,98,115,32,116,97,107,101,32,118,101,114, 121,32,108,105,116,116,108,101,32,116,105,109,101,44,32,98, 117,116,32,109,97,121,32,114,97,105,115,101,32,101,114,114, 111,114,115,32,105,102,10,32,32,32,32,116,104,101,32,100, 97,116,97,115,101,116,32,105,115,32,108,97,114,103,101,32, 97,110,100,32,110,111,116,32,101,110,111,117,103,104,32,109, 101,109,111,114,121,32,105,115,32,97,118,97,105,108,97,98, 108,101,46,32,32,65,32,119,111,114,107,97,114,111,117,110, 100,32,105,110,10,32,32,32,32,116,104,105,115,32,99,97, 115,101,32,105,115,32,116,111,32,115,101,116,32,96,112,114, 101,95,100,105,115,112,97,116,99,104,96,46,32,84,104,101, 110,44,32,116,104,101,32,109,101,109,111,114,121,32,105,115, 32,99,111,112,105,101,100,32,111,110,108,121,10,32,32,32, 32,96,112,114,101,95,100,105,115,112,97,116,99,104,96,32, 109,97,110,121,32,116,105,109,101,115,46,32,65,32,114,101, 97,115,111,110,97,98,108,101,32,118,97,108,117,101,32,102, 111,114,32,96,112,114,101,95,100,105,115,112,97,116,99,104, 96,32,105,115,32,96,50,32,42,10,32,32,32,32,110,95, 106,111,98,115,96,46,10,10,32,32,32,32,83,101,101,32, 65,108,115,111,10,32,32,32,32,45,45,45,45,45,45,45, 45,45,10,32,32,32,32,58,99,108,97,115,115,58,96,80, 97,114,97,109,101,116,101,114,71,114,105,100,96,58,10,32, 32,32,32,32,32,32,32,103,101,110,101,114,97,116,101,115, 32,97,108,108,32,116,104,101,32,99,111,109,98,105,110,97, 116,105,111,110,115,32,111,102,32,97,32,97,110,32,104,121, 112,101,114,112,97,114,97,109,101,116,101,114,32,103,114,105, 100,46,10,10,32,32,32,32,58,102,117,110,99,58,96,115, 107,108,101,97,114,110,46,99,114,111,115,115,95,118,97,108, 105,100,97,116,105,111,110,46,116,114,97,105,110,95,116,101, 115,116,95,115,112,108,105,116,96,58,10,32,32,32,32,32, 32,32,32,117,116,105,108,105,116,121,32,102,117,110,99,116, 105,111,110,32,116,111,32,115,112,108,105,116,32,116,104,101, 32,100,97,116,97,32,105,110,116,111,32,97,32,100,101,118, 101,108,111,112,109,101,110,116,32,115,101,116,32,117,115,97, 98,108,101,10,32,32,32,32,32,32,32,32,102,111,114,32, 102,105,116,116,105,110,103,32,97,32,71,114,105,100,83,101, 97,114,99,104,67,86,32,105,110,115,116,97,110,99,101,32, 97,110,100,32,97,110,32,101,118,97,108,117,97,116,105,111, 110,32,115,101,116,32,102,111,114,10,32,32,32,32,32,32, 32,32,105,116,115,32,102,105,110,97,108,32,101,118,97,108, 117,97,116,105,111,110,46,10,10,32,32,32,32,105,1,0, 0,0,105,0,0,0,0,115,8,0,0,0,50,42,110,95, 106,111,98,115,99,13,0,0,0,13,0,0,0,12,0,0, 0,67,0,1,0,115,75,0,0,0,116,0,0,116,1,0, 124,0,0,131,2,0,106,2,0,124,1,0,124,3,0,124, 4,0,124,5,0,124,6,0,124,7,0,124,8,0,124,9, 0,124,10,0,124,11,0,124,12,0,131,11,0,1,124,2, 0,124,0,0,95,3,0,116,4,0,124,2,0,131,1,0, 1,100,0,0,83,40,1,0,0,0,78,40,5,0,0,0, 82,55,0,0,0,82,23,0,0,0,82,31,0,0,0,82, 29,0,0,0,82,114,0,0,0,40,13,0,0,0,82,30, 0,0,0,82,124,0,0,0,82,29,0,0,0,82,123,0, 0,0,82,96,0,0,0,82,125,0,0,0,82,97,0,0, 0,82,126,0,0,0,82,127,0,0,0,82,128,0,0,0, 82,129,0,0,0,82,95,0,0,0,82,130,0,0,0,40, 0,0,0,0,40,0,0,0,0,115,61,0,0,0,47,117, 115,114,47,108,111,99,97,108,47,108,105,98,47,112,121,116, 104,111,110,50,46,55,47,100,105,115,116,45,112,97,99,107, 97,103,101,115,47,115,107,108,101,97,114,110,47,103,114,105, 100,95,115,101,97,114,99,104,46,112,121,82,31,0,0,0, 167,2,0,0,115,10,0,0,0,0,3,15,1,21,1,16, 1,9,1,99,3,0,0,0,4,0,0,0,5,0,0,0, 75,0,1,0,115,53,0,0,0,124,3,0,114,25,0,116, 0,0,106,1,0,100,1,0,116,2,0,131,2,0,1,110, 0,0,124,0,0,106,3,0,124,1,0,124,2,0,116,4, 0,124,0,0,106,5,0,131,1,0,131,3,0,83,40,2, 0,0,0,115,201,1,0,0,82,117,110,32,102,105,116,32, 119,105,116,104,32,97,108,108,32,115,101,116,115,32,111,102, 32,112,97,114,97,109,101,116,101,114,115,46,10,10,32,32, 32,32,32,32,32,32,80,97,114,97,109,101,116,101,114,115, 10,32,32,32,32,32,32,32,32,45,45,45,45,45,45,45, 45,45,45,10,10,32,32,32,32,32,32,32,32,88,32,58, 32,97,114,114,97,121,45,108,105,107,101,44,32,115,104,97, 112,101,32,61,32,91,110,95,115,97,109,112,108,101,115,44, 32,110,95,102,101,97,116,117,114,101,115,93,10,32,32,32, 32,32,32,32,32,32,32,32,32,84,114,97,105,110,105,110, 103,32,118,101,99,116,111,114,44,32,119,104,101,114,101,32, 110,95,115,97,109,112,108,101,115,32,105,115,32,116,104,101, 32,110,117,109,98,101,114,32,111,102,32,115,97,109,112,108, 101,115,32,97,110,100,10,32,32,32,32,32,32,32,32,32, 32,32,32,110,95,102,101,97,116,117,114,101,115,32,105,115, 32,116,104,101,32,110,117,109,98,101,114,32,111,102,32,102, 101,97,116,117,114,101,115,46,10,10,32,32,32,32,32,32, 32,32,121,32,58,32,97,114,114,97,121,45,108,105,107,101, 44,32,115,104,97,112,101,32,61,32,91,110,95,115,97,109, 112,108,101,115,93,32,111,114,32,91,110,95,115,97,109,112, 108,101,115,44,32,110,95,111,117,116,112,117,116,93,44,32, 111,112,116,105,111,110,97,108,10,32,32,32,32,32,32,32, 32,32,32,32,32,84,97,114,103,101,116,32,114,101,108,97, 116,105,118,101,32,116,111,32,88,32,102,111,114,32,99,108, 97,115,115,105,102,105,99,97,116,105,111,110,32,111,114,32, 114,101,103,114,101,115,115,105,111,110,59,10,32,32,32,32, 32,32,32,32,32,32,32,32,78,111,110,101,32,102,111,114, 32,117,110,115,117,112,101,114,118,105,115,101,100,32,108,101, 97,114,110,105,110,103,46,10,10,32,32,32,32,32,32,32, 32,115,95,0,0,0,65,100,100,105,116,105,111,110,97,108, 32,112,97,114,97,109,101,116,101,114,115,32,116,111,32,71, 114,105,100,83,101,97,114,99,104,67,86,32,97,114,101,32, 105,103,110,111,114,101,100,33,32,84,104,101,32,112,97,114, 97,109,115,32,97,114,103,117,109,101,110,116,32,119,105,108, 108,32,98,101,32,114,101,109,111,118,101,100,32,105,110,32, 48,46,49,53,46,40,6,0,0,0,82,52,0,0,0,82, 53,0,0,0,82,54,0,0,0,82,168,0,0,0,82,24, 0,0,0,82,29,0,0,0,40,4,0,0,0,82,30,0, 0,0,82,88,0,0,0,82,89,0,0,0,82,40,0,0, 0,40,0,0,0,0,40,0,0,0,0,115,61,0,0,0, 47,117,115,114,47,108,111,99,97,108,47,108,105,98,47,112, 121,116,104,111,110,50,46,55,47,100,105,115,116,45,112,97, 99,107,97,103,101,115,47,115,107,108,101,97,114,110,47,103, 114,105,100,95,115,101,97,114,99,104,46,112,121,82,81,0, 0,0,176,2,0,0,115,8,0,0,0,0,15,6,1,9, 2,10,1,78,40,7,0,0,0,82,48,0,0,0,82,49, 0,0,0,82,50,0,0,0,82,66,0,0,0,82,112,0, 0,0,82,31,0,0,0,82,81,0,0,0,40,0,0,0, 0,40,0,0,0,0,40,0,0,0,0,115,61,0,0,0, 47,117,115,114,47,108,111,99,97,108,47,108,105,98,47,112, 121,116,104,111,110,50,46,55,47,100,105,115,116,45,112,97, 99,107,97,103,101,115,47,115,107,108,101,97,114,110,47,103, 114,105,100,95,115,101,97,114,99,104,46,112,121,82,23,0, 0,0,34,2,0,0,115,10,0,0,0,6,131,6,2,6, 1,12,1,21,7,99,0,0,0,0,0,0,0,0,11,0, 0,0,66,0,1,0,115,65,0,0,0,101,0,0,90,1, 0,100,0,0,90,2,0,100,1,0,100,7,0,100,7,0, 100,2,0,101,4,0,101,4,0,100,7,0,100,3,0,100, 4,0,100,7,0,100,5,0,132,10,0,90,5,0,100,7, 0,100,6,0,132,1,0,90,6,0,82,83,40,8,0,0, 0,115,112,18,0,0,82,97,110,100,111,109,105,122,101,100, 32,115,101,97,114,99,104,32,111,110,32,104,121,112,101,114, 32,112,97,114,97,109,101,116,101,114,115,46,10,10,32,32, 32,32,82,97,110,100,111,109,105,122,101,100,83,101,97,114, 99,104,67,86,32,105,109,112,108,101,109,101,110,116,115,32, 97,32,34,102,105,116,34,32,109,101,116,104,111,100,32,97, 110,100,32,97,32,34,112,114,101,100,105,99,116,34,32,109, 101,116,104,111,100,32,108,105,107,101,10,32,32,32,32,97, 110,121,32,99,108,97,115,115,105,102,105,101,114,32,101,120, 99,101,112,116,32,116,104,97,116,32,116,104,101,32,112,97, 114,97,109,101,116,101,114,115,32,111,102,32,116,104,101,32, 99,108,97,115,115,105,102,105,101,114,10,32,32,32,32,117, 115,101,100,32,116,111,32,112,114,101,100,105,99,116,32,105, 115,32,111,112,116,105,109,105,122,101,100,32,98,121,32,99, 114,111,115,115,45,118,97,108,105,100,97,116,105,111,110,46, 10,10,32,32,32,32,73,110,32,99,111,110,116,114,97,115, 116,32,116,111,32,71,114,105,100,83,101,97,114,99,104,67, 86,44,32,110,111,116,32,97,108,108,32,112,97,114,97,109, 101,116,101,114,32,118,97,108,117,101,115,32,97,114,101,32, 116,114,105,101,100,32,111,117,116,44,32,98,117,116,10,32, 32,32,32,114,97,116,104,101,114,32,97,32,102,105,120,101, 100,32,110,117,109,98,101,114,32,111,102,32,112,97,114,97, 109,101,116,101,114,32,115,101,116,116,105,110,103,115,32,105, 115,32,115,97,109,112,108,101,100,32,102,114,111,109,32,116, 104,101,32,115,112,101,99,105,102,105,101,100,10,32,32,32, 32,100,105,115,116,114,105,98,117,116,105,111,110,115,46,32, 84,104,101,32,110,117,109,98,101,114,32,111,102,32,112,97, 114,97,109,101,116,101,114,32,115,101,116,116,105,110,103,115, 32,116,104,97,116,32,97,114,101,32,116,114,105,101,100,32, 105,115,10,32,32,32,32,103,105,118,101,110,32,98,121,32, 110,95,105,116,101,114,46,10,10,32,32,32,32,80,97,114, 97,109,101,116,101,114,115,10,32,32,32,32,45,45,45,45, 45,45,45,45,45,45,10,32,32,32,32,101,115,116,105,109, 97,116,111,114,32,58,32,111,98,106,101,99,116,32,116,121, 112,101,32,116,104,97,116,32,105,109,112,108,101,109,101,110, 116,115,32,116,104,101,32,34,102,105,116,34,32,97,110,100, 32,34,112,114,101,100,105,99,116,34,32,109,101,116,104,111, 100,115,10,32,32,32,32,32,32,32,32,65,32,111,98,106, 101,99,116,32,111,102,32,116,104,97,116,32,116,121,112,101, 32,105,115,32,105,110,115,116,97,110,116,105,97,116,101,100, 32,102,111,114,32,101,97,99,104,32,112,97,114,97,109,101, 116,101,114,32,115,101,116,116,105,110,103,46,10,10,32,32, 32,32,112,97,114,97,109,95,100,105,115,116,114,105,98,117, 116,105,111,110,115,32,58,32,100,105,99,116,10,32,32,32, 32,32,32,32,32,68,105,99,116,105,111,110,97,114,121,32, 119,105,116,104,32,112,97,114,97,109,101,116,101,114,115,32, 110,97,109,101,115,32,40,115,116,114,105,110,103,41,32,97, 115,32,107,101,121,115,32,97,110,100,32,100,105,115,116,114, 105,98,117,116,105,111,110,115,10,32,32,32,32,32,32,32, 32,111,114,32,108,105,115,116,115,32,111,102,32,112,97,114, 97,109,101,116,101,114,115,32,116,111,32,116,114,121,46,32, 68,105,115,116,114,105,98,117,116,105,111,110,115,32,109,117, 115,116,32,112,114,111,118,105,100,101,32,97,32,96,96,114, 118,115,96,96,10,32,32,32,32,32,32,32,32,109,101,116, 104,111,100,32,102,111,114,32,115,97,109,112,108,105,110,103, 32,40,115,117,99,104,32,97,115,32,116,104,111,115,101,32, 102,114,111,109,32,115,99,105,112,121,46,115,116,97,116,115, 46,100,105,115,116,114,105,98,117,116,105,111,110,115,41,46, 10,32,32,32,32,32,32,32,32,73,102,32,97,32,108,105, 115,116,32,105,115,32,103,105,118,101,110,44,32,105,116,32, 105,115,32,115,97,109,112,108,101,100,32,117,110,105,102,111, 114,109,108,121,46,10,10,32,32,32,32,110,95,105,116,101, 114,32,58,32,105,110,116,44,32,100,101,102,97,117,108,116, 61,49,48,10,32,32,32,32,32,32,32,32,78,117,109,98, 101,114,32,111,102,32,112,97,114,97,109,101,116,101,114,32, 115,101,116,116,105,110,103,115,32,116,104,97,116,32,97,114, 101,32,115,97,109,112,108,101,100,46,32,110,95,105,116,101, 114,32,116,114,97,100,101,115,10,32,32,32,32,32,32,32, 32,111,102,102,32,114,117,110,116,105,109,101,32,118,115,32, 113,117,97,108,105,116,121,32,111,102,32,116,104,101,32,115, 111,108,117,116,105,111,110,46,10,10,32,32,32,32,115,99, 111,114,105,110,103,32,58,32,115,116,114,105,110,103,44,32, 99,97,108,108,97,98,108,101,32,111,114,32,78,111,110,101, 44,32,111,112,116,105,111,110,97,108,44,32,100,101,102,97, 117,108,116,58,32,78,111,110,101,10,32,32,32,32,32,32, 32,32,65,32,115,116,114,105,110,103,32,40,115,101,101,32, 109,111,100,101,108,32,101,118,97,108,117,97,116,105,111,110, 32,100,111,99,117,109,101,110,116,97,116,105,111,110,41,32, 111,114,10,32,32,32,32,32,32,32,32,97,32,115,99,111, 114,101,114,32,99,97,108,108,97,98,108,101,32,111,98,106, 101,99,116,32,47,32,102,117,110,99,116,105,111,110,32,119, 105,116,104,32,115,105,103,110,97,116,117,114,101,10,32,32, 32,32,32,32,32,32,96,96,115,99,111,114,101,114,40,101, 115,116,105,109,97,116,111,114,44,32,88,44,32,121,41,96, 96,46,10,10,32,32,32,32,102,105,116,95,112,97,114,97, 109,115,32,58,32,100,105,99,116,44,32,111,112,116,105,111, 110,97,108,10,32,32,32,32,32,32,32,32,80,97,114,97, 109,101,116,101,114,115,32,116,111,32,112,97,115,115,32,116, 111,32,116,104,101,32,102,105,116,32,109,101,116,104,111,100, 46,10,10,32,32,32,32,110,95,106,111,98,115,32,58,32, 105,110,116,44,32,111,112,116,105,111,110,97,108,10,32,32, 32,32,32,32,32,32,78,117,109,98,101,114,32,111,102,32, 106,111,98,115,32,116,111,32,114,117,110,32,105,110,32,112, 97,114,97,108,108,101,108,32,40,100,101,102,97,117,108,116, 32,49,41,46,10,10,32,32,32,32,112,114,101,95,100,105, 115,112,97,116,99,104,32,58,32,105,110,116,44,32,111,114, 32,115,116,114,105,110,103,44,32,111,112,116,105,111,110,97, 108,10,32,32,32,32,32,32,32,32,67,111,110,116,114,111, 108,115,32,116,104,101,32,110,117,109,98,101,114,32,111,102, 32,106,111,98,115,32,116,104,97,116,32,103,101,116,32,100, 105,115,112,97,116,99,104,101,100,32,100,117,114,105,110,103, 32,112,97,114,97,108,108,101,108,10,32,32,32,32,32,32, 32,32,101,120,101,99,117,116,105,111,110,46,32,82,101,100, 117,99,105,110,103,32,116,104,105,115,32,110,117,109,98,101, 114,32,99,97,110,32,98,101,32,117,115,101,102,117,108,32, 116,111,32,97,118,111,105,100,32,97,110,10,32,32,32,32, 32,32,32,32,101,120,112,108,111,115,105,111,110,32,111,102, 32,109,101,109,111,114,121,32,99,111,110,115,117,109,112,116, 105,111,110,32,119,104,101,110,32,109,111,114,101,32,106,111, 98,115,32,103,101,116,32,100,105,115,112,97,116,99,104,101, 100,10,32,32,32,32,32,32,32,32,116,104,97,110,32,67, 80,85,115,32,99,97,110,32,112,114,111,99,101,115,115,46, 32,84,104,105,115,32,112,97,114,97,109,101,116,101,114,32, 99,97,110,32,98,101,58,10,10,32,32,32,32,32,32,32, 32,32,32,32,32,45,32,78,111,110,101,44,32,105,110,32, 119,104,105,99,104,32,99,97,115,101,32,97,108,108,32,116, 104,101,32,106,111,98,115,32,97,114,101,32,105,109,109,101, 100,105,97,116,101,108,121,10,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,99,114,101,97,116,101,100,32,97,110, 100,32,115,112,97,119,110,101,100,46,32,85,115,101,32,116, 104,105,115,32,102,111,114,32,108,105,103,104,116,119,101,105, 103,104,116,32,97,110,100,10,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,102,97,115,116,45,114,117,110,110,105, 110,103,32,106,111,98,115,44,32,116,111,32,97,118,111,105, 100,32,100,101,108,97,121,115,32,100,117,101,32,116,111,32, 111,110,45,100,101,109,97,110,100,10,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,115,112,97,119,110,105,110,103, 32,111,102,32,116,104,101,32,106,111,98,115,10,10,32,32, 32,32,32,32,32,32,32,32,32,32,45,32,65,110,32,105, 110,116,44,32,103,105,118,105,110,103,32,116,104,101,32,101, 120,97,99,116,32,110,117,109,98,101,114,32,111,102,32,116, 111,116,97,108,32,106,111,98,115,32,116,104,97,116,32,97, 114,101,10,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,115,112,97,119,110,101,100,10,10,32,32,32,32,32,32, 32,32,32,32,32,32,45,32,65,32,115,116,114,105,110,103, 44,32,103,105,118,105,110,103,32,97,110,32,101,120,112,114, 101,115,115,105,111,110,32,97,115,32,97,32,102,117,110,99, 116,105,111,110,32,111,102,32,110,95,106,111,98,115,44,10, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,115, 32,105,110,32,39,50,42,110,95,106,111,98,115,39,10,10, 32,32,32,32,105,105,100,32,58,32,98,111,111,108,101,97, 110,44,32,111,112,116,105,111,110,97,108,10,32,32,32,32, 32,32,32,32,73,102,32,84,114,117,101,44,32,116,104,101, 32,100,97,116,97,32,105,115,32,97,115,115,117,109,101,100, 32,116,111,32,98,101,32,105,100,101,110,116,105,99,97,108, 108,121,32,100,105,115,116,114,105,98,117,116,101,100,32,97, 99,114,111,115,115,10,32,32,32,32,32,32,32,32,116,104, 101,32,102,111,108,100,115,44,32,97,110,100,32,116,104,101, 32,108,111,115,115,32,109,105,110,105,109,105,122,101,100,32, 105,115,32,116,104,101,32,116,111,116,97,108,32,108,111,115, 115,32,112,101,114,32,115,97,109,112,108,101,44,10,32,32, 32,32,32,32,32,32,97,110,100,32,110,111,116,32,116,104, 101,32,109,101,97,110,32,108,111,115,115,32,97,99,114,111, 115,115,32,116,104,101,32,102,111,108,100,115,46,10,10,32, 32,32,32,99,118,32,58,32,105,110,116,101,103,101,114,32, 111,114,32,99,114,111,115,115,45,118,97,108,105,100,97,116, 105,111,110,32,103,101,110,101,114,97,116,111,114,44,32,111, 112,116,105,111,110,97,108,10,32,32,32,32,32,32,32,32, 73,102,32,97,110,32,105,110,116,101,103,101,114,32,105,115, 32,112,97,115,115,101,100,44,32,105,116,32,105,115,32,116, 104,101,32,110,117,109,98,101,114,32,111,102,32,102,111,108, 100,115,32,40,100,101,102,97,117,108,116,32,51,41,46,10, 32,32,32,32,32,32,32,32,83,112,101,99,105,102,105,99, 32,99,114,111,115,115,45,118,97,108,105,100,97,116,105,111, 110,32,111,98,106,101,99,116,115,32,99,97,110,32,98,101, 32,112,97,115,115,101,100,44,32,115,101,101,10,32,32,32, 32,32,32,32,32,115,107,108,101,97,114,110,46,99,114,111, 115,115,95,118,97,108,105,100,97,116,105,111,110,32,109,111, 100,117,108,101,32,102,111,114,32,116,104,101,32,108,105,115, 116,32,111,102,32,112,111,115,115,105,98,108,101,32,111,98, 106,101,99,116,115,10,10,32,32,32,32,114,101,102,105,116, 32,58,32,98,111,111,108,101,97,110,10,32,32,32,32,32, 32,32,32,82,101,102,105,116,32,116,104,101,32,98,101,115, 116,32,101,115,116,105,109,97,116,111,114,32,119,105,116,104, 32,116,104,101,32,101,110,116,105,114,101,32,100,97,116,97, 115,101,116,46,10,32,32,32,32,32,32,32,32,73,102,32, 34,70,97,108,115,101,34,44,32,105,116,32,105,115,32,105, 109,112,111,115,115,105,98,108,101,32,116,111,32,109,97,107, 101,32,112,114,101,100,105,99,116,105,111,110,115,32,117,115, 105,110,103,10,32,32,32,32,32,32,32,32,116,104,105,115, 32,82,97,110,100,111,109,105,122,101,100,83,101,97,114,99, 104,67,86,32,105,110,115,116,97,110,99,101,32,97,102,116, 101,114,32,102,105,116,116,105,110,103,46,10,10,32,32,32, 32,118,101,114,98,111,115,101,32,58,32,105,110,116,101,103, 101,114,10,32,32,32,32,32,32,32,32,67,111,110,116,114, 111,108,115,32,116,104,101,32,118,101,114,98,111,115,105,116, 121,58,32,116,104,101,32,104,105,103,104,101,114,44,32,116, 104,101,32,109,111,114,101,32,109,101,115,115,97,103,101,115, 46,10,10,10,32,32,32,32,65,116,116,114,105,98,117,116, 101,115,10,32,32,32,32,45,45,45,45,45,45,45,45,45, 45,10,32,32,32,32,96,103,114,105,100,95,115,99,111,114, 101,115,95,96,32,58,32,108,105,115,116,32,111,102,32,110, 97,109,101,100,32,116,117,112,108,101,115,10,32,32,32,32, 32,32,32,32,67,111,110,116,97,105,110,115,32,115,99,111, 114,101,115,32,102,111,114,32,97,108,108,32,112,97,114,97, 109,101,116,101,114,32,99,111,109,98,105,110,97,116,105,111, 110,115,32,105,110,32,112,97,114,97,109,95,103,114,105,100, 46,10,32,32,32,32,32,32,32,32,69,97,99,104,32,101, 110,116,114,121,32,99,111,114,114,101,115,112,111,110,100,115, 32,116,111,32,111,110,101,32,112,97,114,97,109,101,116,101, 114,32,115,101,116,116,105,110,103,46,10,32,32,32,32,32, 32,32,32,69,97,99,104,32,110,97,109,101,100,32,116,117, 112,108,101,32,104,97,115,32,116,104,101,32,97,116,116,114, 105,98,117,116,101,115,58,10,10,32,32,32,32,32,32,32, 32,32,32,32,32,42,32,96,96,112,97,114,97,109,101,116, 101,114,115,96,96,44,32,97,32,100,105,99,116,32,111,102, 32,112,97,114,97,109,101,116,101,114,32,115,101,116,116,105, 110,103,115,10,32,32,32,32,32,32,32,32,32,32,32,32, 42,32,96,96,109,101,97,110,95,118,97,108,105,100,97,116, 105,111,110,95,115,99,111,114,101,96,96,44,32,116,104,101, 32,109,101,97,110,32,115,99,111,114,101,32,111,118,101,114, 32,116,104,101,10,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,99,114,111,115,115,45,118,97,108,105,100,97,116, 105,111,110,32,102,111,108,100,115,10,32,32,32,32,32,32, 32,32,32,32,32,32,42,32,96,96,99,118,95,118,97,108, 105,100,97,116,105,111,110,95,115,99,111,114,101,115,96,96, 44,32,116,104,101,32,108,105,115,116,32,111,102,32,115,99, 111,114,101,115,32,102,111,114,32,101,97,99,104,32,102,111, 108,100,10,10,32,32,32,32,96,98,101,115,116,95,101,115, 116,105,109,97,116,111,114,95,96,32,58,32,101,115,116,105, 109,97,116,111,114,10,32,32,32,32,32,32,32,32,69,115, 116,105,109,97,116,111,114,32,116,104,97,116,32,119,97,115, 32,99,104,111,115,101,110,32,98,121,32,116,104,101,32,115, 101,97,114,99,104,44,32,105,46,101,46,32,101,115,116,105, 109,97,116,111,114,10,32,32,32,32,32,32,32,32,119,104, 105,99,104,32,103,97,118,101,32,104,105,103,104,101,115,116, 32,115,99,111,114,101,32,40,111,114,32,115,109,97,108,108, 101,115,116,32,108,111,115,115,32,105,102,32,115,112,101,99, 105,102,105,101,100,41,10,32,32,32,32,32,32,32,32,111, 110,32,116,104,101,32,108,101,102,116,32,111,117,116,32,100, 97,116,97,46,10,10,32,32,32,32,96,98,101,115,116,95, 115,99,111,114,101,95,96,32,58,32,102,108,111,97,116,10, 32,32,32,32,32,32,32,32,83,99,111,114,101,32,111,102, 32,98,101,115,116,95,101,115,116,105,109,97,116,111,114,32, 111,110,32,116,104,101,32,108,101,102,116,32,111,117,116,32, 100,97,116,97,46,10,10,32,32,32,32,96,98,101,115,116, 95,112,97,114,97,109,115,95,96,32,58,32,100,105,99,116, 10,32,32,32,32,32,32,32,32,80,97,114,97,109,101,116, 101,114,32,115,101,116,116,105,110,103,32,116,104,97,116,32, 103,97,118,101,32,116,104,101,32,98,101,115,116,32,114,101, 115,117,108,116,115,32,111,110,32,116,104,101,32,104,111,108, 100,32,111,117,116,32,100,97,116,97,46,10,10,32,32,32, 32,78,111,116,101,115,10,32,32,32,32,45,45,45,45,45, 10,32,32,32,32,84,104,101,32,112,97,114,97,109,101,116, 101,114,115,32,115,101,108,101,99,116,101,100,32,97,114,101, 32,116,104,111,115,101,32,116,104,97,116,32,109,97,120,105, 109,105,122,101,32,116,104,101,32,115,99,111,114,101,32,111, 102,32,116,104,101,32,104,101,108,100,45,111,117,116,10,32, 32,32,32,100,97,116,97,44,32,97,99,99,111,114,100,105, 110,103,32,116,111,32,116,104,101,32,115,99,111,114,105,110, 103,32,112,97,114,97,109,101,116,101,114,46,10,10,32,32, 32,32,73,102,32,96,110,95,106,111,98,115,96,32,119,97, 115,32,115,101,116,32,116,111,32,97,32,118,97,108,117,101, 32,104,105,103,104,101,114,32,116,104,97,110,32,111,110,101, 44,32,116,104,101,32,100,97,116,97,32,105,115,32,99,111, 112,105,101,100,32,102,111,114,32,101,97,99,104,10,32,32, 32,32,112,97,114,97,109,101,116,101,114,32,115,101,116,116, 105,110,103,40,97,110,100,32,110,111,116,32,96,110,95,106, 111,98,115,96,32,116,105,109,101,115,41,46,32,84,104,105, 115,32,105,115,32,100,111,110,101,32,102,111,114,32,101,102, 102,105,99,105,101,110,99,121,10,32,32,32,32,114,101,97, 115,111,110,115,32,105,102,32,105,110,100,105,118,105,100,117, 97,108,32,106,111,98,115,32,116,97,107,101,32,118,101,114, 121,32,108,105,116,116,108,101,32,116,105,109,101,44,32,98, 117,116,32,109,97,121,32,114,97,105,115,101,32,101,114,114, 111,114,115,32,105,102,10,32,32,32,32,116,104,101,32,100, 97,116,97,115,101,116,32,105,115,32,108,97,114,103,101,32, 97,110,100,32,110,111,116,32,101,110,111,117,103,104,32,109, 101,109,111,114,121,32,105,115,32,97,118,97,105,108,97,98, 108,101,46,32,32,65,32,119,111,114,107,97,114,111,117,110, 100,32,105,110,10,32,32,32,32,116,104,105,115,32,99,97, 115,101,32,105,115,32,116,111,32,115,101,116,32,96,112,114, 101,95,100,105,115,112,97,116,99,104,96,46,32,84,104,101, 110,44,32,116,104,101,32,109,101,109,111,114,121,32,105,115, 32,99,111,112,105,101,100,32,111,110,108,121,10,32,32,32, 32,96,112,114,101,95,100,105,115,112,97,116,99,104,96,32, 109,97,110,121,32,116,105,109,101,115,46,32,65,32,114,101, 97,115,111,110,97,98,108,101,32,118,97,108,117,101,32,102, 111,114,32,96,112,114,101,95,100,105,115,112,97,116,99,104, 96,32,105,115,32,96,50,32,42,10,32,32,32,32,110,95, 106,111,98,115,96,46,10,10,32,32,32,32,83,101,101,32, 65,108,115,111,10,32,32,32,32,45,45,45,45,45,45,45, 45,10,32,32,32,32,58,99,108,97,115,115,58,96,71,114, 105,100,83,101,97,114,99,104,67,86,96,58,10,32,32,32, 32,32,32,32,32,68,111,101,115,32,101,120,104,97,117,115, 116,105,118,101,32,115,101,97,114,99,104,32,111,118,101,114, 32,97,32,103,114,105,100,32,111,102,32,112,97,114,97,109, 101,116,101,114,115,46,10,10,32,32,32,32,58,99,108,97, 115,115,58,96,80,97,114,97,109,101,116,101,114,83,97,109, 112,108,101,114,96,58,10,32,32,32,32,32,32,32,32,65, 32,103,101,110,101,114,97,116,111,114,32,111,118,101,114,32, 112,97,114,97,109,101,116,101,114,32,115,101,116,116,105,110, 115,44,32,99,111,110,115,116,114,117,99,116,101,100,32,102, 114,111,109,10,32,32,32,32,32,32,32,32,112,97,114,97, 109,95,100,105,115,116,114,105,98,117,116,105,111,110,115,46, 10,10,32,32,32,32,105,10,0,0,0,105,1,0,0,0, 105,0,0,0,0,115,8,0,0,0,50,42,110,95,106,111, 98,115,99,13,0,0,0,13,0,0,0,19,0,0,0,67, 0,1,0,115,104,0,0,0,124,2,0,124,0,0,95,0, 0,124,3,0,124,0,0,95,1,0,124,12,0,124,0,0, 95,2,0,116,3,0,116,4,0,124,0,0,131,2,0,106, 5,0,100,1,0,124,1,0,100,2,0,124,4,0,100,3, 0,124,5,0,100,4,0,124,6,0,100,5,0,124,7,0, 100,6,0,124,8,0,100,7,0,124,9,0,100,8,0,124, 10,0,100,9,0,124,11,0,131,0,9,1,100,0,0,83, 40,10,0,0,0,78,82,124,0,0,0,82,123,0,0,0, 82,97,0,0,0,82,126,0,0,0,82,127,0,0,0,82, 128,0,0,0,82,129,0,0,0,82,95,0,0,0,82,130, 0,0,0,40,6,0,0,0,82,56,0,0,0,82,57,0, 0,0,82,58,0,0,0,82,55,0,0,0,82,27,0,0, 0,82,31,0,0,0,40,13,0,0,0,82,30,0,0,0, 82,124,0,0,0,82,56,0,0,0,82,57,0,0,0,82, 123,0,0,0,82,97,0,0,0,82,126,0,0,0,82,127, 0,0,0,82,128,0,0,0,82,129,0,0,0,82,95,0, 0,0,82,130,0,0,0,82,58,0,0,0,40,0,0,0, 0,40,0,0,0,0,115,61,0,0,0,47,117,115,114,47, 108,111,99,97,108,47,108,105,98,47,112,121,116,104,111,110, 50,46,55,47,100,105,115,116,45,112,97,99,107,97,103,101, 115,47,115,107,108,101,97,114,110,47,103,114,105,100,95,115, 101,97,114,99,104,46,112,121,82,31,0,0,0,63,3,0, 0,115,14,0,0,0,0,4,9,1,9,1,9,1,18,1, 18,1,30,1,99,3,0,0,0,4,0,0,0,5,0,0, 0,67,0,1,0,115,49,0,0,0,116,0,0,124,0,0, 106,1,0,124,0,0,106,2,0,100,1,0,124,0,0,106, 3,0,131,2,1,125,3,0,124,0,0,106,4,0,124,1, 0,124,2,0,124,3,0,131,3,0,83,40,2,0,0,0, 115,220,1,0,0,82,117,110,32,102,105,116,32,111,110,32, 116,104,101,32,101,115,116,105,109,97,116,111,114,32,119,105, 116,104,32,114,97,110,100,111,109,108,121,32,100,114,97,119, 110,32,112,97,114,97,109,101,116,101,114,115,46,10,10,32, 32,32,32,32,32,32,32,80,97,114,97,109,101,116,101,114, 115,10,32,32,32,32,32,32,32,32,45,45,45,45,45,45, 45,45,45,45,10,32,32,32,32,32,32,32,32,88,32,58, 32,97,114,114,97,121,45,108,105,107,101,44,32,115,104,97, 112,101,32,61,32,91,110,95,115,97,109,112,108,101,115,44, 32,110,95,102,101,97,116,117,114,101,115,93,10,32,32,32, 32,32,32,32,32,32,32,32,32,84,114,97,105,110,105,110, 103,32,118,101,99,116,111,114,44,32,119,104,101,114,101,32, 110,95,115,97,109,112,108,101,115,32,105,110,32,116,104,101, 32,110,117,109,98,101,114,32,111,102,32,115,97,109,112,108, 101,115,32,97,110,100,10,32,32,32,32,32,32,32,32,32, 32,32,32,110,95,102,101,97,116,117,114,101,115,32,105,115, 32,116,104,101,32,110,117,109,98,101,114,32,111,102,32,102, 101,97,116,117,114,101,115,46,10,10,32,32,32,32,32,32, 32,32,121,32,58,32,97,114,114,97,121,45,108,105,107,101, 44,32,115,104,97,112,101,32,61,32,91,110,95,115,97,109, 112,108,101,115,93,32,111,114,32,91,110,95,115,97,109,112, 108,101,115,44,32,110,95,111,117,116,112,117,116,93,44,32, 111,112,116,105,111,110,97,108,10,32,32,32,32,32,32,32, 32,32,32,32,32,84,97,114,103,101,116,32,114,101,108,97, 116,105,118,101,32,116,111,32,88,32,102,111,114,32,99,108, 97,115,115,105,102,105,99,97,116,105,111,110,32,111,114,32, 114,101,103,114,101,115,115,105,111,110,59,10,32,32,32,32, 32,32,32,32,32,32,32,32,78,111,110,101,32,102,111,114, 32,117,110,115,117,112,101,114,118,105,115,101,100,32,108,101, 97,114,110,105,110,103,46,10,10,32,32,32,32,32,32,32, 32,82,58,0,0,0,40,5,0,0,0,82,26,0,0,0, 82,56,0,0,0,82,57,0,0,0,82,58,0,0,0,82, 168,0,0,0,40,4,0,0,0,82,30,0,0,0,82,88, 0,0,0,82,89,0,0,0,116,14,0,0,0,115,97,109, 112,108,101,100,95,112,97,114,97,109,115,40,0,0,0,0, 40,0,0,0,0,115,61,0,0,0,47,117,115,114,47,108, 111,99,97,108,47,108,105,98,47,112,121,116,104,111,110,50, 46,55,47,100,105,115,116,45,112,97,99,107,97,103,101,115, 47,115,107,108,101,97,114,110,47,103,114,105,100,95,115,101, 97,114,99,104,46,112,121,82,81,0,0,0,75,3,0,0, 115,8,0,0,0,0,14,9,1,9,1,12,1,78,40,7, 0,0,0,82,48,0,0,0,82,49,0,0,0,82,50,0, 0,0,82,66,0,0,0,82,112,0,0,0,82,31,0,0, 0,82,81,0,0,0,40,0,0,0,0,40,0,0,0,0, 40,0,0,0,0,115,61,0,0,0,47,117,115,114,47,108, 111,99,97,108,47,108,105,98,47,112,121,116,104,111,110,50, 46,55,47,100,105,115,116,45,112,97,99,107,97,103,101,115, 47,115,107,108,101,97,114,110,47,103,114,105,100,95,115,101, 97,114,99,104,46,112,121,82,27,0,0,0,198,2,0,0, 115,10,0,0,0,6,119,6,2,6,1,15,1,18,10,40, 3,0,0,0,115,10,0,0,0,112,97,114,97,109,101,116, 101,114,115,115,21,0,0,0,109,101,97,110,95,118,97,108, 105,100,97,116,105,111,110,95,115,99,111,114,101,115,20,0, 0,0,99,118,95,118,97,108,105,100,97,116,105,111,110,95, 115,99,111,114,101,115,40,55,0,0,0,82,50,0,0,0, 116,10,0,0,0,95,95,102,117,116,117,114,101,95,95,82, 0,0,0,0,116,3,0,0,0,97,98,99,82,1,0,0, 0,82,2,0,0,0,116,11,0,0,0,99,111,108,108,101, 99,116,105,111,110,115,82,3,0,0,0,82,4,0,0,0, 82,5,0,0,0,116,9,0,0,0,102,117,110,99,116,111, 111,108,115,82,6,0,0,0,82,7,0,0,0,116,9,0, 0,0,105,116,101,114,116,111,111,108,115,82,8,0,0,0, 82,83,0,0,0,82,44,0,0,0,82,71,0,0,0,82, 52,0,0,0,116,5,0,0,0,110,117,109,112,121,82,79, 0,0,0,116,4,0,0,0,98,97,115,101,82,9,0,0, 0,82,10,0,0,0,82,11,0,0,0,82,12,0,0,0, 116,16,0,0,0,99,114,111,115,115,95,118,97,108,105,100, 97,116,105,111,110,82,13,0,0,0,116,16,0,0,0,101, 120,116,101,114,110,97,108,115,46,106,111,98,108,105,98,82, 14,0,0,0,82,15,0,0,0,82,16,0,0,0,116,9, 0,0,0,101,120,116,101,114,110,97,108,115,82,17,0,0, 0,116,5,0,0,0,117,116,105,108,115,82,18,0,0,0, 82,19,0,0,0,116,16,0,0,0,117,116,105,108,115,46, 118,97,108,105,100,97,116,105,111,110,82,20,0,0,0,82, 21,0,0,0,116,14,0,0,0,109,101,116,114,105,99,115, 46,115,99,111,114,101,114,82,22,0,0,0,116,7,0,0, 0,95,95,97,108,108,95,95,116,6,0,0,0,111,98,106, 101,99,116,82,24,0,0,0,82,51,0,0,0,82,26,0, 0,0,82,66,0,0,0,82,25,0,0,0,82,114,0,0, 0,82,115,0,0,0,116,14,0,0,0,119,105,116,104,95, 109,101,116,97,99,108,97,115,115,82,122,0,0,0,82,23, 0,0,0,82,27,0,0,0,40,0,0,0,0,40,0,0, 0,0,40,0,0,0,0,115,61,0,0,0,47,117,115,114, 47,108,111,99,97,108,47,108,105,98,47,112,121,116,104,111, 110,50,46,55,47,100,105,115,116,45,112,97,99,107,97,103, 101,115,47,115,107,108,101,97,114,110,47,103,114,105,100,95, 115,101,97,114,99,104,46,112,121,116,8,0,0,0,60,109, 111,100,117,108,101,62,4,0,0,0,115,66,0,0,0,6, 1,16,8,22,1,28,1,22,1,16,1,12,1,12,1,12, 1,12,2,12,2,28,1,16,1,16,1,28,1,16,1,22, 1,22,1,16,3,9,1,12,3,22,75,22,39,22,74,12, 107,9,18,9,1,0,1,0,1,22,19,15,1,22,172,22, 164, };
189ec3eaf9fdda57b26d4786db114ed5a04b6152
4bba4ba2b09da8c3d7affeb9738d5cd89a24e8be
/src/network/cxgb4/ocqp.c
37a931d126f6309147675e1e588c65e325c1c2d1
[]
no_license
janekmi/ChelsioUwire
617b24f664904f4d1fde83ab9d671c57e90bf8af
6c1bd8d4760d4c53f9acdc4d8d05c3453282c3ac
refs/heads/master
2021-01-17T18:33:49.449809
2016-10-21T10:43:24
2016-10-21T10:48:29
71,464,881
4
0
null
null
null
null
UTF-8
C
false
false
1,350
c
ocqp.c
#include <linux/spinlock.h> /* required by genalloc */ #ifdef GEN_ALLOC #include <linux/genalloc.h> #else #include "cxgb4_genalloc.h" #endif #include <linux/module.h> #include "ocqp.h" #define MIN_OCQP_SHIFT 12 /* 4KB == min ocqp size */ u32 cxgb4_ocqp_pool_alloc(struct net_device *dev, int size) { unsigned long addr = 0; struct adapter *adap = netdev2adap(dev); if (adap->ocqp_pool) addr = gen_pool_alloc(adap->ocqp_pool, size); return (u32)addr; } EXPORT_SYMBOL(cxgb4_ocqp_pool_alloc); int ocqp_pool_create(struct adapter *adap) { unsigned start, chunk, top; adap->ocqp_pool = gen_pool_create(MIN_OCQP_SHIFT, -1); if (!adap->ocqp_pool) return -ENOMEM; start = adap->vres.ocq.start; chunk = adap->vres.ocq.size; top = start + chunk; while (start < top) { chunk = min(top - start + 1, chunk); if (gen_pool_add(adap->ocqp_pool, start, chunk, -1)) { if (chunk <= 1024 << MIN_OCQP_SHIFT) { return 0; } chunk >>= 1; } else { start += chunk; } } return 0; } void ocqp_pool_destroy(struct adapter *adap) { if (adap->ocqp_pool) gen_pool_destroy(adap->ocqp_pool); } void cxgb4_ocqp_pool_free(struct net_device *dev, u32 addr, int size) { struct adapter *adap = netdev2adap(dev); if (adap->ocqp_pool) gen_pool_free(adap->ocqp_pool, (unsigned long)addr, size); } EXPORT_SYMBOL(cxgb4_ocqp_pool_free);
fbadcdb115ebe6988b6ad1cf707aa6ab17f79bd3
a60df86a3e0fdf28c9768b23464872e865101a05
/clswitch.c
58d29e103ad9c15b0c9ae7f219d16fad0c83ac81
[ "BSD-2-Clause" ]
permissive
asimba/clswitch
57e71eaed49f0dbf393dff06b3b94d152e4ba5f5
998556be06752bd86464f8e02be6188010fa8ee5
refs/heads/master
2020-04-05T03:22:15.028814
2018-11-08T11:06:21
2018-11-08T11:06:21
156,511,662
3
0
null
null
null
null
UTF-8
C
false
false
1,687
c
clswitch.c
#include <windows.h> HHOOK hook; LRESULT CALLBACK keyboardHook(int nCode, WPARAM wParam, LPARAM lParam) { KBDLLHOOKSTRUCT *p = (KBDLLHOOKSTRUCT *)lParam; WORD keyCode = (WORD)p->vkCode; if ((keyCode == VK_CAPITAL) && !(p->flags&LLKHF_INJECTED) && nCode >= 0) { if (GetKeyState(VK_CONTROL) & 0x8000) goto call_next; if (wParam == WM_KEYUP) PostMessage(GetForegroundWindow(), WM_INPUTLANGCHANGEREQUEST, 2, 0); return 1; }; call_next: return CallNextHookEx(hook, nCode, wParam, lParam); } LRESULT CALLBACK WndProc(HWND ihwnd, UINT umsg, WPARAM wParam, LPARAM lParam) { if ((umsg == WM_CLOSE) || (umsg == WM_DESTROY) || (umsg == WM_ENDSESSION)) { PostQuitMessage(0); return 0; } else return DefWindowProc(ihwnd, umsg, wParam, lParam); } extern "C" void startup(void) { HINSTANCE hInstance=GetModuleHandle(NULL); SetProcessWorkingSetSize(GetCurrentProcess(), (SIZE_T) -1, (SIZE_T) -1); HWND hwnd; WNDCLASS wc = {}; LPCSTR cl_name = (LPCSTR)"capsfinder"; SetLastError(0); HANDLE iMutex = CreateMutex(NULL, TRUE, cl_name); if (iMutex) { if (GetLastError() == ERROR_ALREADY_EXISTS) goto return_point_0; } else goto return_point_0; wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.lpszClassName = cl_name; if (!RegisterClass(&wc)) goto return_point_1; hwnd = CreateWindow(cl_name, NULL, 0, 0, 0, 0, 0, 0, 0, hInstance, 0); if (!hwnd) goto return_point_2; hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboardHook, NULL, 0); if (hook) { MSG msg; while (GetMessage(&msg, NULL, 0, 0) > 0) DispatchMessage(&msg); }; return_point_2: UnregisterClass(cl_name, hInstance); return_point_1: CloseHandle(iMutex); return_point_0: ExitProcess(0); }
fc9d34c1d6818b4a71213ef0788afe7f7af7b2e8
09fb9e9292d1a9a636120ed7a2efa6fe70a9d2de
/apps/system/conman/conman_util.c
ce279c28733279c2493916236604e5b4ad67135f
[ "BSD-3-Clause", "MIT", "BSD-2-Clause" ]
permissive
jkivilin/thingsee-sdk
dfea2e196d07828aeaa9d858b45fb538430a1e52
b85e1911936e086583e69d6d253a132ad93d2d9a
refs/heads/master
2020-04-05T14:44:43.610545
2015-09-29T17:07:15
2015-09-29T17:07:15
41,488,099
1
0
null
2015-08-27T13:26:30
2015-08-27T13:26:30
null
UTF-8
C
false
false
7,996
c
conman_util.c
/**************************************************************************** * apps/system/conman/conman_util.c * * Copyright (C) 2015 Haltian Ltd. All rights reserved. * Author: Pekka Ervasti <pekka.ervasti@haltian.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <stdio.h> #include <unistd.h> #include <poll.h> #include <errno.h> #include <conman_dbg.h> #include "conman_internal.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** * Type Declarations ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: __conman_util_block_read * * Description: * Reads from the file desciptor making sure all requested data is received. * * Input Parameters: * fd : file descriptor to read from * buffer : buffer to read the data to * len : number of bytes to read * * Returned Value: * OK if success. * ERROR if failed. * ****************************************************************************/ int __conman_util_block_read(int fd, void *buffer, size_t len) { int toread; int ret; char *buf; buf = (char *)buffer; toread = len; do { ret = recv(fd, buf + len - toread, toread, 0); if (ret < 0) { conman_dbg("recv failed %d\n", errno); return ERROR; } toread -= ret; } while (toread > 0); return OK; } /**************************************************************************** * Name: __conman_util_block_write * * Description: * Writes to the file desciptor making sure all requested data is written. * * Input Parameters: * fd : file descriptor to write to * buffer : buffer to read the data from * len : number of bytes to write * * Returned Value: * OK if success. * ERROR if failed. * ****************************************************************************/ int __conman_util_block_write(int fd, const void * const buffer, size_t len) { int towrite; int ret; char *buf; if (len == 0) { return OK; } buf = (char *)buffer; towrite = len; do { ret = send(fd, buf + len - towrite, towrite, 0); if (ret < 0) { conman_dbg("send failed %d\n", errno); return ERROR; } towrite -= ret; } while (towrite > 0); return OK; } /**************************************************************************** * Name: __conman_send_resp * * Description: * Sends a reply to the client by writing it to the out fifo. * * Input Parameters: * conman : connection manager handle * id : message id * respval : response value * * Returned Value: * OK : no errors * ERROR : failure * ****************************************************************************/ int __conman_send_resp(struct conman_s *conman, uint8_t id, enum conman_resp_value respval, void *data, size_t datalen) { struct conman_resp_hdr hdr; int ret; hdr.head.id = id; hdr.head.len = datalen; hdr.respval = respval; ret = __conman_util_block_write(conman->servingsd, &hdr, sizeof(hdr)); if (ret < 0) { return ERROR; } ret = __conman_util_block_write(conman->servingsd, data, hdr.head.len); if (ret < 0) { return ERROR; } return OK; } /**************************************************************************** * Name: __conman_send_boardcast_event * * Description: * Send boardcast event to all open client sockets that have events enabled. * * Input Parameters: * conman : connection manager handle * type : event type * ****************************************************************************/ void __conman_send_boardcast_event(struct conman_s *conman, enum conman_msgs_ids type, const void *payload, size_t payloadlen) { struct conman_sd_entry_s *client; struct conman_resp_hdr hdr = {}; int send_count = 0; int ret; hdr.head.id = type; hdr.head.len = payloadlen; hdr.respval = CONMAN_RESP_EVENT; for (client = (struct conman_sd_entry_s *)sq_peek(&conman->server.sds); client != NULL; client = (struct conman_sd_entry_s *)sq_next(&client->entry)) { if (!client->events_enabled) { continue; } ret = __conman_util_block_write(client->sd, &hdr, sizeof(hdr)); if (ret < 0) { continue; } ret = __conman_util_block_write(client->sd, payload, hdr.head.len); if (ret < 0) { continue; } send_count++; } conman_dbg("send boardcast event (type=%d) to %d clients.\n", type, send_count); } /**************************************************************************** * Name: __conman_flushfd * * Description: * Flushes the file descriptor by reading it empty. * * Input Parameters: * fd : file descriptor * ****************************************************************************/ void __conman_flushfd(int fd) { int ret; char tmp; do { struct pollfd pfd; pfd.fd = fd; pfd.events = POLLIN; ret = poll(&pfd, 1, 0); if (ret == 1 && (pfd.revents & POLLIN)) { ret = recv(fd, &tmp, 1, 0); } else { break; } } while (true); }
3b1efb6c529d602e42a7dc452c6d30a7fcea8d8a
7822b2aefe86ba88d994e7f0a3bdc936a0a43bff
/longest-substring/longest-substring.c
0f383c64b812392c7c0edf32d77ad6c932c2cc38
[]
no_license
mpalomera/training
6def3b58dba267d74971923b06c0ac2215754d54
ea640a5a6939566246719ca7deed1a81b2ae92bb
refs/heads/master
2021-01-23T15:52:33.828494
2017-09-23T19:15:46
2017-09-23T19:15:46
93,274,674
0
0
null
null
null
null
UTF-8
C
false
false
1,424
c
longest-substring.c
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "longest-substring.h" char *longestSubstring(char *s) { int size = strlen(s), currentChar = 0, initialPosition = 0, i = 0; char longestString[size]; char temporalString[size]; char usedLetters[255]; longestString[0] = '\0'; memset(usedLetters, 0, sizeof(usedLetters)); for (initialPosition = 0; initialPosition < size; initialPosition++) { currentChar = initialPosition; i = 0; while (s[currentChar++]) { if (usedLetters[s[currentChar]] == 0) { usedLetters[s[currentChar]] = 1; temporalString[i++] = s[currentChar]; } else { temporalString[i++] = '\0'; if (strlen(temporalString) >= strlen(longestString)) { strcpy(longestString, temporalString); } temporalString[0] = '\0'; memset(usedLetters, 0, sizeof(usedLetters)); break; } } //If longest string reach the end of the original string no need to keep searching //it is the longest if (currentChar >= size) { break; } } return strdup(longestString); } int lengthOfLongestSubstring(char *s) { return strlen(longestSubstring(s)); }
ad416f6bf08b5f555cd3e98986e71e3b8c1740d7
23e393f8c385a4e0f8f3d4b9e2d80f98657f4e1f
/Win32 Programming/Win32API/Pizza/dlgtemplate.c
239d6539592c5704c7cb26cd77f23c4c100a1c34
[]
no_license
IgorYunusov/Mega-collection-cpp-1
c7c09e3c76395bcbf95a304db6462a315db921ba
42d07f16a379a8093b6ddc15675bf777eb10d480
refs/heads/master
2020-03-24T10:20:15.783034
2018-06-12T13:19:05
2018-06-12T13:19:05
142,653,486
3
1
null
2018-07-28T06:36:35
2018-07-28T06:36:35
null
UTF-8
C
false
false
17,926
c
dlgtemplate.c
#define STRICT #include <windows.h> // Fundamental Windows header file #include <windowsx.h> // Useful Windows programming extensions #include <commctrl.h> // Common Controls declarations //#include <string.h> //#include <wchar.h> #include "Extensions.h" // WINDOWSX.H extensions #include "Utility.h" // Application-independent // debugging and utility functions #include "dlgtemplate.h" /***************************************************************************** appendString *****************************************************************************/ __inline LPWORD appendString(LPWORD ptr, LPCWSTR text) { LPWSTR str = (LPWSTR)ptr; wcscpy(str, text); ptr = (LPWORD)(str + wcslen(str) + 1); return ptr; } /***************************************************************************** setClassAtom *****************************************************************************/ __inline LPWORD setClassAtom(LPDLGITEMTEMPLATE item, WORD classatom) { LPWORD ptr = (LPWORD)&item[1]; *ptr++ = 0xFFFF; *ptr++ = classatom; return ptr; } /***************************************************************************** SetClassName *****************************************************************************/ __inline LPWORD SetClassName(LPDLGITEMTEMPLATE item, LPCWSTR classname) { LPWORD ptr = (LPWORD)&item[1]; ptr = appendString(ptr, classname); return ptr; } /***************************************************************************** setResourceID *****************************************************************************/ __inline LPWORD setResourceID(LPWORD ptr, short id) { *ptr++ = 0xFFFF; *ptr++ = (WORD)id; return ptr; } /***************************************************************************** noParms *****************************************************************************/ __inline LPWORD noParms(LPDLGITEMTEMPLATE item, LPWORD ptr) { *ptr++ = 0; // no parameters if( (((LPWORD)item) - ptr) & 1) *ptr++ = 0; return ptr; } /***************************************************************************** setItemPos *****************************************************************************/ __inline void setItemPos(LPDLGITEMTEMPLATE item, int x, int y, int cx, int cy) { item->x = x; item->y = y; item->cx = cx; item->cy = cy; } /***************************************************************************** AUTO3STATE *****************************************************************************/ LPDLGITEMTEMPLATE AUTO3STATE(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_AUTO3STATE, x, y, cx, cy, exstyle); } /***************************************************************************** AUTOCHECKBOX *****************************************************************************/ LPDLGITEMTEMPLATE AUTOCHECKBOX(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_AUTOCHECKBOX, x, y, cx, cy, exstyle); } /***************************************************************************** AUTORADIOBUTTON *****************************************************************************/ LPDLGITEMTEMPLATE AUTORADIOBUTTON(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_AUTORADIOBUTTON, x, y, cx, cy, exstyle); } /***************************************************************************** CHECKBOX *****************************************************************************/ LPDLGITEMTEMPLATE CHECKBOX(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_CHECKBOX, x, y, cx, cy, exstyle); } /***************************************************************************** COMBOBOX *****************************************************************************/ LPDLGITEMTEMPLATE COMBOBOX(LPDLGITEMTEMPLATE item, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, L"", id, MAKEINTRESOURCEW(0x0085), style, x, y, cx, cy, exstyle); } /***************************************************************************** CONTROL *****************************************************************************/ LPDLGITEMTEMPLATE CONTROL(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, LPCWSTR classname, DWORD style, int x, int y, int cx, int cy, DWORD exstyle) { LPWORD ptr = (LPWORD) &item[1]; item->style = WS_CHILD | style; item->dwExtendedStyle = exstyle; setItemPos(item, x, y, cx, cy); item->id = (WORD)id; if(HIWORD(classname) != 0) ptr = SetClassName(item, classname); else ptr = setResourceID(ptr, LOWORD(classname)); // MAKEINTRESOURCEW(class) if(text == 0) ptr = appendString(ptr, L""); else if(HIWORD(text) != 0) ptr = appendString(ptr, text); else ptr = setResourceID(ptr, LOWORD(text)); // MAKEINTRESOURCEW(id) ptr = noParms(item, ptr); return (LPDLGITEMTEMPLATE)ptr; } /***************************************************************************** CTEXT *****************************************************************************/ LPDLGITEMTEMPLATE CTEXT(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0082), SS_CENTER | style, x, y, cx, cy, exstyle); } /***************************************************************************** DEFPUSHBUTTON *****************************************************************************/ LPDLGITEMTEMPLATE DEFPUSHBUTTON(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_DEFPUSHBUTTON, x, y, cx, cy, exstyle); } /***************************************************************************** EDITTEXT *****************************************************************************/ LPDLGITEMTEMPLATE EDITTEXT(LPDLGITEMTEMPLATE item, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, L"", id, MAKEINTRESOURCEW(0x0081), style, x, y, cx, cy, exstyle); } /***************************************************************************** GROUPBOX *****************************************************************************/ LPDLGITEMTEMPLATE GROUPBOX(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_GROUPBOX, x, y, cx, cy, exstyle); } /***************************************************************************** ICON *****************************************************************************/ LPDLGITEMTEMPLATE ICON(LPDLGITEMTEMPLATE item, LPCWSTR icon, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, icon, id, MAKEINTRESOURCEW(0x0082), SS_ICON | style, x, y, cx, cy, exstyle); } /***************************************************************************** LTEXT *****************************************************************************/ LPDLGITEMTEMPLATE LTEXT(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0082), SS_LEFT | style, x, y, cx, cy, exstyle); } /***************************************************************************** LISTBOX *****************************************************************************/ LPDLGITEMTEMPLATE LISTBOX(LPDLGITEMTEMPLATE item, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, L"", id, MAKEINTRESOURCEW(0x0083), style, x, y, cx, cy, exstyle); } /***************************************************************************** PUSHBUTTON *****************************************************************************/ LPDLGITEMTEMPLATE PUSHBUTTON(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_PUSHBUTTON, x, y, cx, cy, exstyle); } /***************************************************************************** PUSHBOX *****************************************************************************/ LPDLGITEMTEMPLATE PUSHBOX(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_PUSHLIKE, x, y, cx, cy, exstyle); } /***************************************************************************** RADIOBUTTON *****************************************************************************/ LPDLGITEMTEMPLATE RADIOBUTTON(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_RADIOBUTTON, x, y, cx, cy, exstyle); } /***************************************************************************** RTEXT *****************************************************************************/ LPDLGITEMTEMPLATE RTEXT(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0082), SS_RIGHT | style, x, y, cx, cy, exstyle); } /***************************************************************************** SCROLLBAR *****************************************************************************/ LPDLGITEMTEMPLATE SCROLLBAR(LPDLGITEMTEMPLATE item, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, L"", id, MAKEINTRESOURCEW(0x0084), style, x, y, cx, cy, exstyle); } /***************************************************************************** STATE3 *****************************************************************************/ LPDLGITEMTEMPLATE STATE3(LPDLGITEMTEMPLATE item, LPCWSTR text, short id, int x, int y, int cx, int cy, DWORD style, DWORD exstyle) { return CONTROL(item, text, id, MAKEINTRESOURCEW(0x0080), style | BS_3STATE, x, y, cx, cy, exstyle); } /**************************************************************************** * DIALOG * Inputs: * LPDLGITEMTEMPLATE * item: On successful return, will be a pointer * to the first place a DLGITEMTEMPLATE can be set * UINT size: Buffer size to allocate. If 0, a default value of * 4096 is used. * int x: Origin of top left corner * int y: Origin of top left corner * int cx: Width in dialog units * int cy: Height in dialog units * DWORD style: Style bits * DWORD exstyle: Extended style bits * LPCWSTR menu: NULL if no menu * MAKEINTRESOURCEW(menuid) if by resource id * L"menuname" for string menu * LPCWSTR class: NULL if no class (default dialog box class) * MAKEINTRESOURCEW(atom) if atom of class given * L"classname" if class name of class given * LPCWSTR caption:NULL if no caption * L"caption" if present * LPCWSTR font: NULL if no font given (DS_SETFONT will be removed * from styles) * L"font" if font specified (DS_SETFONT will be added) * int height: Font height in points (ignored if font is NULL) * Result: LPDLGTEMPLATE * A dialog template, or NULL if an error occurred * Effect: * Allocates and initializes a DLGTEMPLATE structure * Notes: * The caller must call free() to release the template * The cdit field will be set to 0; it is the caller's responsibility * to increment this field each time a control is added ****************************************************************************/ #define DLGTEMPLATE_WORKING_SIZE 4096 LPDLGTEMPLATE DIALOG(LPDLGITEMTEMPLATE * item, UINT size, int x, int y, int cx, int cy, DWORD style, DWORD exstyle, LPCWSTR menu, LPCWSTR class, LPCWSTR caption, LPCWSTR font, int height) { LPDLGTEMPLATE dlg; LPWORD ptr; if(size == 0) size = DLGTEMPLATE_WORKING_SIZE; dlg = (LPDLGTEMPLATE) malloc(size); if(dlg == NULL) return NULL; dlg->x = x; dlg->y = y; dlg->cx = cx; dlg->cy = cy; dlg->cdit = 0; // no dialog items yet dlg->style = style; if(font == NULL) dlg->style &= ~DS_SETFONT; else dlg->style |= DS_SETFONT; dlg->dwExtendedStyle = exstyle; dlg->cdit = 0; ptr = (LPWORD) &dlg[1]; if(menu == NULL) *ptr++ = 0; // no menu else if(HIWORD(menu) == 0) ptr = setResourceID(ptr, LOWORD(menu)); // MAKEINTRESOURCEW else ptr = appendString(ptr, menu); if(class == NULL) *ptr++ = 0; else if(HIWORD(class) == 0) ptr = setResourceID(ptr, LOWORD(class)); // MAKEINTRESOURCEW else ptr = appendString(ptr, class); ptr = appendString(ptr, (caption == NULL ? L"" : caption)); if(font != NULL) { /* has font */ *ptr++ = height; ptr = appendString(ptr, font); } /* has font */ if(item != NULL) *item = (LPDLGITEMTEMPLATE) ptr; return (LPDLGTEMPLATE)dlg; }
fbf6326320c653cf2b1df08dc3536d2ea4899dd4
ece46d54db148fcd1717ae33e9c277e156067155
/SDK/zrxsdk2021/utils/brep/arxport/brvetrav.h
8f7548e7ecf0bb5e5f6179f1ff52d7202139fcd7
[]
no_license
15831944/ObjectArx
ffb3675875681b1478930aeac596cff6f4187ffd
8c15611148264593730ff5b6213214cebd647d23
refs/heads/main
2023-06-16T07:36:01.588122
2021-07-09T10:17:27
2021-07-09T10:17:27
384,473,453
0
1
null
2021-07-09T15:08:56
2021-07-09T15:08:56
null
UTF-8
C
false
false
643
h
brvetrav.h
#ifndef ZRX_SDK_BRVETRAV_H #define ZRX_SDK_BRVETRAV_H 1 #include "adesk.h" #include "rxobject.h" #include "rxboiler.h" #include "brgbl.h" #include "brtrav.h" #include "../inc/zcbrvetrav.h" #ifndef AcBrEdge #define AcBrEdge ZcBrEdge #endif //#ifndef AcBrEdge #ifndef AcBrVertex #define AcBrVertex ZcBrVertex #endif //#ifndef AcBrVertex #ifndef AcBrVertexEdgeTraverser #define AcBrVertexEdgeTraverser ZcBrVertexEdgeTraverser #endif //#ifndef AcBrVertexEdgeTraverser #ifndef AcBrTraverser #define AcBrTraverser ZcBrTraverser #endif //#ifndef AcBrTraverser #ifndef AcBr #define AcBr ZcBr #endif //#ifndef AcBr #endif
63d3ce3a115ca9b63a3aa5be1bdb76c8295d628b
2ba6a8e325dde9ba531303ed9a533081c9df5ea4
/BlitzPrakt02-3/main.c
f090cb4a4d02293366d1fe0bacae532e0660cd22
[]
no_license
Mathasyu/codingground
fe1477468ad08787d2c19d97ad262cda20887f2f
2b538108cc9f4de79453aa3ae283f7a6c231f073
refs/heads/master
2016-08-12T17:17:27.769320
2015-12-02T14:07:48
2015-12-02T14:07:48
45,005,776
0
0
null
null
null
null
UTF-8
C
false
false
1,861
c
main.c
#include <stdio.h> int checkZahl(float n) { int rueckgabewert = 2; if ((n < 1) && (n > 0)) { rueckgabewert = 1; } return rueckgabewert; } int forSchleife(float n, int m){ printf("For Schleife: \n"); printf("0."); for (m=m;m>0; m--) { n= n * 2; if(n>=1) { printf("1"); n= n - 1; } else { printf("0");} } printf(" \n\n"); return 0; } int whileSchleife(float n, int m){ printf("While Schleife: \n"); printf("0."); while(m > 0) { m--; n= n * 2; if(n>=1) { printf("1"); n= n - 1; } else { printf("0");} } printf("\n\n"); } int doWhileSchleife(float n, int m){ printf("DO WHILE Schleife: \n"); printf("0."); do{ m--; n= n * 2; if(n>=1) { printf("1"); n= n - 1; } else { printf("0");} } while(m > 0); printf("\n\n"); } int main(void) { int pruefen; float n1; int m1; printf("Kommazahl zwischen 0 und 1 eingeben \n"); scanf("%fl", &n1); printf("Nachkommastellen eingeben \n"); scanf("%d", &m1); pruefen = checkZahl(n1); if ( pruefen == 1) { printf("\nErgebnis: \n"); forSchleife(n1,m1); whileSchleife(n1,m1); doWhileSchleife(n1,m1); } else { printf("Sie haben eine ungültige Zahl angegeben\n"); } getchar(); getchar(); return 0; }
652f030bd422361882810daf4ee0ed79a1837e16
329291ecc4b436bba988b16b4a69494e2558c2f3
/GS_IMPOR.H
17fb049f1a26ba871ce6b5e70e68cf096fdeddb7
[]
no_license
geosim/geoarx2015
7184eb79299a42ae72819552ffa85be1586f71c9
93f82f457dde5080841f7f7725617a2c94201fc1
refs/heads/master
2020-04-26T16:51:05.304804
2019-03-04T09:15:48
2019-03-04T09:15:48
173,694,066
0
1
null
null
null
null
UTF-8
C
false
false
1,372
h
GS_IMPOR.H
#ifndef _gs_import_h #define _gs_import_h 1 DllExport int gsc_load_Princ_and_DABlk(C_SELSET &ssAll, ads_name ent, C_STRING &lpnName, C_SELSET &SS_Princ, C_SELSET &SS_BlockDA, C_CLASS **pCObj, CAseLinkSel *pLS = NULL); DllExport int gsc_RemoveInvalidObject(C_SELSET &ss, C_CLASS *pCls, int loadGEOsimObj); DllExport int RbToRbOnlyFieldCompatible(C_CLASS *pCls, C_RB_LIST &RbInput, C_RB_LIST &RbOut); DllExport int RbToRbOnlyFieldCompatible(C_SECONDARY *pSec, C_RB_LIST &RbInput, C_RB_LIST &RbOut); int gs_getLPNstatusFromMemory(void); int gs_setLPNstatusOnMemory(void); int gsc_importFromFile(C_CLASS *pCls, C_STRING &fileName, C_DBCONNECTION *pConn = NULL, C_STRING *pTable = NULL, C_STRING *pKeyAttr = NULL); int gsc_importFromGraph(ads_name SelSet, C_CLASS *pCls, int ObjGEOsimLoad, long BitForChangeToNewFAS, C_FAS *pNewFas = NULL, C_STR_LIST *pLPNList = NULL, int RemoveLPN = GS_BAD, C_STR_LIST *pODTableList = NULL, int RemoveODData = GS_BAD, bool ReadAttrBlk = false); int gs_tDA(); extern C_2STR_INT_LIST LPN_USER_STATUS; #endif
b413c05a1e886a1d2a0c0aeaa75a86f1e339277a
21a4b5fd560169eda0ef2da9b9670dcdbe2bb0b6
/c_code/7_1/passaux.c
060612b9c2afdcfeaf343a79ef5f372101e1a91c
[]
no_license
sriramnrn/csources
694b389f2456742ccefa88ce250f74a5f0347b8c
5938a27a43f4bf3ad920f9725f3e8aa3d324b4a1
refs/heads/devel
2021-01-22T15:01:26.212148
2015-01-24T14:32:09
2015-01-24T14:32:09
29,775,787
0
0
null
2015-01-24T12:27:27
2015-01-24T12:27:26
null
UTF-8
C
false
false
11,025
c
passaux.c
/* Generated by Nim Compiler v0.10.0 */ /* (c) 2014 Andreas Rumpf */ /* The generated code is subject to the original license. */ #define NIM_INTBITS 32 #include "nimbase.h" typedef struct tpasscontext284005 tpasscontext284005; typedef struct tsym223849 tsym223849; typedef struct NimStringDesc NimStringDesc; typedef struct TGenericSeq TGenericSeq; typedef struct tidobj199015 tidobj199015; typedef struct TNimObject TNimObject; typedef struct TNimType TNimType; typedef struct TNimNode TNimNode; typedef struct ttypeseq223851 ttypeseq223851; typedef struct ttype223855 ttype223855; typedef struct tscope223843 tscope223843; typedef struct TY223950 TY223950; typedef struct tinstantiation223839 tinstantiation223839; typedef struct tstrtable223823 tstrtable223823; typedef struct tsymseq223821 tsymseq223821; typedef struct tident199021 tident199021; typedef struct tlineinfo194539 tlineinfo194539; typedef struct tnode223819 tnode223819; typedef struct tloc223833 tloc223833; typedef struct trope176009 trope176009; typedef struct tlib223837 tlib223837; typedef struct tnodeseq223813 tnodeseq223813; typedef struct tcell44735 tcell44735; typedef struct tcellseq44751 tcellseq44751; typedef struct tgcheap46816 tgcheap46816; typedef struct tcellset44747 tcellset44747; typedef struct tpagedesc44743 tpagedesc44743; typedef struct tmemregion27010 tmemregion27010; typedef struct tsmallchunk26240 tsmallchunk26240; typedef struct tllchunk27004 tllchunk27004; typedef struct tbigchunk26242 tbigchunk26242; typedef struct tintset26217 tintset26217; typedef struct ttrunk26213 ttrunk26213; typedef struct tavlnode27008 tavlnode27008; typedef struct tgcstat46814 tgcstat46814; typedef struct TY223939 TY223939; typedef struct tlistentry126022 tlistentry126022; typedef struct tbasechunk26238 tbasechunk26238; typedef struct tfreecell26230 tfreecell26230; struct TGenericSeq { NI len; NI reserved; }; struct NimStringDesc { TGenericSeq Sup; NIM_CHAR data[SEQ_DECL_SIZE]; }; typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op); typedef N_NIMCALL_PTR(void*, TY3094) (void* p); struct TNimType { NI size; NU8 kind; NU8 flags; TNimType* base; TNimNode* node; void* finalizer; TY3089 marker; TY3094 deepcopy; }; struct TNimObject { TNimType* m_type; }; struct tidobj199015 { TNimObject Sup; NI Id; }; struct tstrtable223823 { NI Counter; tsymseq223821* Data; }; struct tlineinfo194539 { NI16 Line; NI16 Col; NI32 Fileindex; }; struct tloc223833 { NU8 K; NU8 S; NU8 Flags; ttype223855* T; trope176009* R; trope176009* Heaproot; }; struct tsym223849 { tidobj199015 Sup; NU8 Kind; union { struct {ttypeseq223851* Typeinstcache; tscope223843* Typscope; } S1; struct {TY223950* Procinstcache; tscope223843* Scope; } S2; struct {TY223950* Usedgenerics; tstrtable223823 Tab; } S3; struct {tsym223849* Guard; } S4; } kindU; NU16 Magic; ttype223855* Typ; tident199021* Name; tlineinfo194539 Info; tsym223849* Owner; NU32 Flags; tnode223819* Ast; NU32 Options; NI Position; NI Offset; tloc223833 Loc; tlib223837* Annex; tnode223819* Constraint; }; struct tident199021 { tidobj199015 Sup; NimStringDesc* S; tident199021* Next; NI H; }; struct tnode223819 { ttype223855* Typ; tlineinfo194539 Info; NU16 Flags; NU8 Kind; union { struct {NI64 Intval; } S1; struct {NF Floatval; } S2; struct {NimStringDesc* Strval; } S3; struct {tsym223849* Sym; } S4; struct {tident199021* Ident; } S5; struct {tnodeseq223813* Sons; } S6; } kindU; NimStringDesc* Comment; }; struct tcell44735 { NI Refcount; TNimType* Typ; }; struct tcellseq44751 { NI Len; NI Cap; tcell44735** D; }; struct tcellset44747 { NI Counter; NI Max; tpagedesc44743* Head; tpagedesc44743** Data; }; typedef tsmallchunk26240* TY27022[512]; typedef ttrunk26213* ttrunkbuckets26215[256]; struct tintset26217 { ttrunkbuckets26215 Data; }; struct tmemregion27010 { NI Minlargeobj; NI Maxlargeobj; TY27022 Freesmallchunks; tllchunk27004* Llmem; NI Currmem; NI Maxmem; NI Freemem; NI Lastsize; tbigchunk26242* Freechunkslist; tintset26217 Chunkstarts; tavlnode27008* Root; tavlnode27008* Deleted; tavlnode27008* Last; tavlnode27008* Freeavlnodes; }; struct tgcstat46814 { NI Stackscans; NI Cyclecollections; NI Maxthreshold; NI Maxstacksize; NI Maxstackcells; NI Cycletablesize; NI64 Maxpause; }; struct tgcheap46816 { void* Stackbottom; NI Cyclethreshold; tcellseq44751 Zct; tcellseq44751 Decstack; tcellset44747 Cycleroots; tcellseq44751 Tempstack; NI Recgclock; tmemregion27010 Region; tgcstat46814 Stat; }; struct tpasscontext284005 { TNimObject Sup; NIM_BOOL Fromcache; }; struct TNimNode { NU8 kind; NI offset; TNimType* typ; NCSTRING name; NI len; TNimNode** sons; }; struct ttype223855 { tidobj199015 Sup; NU8 Kind; NU8 Callconv; NU32 Flags; ttypeseq223851* Sons; tnode223819* N; tsym223849* Owner; tsym223849* Sym; tsym223849* Destructor; tsym223849* Deepcopy; NI64 Size; NI16 Align; NI16 Locklevel; tloc223833 Loc; }; struct tscope223843 { NI Depthlevel; tstrtable223823 Symbols; tnodeseq223813* Usingsyms; tscope223843* Parent; }; struct tinstantiation223839 { tsym223849* Sym; ttypeseq223851* Concretetypes; TY223939* Usedby; }; struct trope176009 { TNimObject Sup; trope176009* Left; trope176009* Right; NI Length; NimStringDesc* Data; }; struct tlistentry126022 { TNimObject Sup; tlistentry126022* Prev; tlistentry126022* Next; }; struct tlib223837 { tlistentry126022 Sup; NU8 Kind; NIM_BOOL Generated; NIM_BOOL Isoverriden; trope176009* Name; tnode223819* Path; }; typedef NI TY26220[16]; struct tpagedesc44743 { tpagedesc44743* Next; NI Key; TY26220 Bits; }; struct tbasechunk26238 { NI Prevsize; NI Size; NIM_BOOL Used; }; struct tsmallchunk26240 { tbasechunk26238 Sup; tsmallchunk26240* Next; tsmallchunk26240* Prev; tfreecell26230* Freelist; NI Free; NI Acc; NF Data; }; struct tllchunk27004 { NI Size; NI Acc; tllchunk27004* Next; }; struct tbigchunk26242 { tbasechunk26238 Sup; tbigchunk26242* Next; tbigchunk26242* Prev; NI Align; NF Data; }; struct ttrunk26213 { ttrunk26213* Next; NI Key; TY26220 Bits; }; typedef tavlnode27008* TY27014[2]; struct tavlnode27008 { TY27014 Link; NI Key; NI Upperbound; NI Level; }; struct tfreecell26230 { tfreecell26230* Next; NI Zerofield; }; struct ttypeseq223851 { TGenericSeq Sup; ttype223855* data[SEQ_DECL_SIZE]; }; struct TY223950 { TGenericSeq Sup; tinstantiation223839* data[SEQ_DECL_SIZE]; }; struct tsymseq223821 { TGenericSeq Sup; tsym223849* data[SEQ_DECL_SIZE]; }; struct tnodeseq223813 { TGenericSeq Sup; tnode223819* data[SEQ_DECL_SIZE]; }; struct TY223939 { TGenericSeq Sup; NI32 data[SEQ_DECL_SIZE]; }; N_NIMCALL(void, rawmessage_196733)(NU16 msg, NimStringDesc* arg); N_NIMCALL(void, internalerror_196989)(NimStringDesc* errmsg); N_NIMCALL(void, message_196959)(tlineinfo194539 info, NU16 msg, NimStringDesc* arg); N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x); static N_INLINE(NI, sonslen_224252)(tnode223819* n); N_NIMCALL(tnode223819*, cleanup_601077)(tpasscontext284005* c, tnode223819* n); N_NIMCALL(tsym223849*, getmodule_233243)(tsym223849* s); N_NIMCALL(NIM_BOOL, astneeded_284094)(tsym223849* s); static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src); static N_INLINE(tcell44735*, usrtocell_48446)(void* usr); static N_INLINE(void, rtladdzct_50004)(tcell44735* c); N_NOINLINE(void, addzct_48417)(tcellseq44751* s, tcell44735* c); STRING_LITERAL(TMP1933, "logpass: context is not nil", 27); extern NI gverbosity_168127; extern NU64 gnotes_195305; extern NI gbackendid_222013; extern NU32 gglobaloptions_168118; extern tnode223819* emptynode_224738; extern tgcheap46816 gch_46844; N_NIMCALL(tpasscontext284005*, verboseopen_601012)(tsym223849* s) { tpasscontext284005* result; result = 0; result = NIM_NIL; { if (!(0 < gverbosity_168127)) goto LA3; rawmessage_196733(((NU16) 266), (*(*s).Name).S); } LA3: ; return result; } N_NIMCALL(tnode223819*, verboseprocess_601023)(tpasscontext284005* context, tnode223819* n) { tnode223819* result; result = 0; result = n; { if (!!((context == NIM_NIL))) goto LA3; internalerror_196989(((NimStringDesc*) &TMP1933)); } LA3: ; { NimStringDesc* LOC9; if (!(gverbosity_168127 == 3)) goto LA7; gnotes_195305 |= ((NI64)1)<<(((((NU16) 266)- 230))%(sizeof(NI64)*8)); LOC9 = 0; LOC9 = nimIntToStr(gbackendid_222013); message_196959((*n).Info, ((NU16) 266), LOC9); } LA7: ; return result; } static N_INLINE(NI, sonslen_224252)(tnode223819* n) { NI result; result = 0; { if (!(*n).kindU.S6.Sons == 0) goto LA3; result = 0; } goto LA1; LA3: ; { result = (*n).kindU.S6.Sons->Sup.len; } LA1: ; return result; } static N_INLINE(tcell44735*, usrtocell_48446)(void* usr) { tcell44735* result; result = 0; result = ((tcell44735*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(tcell44735)))))); return result; } static N_INLINE(void, rtladdzct_50004)(tcell44735* c) { addzct_48417(&gch_46844.Zct, c); } static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) { { tcell44735* c; if (!!((src == NIM_NIL))) goto LA3; c = usrtocell_48446(src); (*c).Refcount += 8; } LA3: ; { tcell44735* c; if (!!(((*dest) == NIM_NIL))) goto LA7; c = usrtocell_48446((*dest)); { (*c).Refcount -= 8; if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11; rtladdzct_50004(c); } LA11: ; } LA7: ; (*dest) = src; } N_NIMCALL(tnode223819*, cleanup_601077)(tpasscontext284005* c, tnode223819* n) { tnode223819* result; result = 0; result = n; { NIM_BOOL LOC3; LOC3 = 0; LOC3 = ((gglobaloptions_168118 &(1<<((((NU8) 2))&31)))!=0); if (LOC3) goto LA4; LOC3 = (n == NIM_NIL); LA4: ; if (!LOC3) goto LA5; goto BeforeRet; } LA5: ; switch ((*n).Kind) { case ((NU8) 114): { { NI i_601124; NI HEX3Atmp_601219; NI LOC9; NI res_601222; i_601124 = 0; HEX3Atmp_601219 = 0; LOC9 = 0; LOC9 = sonslen_224252(n); HEX3Atmp_601219 = (NI32)(LOC9 - 1); res_601222 = 0; { while (1) { tnode223819* LOC12; if (!(res_601222 <= HEX3Atmp_601219)) goto LA11; i_601124 = res_601222; LOC12 = 0; LOC12 = cleanup_601077(c, (*n).kindU.S6.Sons->data[i_601124]); res_601222 += 1; } LA11: ; } } } break; case ((NU8) 79): case ((NU8) 80): { { tsym223849* s; if (!((*(*n).kindU.S6.Sons->data[0]).Kind == ((NU8) 3))) goto LA16; s = (*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym; { NIM_BOOL LOC20; tsym223849* LOC21; NIM_BOOL LOC23; LOC20 = 0; LOC21 = 0; LOC21 = getmodule_233243(s); LOC20 = !((((*LOC21).Flags &(1<<((((NU8) 25))&31)))!=0)); if (!(LOC20)) goto LA22; LOC23 = 0; LOC23 = astneeded_284094(s); LOC20 = !(LOC23); LA22: ; if (!LOC20) goto LA24; asgnRefNoCycle((void**) &(*(*s).Ast).kindU.S6.Sons->data[6], emptynode_224738); } LA24: ; } LA16: ; } break; default: { } break; } BeforeRet: ; return result; } NIM_EXTERNC N_NOINLINE(void, HEX00_passauxInit)(void) { } NIM_EXTERNC N_NOINLINE(void, HEX00_passauxDatInit)(void) { }
26357bd90b6aa293d6ae0a9474adfc34f72cc8b0
6b40e9dccf2edc767c44df3acd9b626fcd586b4d
/NT/base/tools/gs_support/umode/gs_report.c
99e09c05d53d77c31f538ce77857a8c687b5fc45
[]
no_license
jjzhang166/WinNT5_src_20201004
712894fcf94fb82c49e5cd09d719da00740e0436
b2db264153b80fbb91ef5fc9f57b387e223dbfc2
refs/heads/Win2K3
2023-08-12T01:31:59.670176
2021-10-14T15:14:37
2021-10-14T15:14:37
586,134,273
1
0
null
2023-01-07T03:47:45
2023-01-07T03:47:44
null
UTF-8
C
false
false
1,871
c
gs_report.c
/*++ Copyright (c) 2000 Microsoft Corporation Module Name: gs_support.c Abstract: This module contains the support for the compiler /GS switch Author: Bryan Tuttle (bryant) 01-aug-2000 Revision History: Initial version copied from CRT source. Code must be generic to link into usermode or kernemode. Limited to calling ntdll/ntoskrnl exports or using shared memory data. --*/ #include <nt.h> #include <ntrtl.h> #include <nturtl.h> #include <windows.h> FARPROC __gs_AltFailFunction; extern FARPROC __gs_pfUnhandledExceptionFilter; void __cdecl __report_gsfailure(void) { // // Don't call DbgPrint by default since it generates a Ctrl-C // exception as part of outputting to the debugger and we // can't trust exception handling at this point. // // DbgPrint("***** Stack overwrite detected in %ws *****\n", // NtCurrentPeb()->ProcessParameters->CommandLine.Buffer); // // Fake an exception. We can't raise an exception for real since // the stack (and therefore exception handling) can't be trusted. // if (__gs_AltFailFunction) { __gs_AltFailFunction(); } if (__gs_pfUnhandledExceptionFilter) { EXCEPTION_RECORD ExceptionRecord = {0}; CONTEXT ContextRecord = {0}; EXCEPTION_POINTERS ExceptionPointers; ExceptionRecord.ExceptionCode = STATUS_STACK_BUFFER_OVERRUN; ExceptionPointers.ExceptionRecord = &ExceptionRecord; ExceptionPointers.ContextRecord = &ContextRecord; SetUnhandledExceptionFilter(NULL); // Make sure any filter already in place is deleted. __gs_pfUnhandledExceptionFilter(&ExceptionPointers); } TerminateProcess(GetCurrentProcess(), ERROR_STACK_BUFFER_OVERRUN); }
7df122cb316bcd2718b20c9170bf670d97dd2625
37515e160116d52ba7768bb2e8c8c131937cced2
/student-distrib/terminal.h
9a0ddddb1728365e2af6d2f3fe9487d15156a48a
[]
no_license
dhivanpatel/Kernel
6da7c84aeadaf7fdfb9045c5e63b51b453407a20
ea1b568764e2aa27eb20e4f469a2355a6505db46
refs/heads/main
2023-01-16T00:29:41.487668
2020-11-17T04:05:37
2020-11-17T04:05:37
313,498,247
0
0
null
null
null
null
UTF-8
C
false
false
1,689
h
terminal.h
#ifndef TERMINAL_H #define TERMINAL_H #include "types.h" #include "i8259.h" #include "syscall.h" #include "lib.h" #include "paging.h" #include "terminal.h" #include "x86_desc.h" #include "PCB.h" #include "syshelp.h" #include "scheduler.h" #include "keyboard.h" #define NUM_TERMS 3 #define VID_MEM 0xB8000 #define TERM0_MEM 0xB9000 #define TERM1_MEM 0xBA000 #define TERM2_MEM 0xBB000 #define FOUR_KB 4096 #define N_ROWS 80 #define N_COLS 25 #define ATTR 0x7 //create a terminal struct that holds the //user level buffer pointer, the kernel level pointer, the value and everythin typedef struct terminal_struct{ //the video memory kernel addr will only change //now, have cursor, (start x and start y) void* kernel_addr; //kernel addr (the actual page) uint32_t cursor_x; uint32_t cursor_y; uint8_t shell_on; uint32_t term_num; // 0, 1, 2 int32_t active_process_num; // 0, 1, 2, 3, 4, 5 etc however many processes //will use -1 to indicate no process is being run char key_buf[SCANCODE_SIZE]; int key_buf_idx; } terminal_t; terminal_t terms[NUM_TERMS]; //uint32_t active_term = 0; //terminal_t[3] cur_terminals; extern void launch_initial_shells(int term_num); extern int32_t terminal_read(int32_t fd, void* buf, int32_t nbytes); extern int32_t terminal_write(int32_t fd,const void* buf, int32_t nbytes); extern int32_t terminal_open(const uint8_t* filename); extern int32_t terminal_close(int32_t fd); extern int32_t get_active_term(); extern int32_t get_sched_term(); extern void set_sched_term(int term); extern void switch_terminals(int32_t next); extern void terminal_init(); extern int get_pit_flag(); extern void set_pit_flag(int val); #endif
37aa2de8ac5073c98b19e6637c8700e121625333
88863980430ef72ea33f30d9001c88571bf19ea0
/HARDWARE/Task_Board/BH1705/bh1750.h
43583d362408e966eabb7d1aad3311a61eff6985
[]
no_license
gjs990825/Embedded_Car
45ad33cb4396b82eaa31c990f08dc8f5e3a802f4
76e0f550f70e5a7e23ad3a00e3c6c7411bf08891
refs/heads/master
2022-04-27T07:40:48.196525
2022-03-18T06:50:54
2022-03-18T06:50:54
173,340,855
0
2
null
null
null
null
UTF-8
C
false
false
334
h
bh1750.h
#ifndef __BH1750_H #define __BH1750_H #include "sys.h" //IO操作函数 #define IIC_SCL PBout(6) //SCL #define IIC_SDA PBout(7) //SDA输出 #define READ_SDA PBin(7) //SDA输入 #define ADDR PGout(15) void BH1750_Configure(void); uint16_t Get_Bh_Value(void); uint16_t BH1750_GetAverage(uint8_t times); #endif
1e5dab7b9827c121ee85804a955855316a76d63b
7295635ce666dfb130f40b8edbada209898a0493
/src/s_strbuf.c
1843a3e674d4f444a70019e0e9fa815875842993
[ "BSD-2-Clause" ]
permissive
monich/slib
a71c3fc3a11144bd73f72056a8b8ba37f568b930
f04a1a01d09f3e9309117bade794cc4dadebcd7b
refs/heads/master
2023-04-15T07:16:53.967252
2023-04-07T23:34:40
2023-04-07T23:34:40
89,782,581
1
0
null
null
null
null
UTF-8
C
false
false
39,238
c
s_strbuf.c
/* * $Id: s_strbuf.c,v 1.79 2016/08/27 17:07:54 slava Exp $ * * Copyright (C) 2000-2016 by Slava Monich * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1.Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2.Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 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) ARISING * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * any official policies, either expressed or implied. */ #include "s_strbuf.h" #include "s_util.h" #include "s_mem.h" /* prototype of a string comparison function, e.g. strcmp */ typedef int (CDECL *StrCmpFunc) P_((Str s1, Str s2)); /*==========================================================================* * S T R I N G B U F F E R *==========================================================================*/ /** * Allocates StrBuf from the heap. */ StrBuf * STRBUF_Create() { StrBuf * sb = MEM_New(StrBuf); if (sb) { STRBUF_Init(sb); return sb; } return NULL; } /** * Delets StrBuf previously allocated by STRBUF_Create() */ void STRBUF_Delete(StrBuf * sb) { if (sb) { STRBUF_Destroy(sb); MEM_Free(sb); } } /** * Initialize the string buffer */ void STRBUF_Init(StrBuf * sb) { STRBUF_InitBuf(sb, NULL, 0); } /** * Initialize string buffer with external buffer of fixed size (typically * allocated on stack) */ void STRBUF_InitBuf2(StrBuf * sb, Char* buf, size_t len, size_t bufsize) { ASSERT(sb); if (sb) { if (buf && bufsize > 0) { ASSERT(len < bufsize); sb->s = sb->ext = buf; sb->alloc = bufsize; sb->len = MIN(bufsize-1,len); sb->s[sb->len] = 0; ASSERT(StrLen(buf) == sb->len); } else { memset(sb, 0, sizeof(*sb)); } } } /** * Initialize string buffer with external buffer of fixed size (typically * allocated on stack) */ void STRBUF_InitBuf(StrBuf * sb, Char* buf, size_t bufsize) { STRBUF_InitBuf2(sb, buf, 0, bufsize); } /** * Destroy the contents of the string buffer. */ void STRBUF_Destroy(StrBuf * sb) { if (sb) { if (sb->alloc) { ASSERT(sb->s); if (sb->s != sb->ext) MEM_Free(sb->s); sb->alloc = 0; } sb->len = 0; sb->s = NULL; } } /** * Returns length of the string. */ size_t STRBUF_Length(const StrBuf * sb) { ASSERT(sb); if (sb) { ASSERT(sb->len == 0 || StrLen(sb->s) == sb->len); return sb->len; } return 0; } /** * Makes sure that length of the string does not exceed maxlen */ void STRBUF_SetLength(StrBuf * sb, size_t maxlen) { ASSERT(sb); if (sb && sb->len > maxlen) { sb->len = maxlen; sb->s[maxlen] = 0; } } /** * Tests if two string buffers are equal. Two NULLs are equal, * NULL and non-NULL (even an empty string) are not. */ STATIC Bool STRBUF_EqualsWithProc(const StrBuf * sb1, const StrBuf * sb2, StrCmpFunc cmp) { if (sb1 && sb2) { /* try some quick checks */ if (sb1 == sb2) { return True; } else if (sb1->s == sb2->s) { return True; } else if (sb1->len != sb2->len) { return False; } else if (!sb1->len) { return True; } else { return BoolValue(cmp(sb1->s, sb2->s) == 0); } } else if (!sb1 && !sb1) { return True; } else { return False; } } Bool STRBUF_Equals(const StrBuf * sb1, const StrBuf * sb2) { return STRBUF_EqualsWithProc(sb1, sb2, StrCmp); } /** * Tests if a string buffer equals to a NULL-terminated string. * If any of them is NULL, the result is False. */ STATIC Bool STRBUF_EqualsToWithProc(const StrBuf * sb, Str s, StrCmpFunc cmp) { if (sb && s) { if (sb->len == 0) { return BoolValue(!s[0]); } else if (sb->s == s) { return True; } else { return BoolValue(cmp(sb->s, s) == 0); } } return False; } Bool STRBUF_EqualsTo(const StrBuf * sb, Str s) { return STRBUF_EqualsToWithProc(sb, s, StrCmp); } /** * Clear the string buffer. */ void STRBUF_Clear(StrBuf * sb) { ASSERT(sb); if (sb) { sb->len = 0; if (sb->alloc) sb->s[0] = 0; } } /** * Erase some characters from the string, starting from index * 'from' (inclusive), ending at 'to' (exclusive) */ void STRBUF_Erase(StrBuf * sb, size_t from, size_t to) { ASSERT(sb); if (sb) { ASSERT(from <= to); ASSERT(to <= sb->len); if (to > sb->len) to = sb->len; if (from < to) { memmove(sb->s+from, sb->s+to, sizeof(Char)*(sb->len-to+1)); sb->len -= (to - from); ASSERT(!sb->s[sb->len]); } } } /** * Removes leading and trailing whitespaces. Returns True if at least one * whitespace has been removed, False if string didn't change. */ Bool STRBUF_Trim(StrBuf * sb) { Bool trimmed = False; if (sb->len > 0) { size_t pos; /* trim trailing whitespaces */ pos = sb->len; while (pos > 0 && IsSpace(sb->s[pos-1])) pos--; if (pos < sb->len) { trimmed = True; STRBUF_Erase(sb, pos, sb->len); } /* trim leading whitespaces */ pos = 0; while (pos < sb->len && IsSpace(sb->s[pos])) pos++; if (pos > 0) { trimmed = True; STRBUF_Erase(sb, 0, pos); } } return trimmed; } /** * Returns character at specified position. */ Char STRBUF_CharAt(const StrBuf * sb, size_t pos) { ASSERT(sb); if (sb) { ASSERT(pos < sb->len); if (pos < sb->len) { return sb->s[pos]; } } return 0; } /** * Returns first character of the string, 0 if string is empty */ Char STRBUF_FirstChar(const StrBuf * sb) { ASSERT(sb); if (sb && sb->len > 0) { return sb->s[0]; } return 0; } /** * Returns last character of the string, 0 if string is empty */ Char STRBUF_LastChar(const StrBuf * sb) { ASSERT(sb); if (sb && sb->len > 0) { return sb->s[sb->len-1]; } return 0; } /** * Returns index of the specified character, -1 if character not found */ int STRBUF_IndexOf(const StrBuf * sb, Char ch) { ASSERT(sb); if (sb && sb->len > 0 && ch) { Str found = StrChr(sb->s, ch); if (found) { int pos = (int)(found - sb->s); ASSERT(pos >= 0); /* if negative, string is WAY too long */ return pos; } } return -1; } /** * Returns last index of the specified character, -1 if character not found */ int STRBUF_LastIndexOf(const StrBuf * sb, Char ch) { ASSERT(sb); if (sb && sb->len > 0 && ch) { Str found = StrrChr(sb->s, ch); if (found) { int pos = (int)(found - sb->s); ASSERT(pos >= 0); /* if negative, string is WAY too long */ return pos; } } return -1; } /** * Finds the first occurrence of s in sb. Returns the position where * the occurrence was found, or -1 if none was found, or if the string * buffer is empty. */ int STRBUF_Find(const StrBuf * sb, Str s) { return STRBUF_FindFrom(sb, 0, s); } /** * Finds the first occurrence of s in sb, starting with the specified * position. Returns the position where the occurrence was found, or -1 * none was found, the position is invalid or if the string buffer is * empty. */ int STRBUF_FindFrom(const StrBuf * sb, int pos, Str s) { if (sb->len > 0 && ((size_t)pos) < sb->len && s) { if (!*s) { return 0; /* like strstr does */ } else { Str found = StrStr(sb->s + pos, s); if (found) { ASSERT((size_t)(found - sb->s) < sb->len); pos = (int)(found - sb->s); ASSERT(pos >= 0); /* if negative, string is WAY too long */ return pos; } } } return -1; } /** * Finds the last occurrence of s in sb. Returns the position where * the occurrence was found, or -1 if none was found, or if either * string is empty. */ int STRBUF_FindLast(const StrBuf * sb, Str s) { if (sb->len > 0 && s && *s) { size_t slen = StrLen(s); if (sb->len >= slen) { Str ptr = sb->s + (sb->len-slen); while (ptr >= sb->s) { Str s1 = ptr; Str s2 = s; while (*s1 && *s2 && !(*s1-*s2)) s1++, s2++; if (!*s2) { return (int)(ptr - sb->s); } ptr--; } } } return -1; } #ifndef __KERNEL__ /** * Tests if two strings are equal, ignoring the case. If any of them is NULL, * the result is False. */ Bool STRBUF_EqualsNoCase(const StrBuf * sb1, const StrBuf * sb2) { return STRBUF_EqualsWithProc(sb1, sb2, StrCaseCmp); } /** * Tests if two strings are equal, ignoring the case. If any of them is NULL, * the result is False. */ Bool STRBUF_EqualsToNoCase(const StrBuf * sb, Str s) { return STRBUF_EqualsToWithProc(sb, s, StrCaseCmp); } /** * Finds the first occurrence of s in sb, ignoring the case. Returns the * position where the occurrence was found, or -1 if none was found, or if * the string buffer is empty. The string comparison is case-insentive. */ int STRBUF_FindNoCase(const StrBuf * sb, Str s) { return STRBUF_FindFromNoCase(sb, 0, s); } /** * Finds the first occurrence of s in sb, starting with the specified * position, ignoring the case. Returns the position where the occurrence * was found, or -1 none was found, the position is invalid or if the * string buffer is empty. The string comparison is case-insentive. */ int STRBUF_FindFromNoCase(const StrBuf * sb, int pos, Str s) { if (sb->len > 0 && ((size_t)pos) < sb->len && s) { if (!*s) { return 0; /* like strstr does */ } else { size_t len = StrLen(s); if (len+pos <= sb->len) { size_t i, max = sb->len - len; for (i=pos; i<=max; i++) { if (StrnCaseCmp(sb->s + i, s, len) == 0) { return (int)i; } } } } } return -1; } /** * Finds the last occurrence of s in sb. Returns the position where * the occurrence was found, or -1 if none was found, or if either * string is empty. The string comparison is case-insentive. */ int STRBUF_FindLastNoCase(const StrBuf * sb, Str s) { if (sb->len > 0 && s && *s) { size_t len = StrLen(s); if (sb->len >= len) { Str ptr = sb->s + (sb->len-len); while (ptr >= sb->s) { if (StrnCaseCmp(ptr, s, len) == 0) { return (int)(ptr - sb->s); } ptr--; } } } return -1; } #endif /* __KERNEL__ */ /** * Replaces all occurrences of c1 with c2, returns number of replaced * characters */ int STRBUF_Replace(StrBuf * sb, Char c1, Char c2) { int n = 0; ASSERT(sb && c1 && c2); if (sb && c1 && c2 && (c1 != c2)) { size_t i; for (i=0; i<sb->len; i++) { if (sb->s[i] == c1) { sb->s[i] = c2; n++; } } } return n; } /** * Returns all occurrences of substring 'from' to 'to'. Returns * the number of replacements made, or -(n+1) if an error occured, * where n is the number of successful replacements (we don't * undo the damage). */ int STRBUF_ReplaceStr(StrBuf * sb, Str from, Str to) { int n = 0; Char* found; size_t len1 = StrLen(from); size_t len2 = StrLen(to); if (len1 > len2) { long pos = 0; while (pos >= 0) { pos = STRBUF_FindFrom(sb, pos, from); if (pos >= 0) { /* get rid of extra characters */ STRBUF_Erase(sb, pos+len2, pos+len1); memcpy(sb->s+pos, to, sizeof(Char)*len2); n++; } } } else if (len1 < len2) { long pos = 0; while (pos >= 0) { pos = STRBUF_FindFrom(sb, pos, from); if (pos >= 0) { /* insert extra characters */ STRBUF_Insert(sb, to+len1, pos+len1); memcpy(sb->s+pos, to, sizeof(Char)*len1); pos = (int)(pos + len2); n++; } } } else if (len1) { size_t off = 0; while ((found = StrStr(sb->s+off,from)) != NULL) { n++; memcpy(found, to, sizeof(Char)*len2); off = (found - sb->s) + len2; if (off > sb->len-len1) { break; } } } return n; } /** * Tests if this string starts with the specified prefix. */ STATIC Bool STRBUF_StartsWithOffset(const StrBuf * sb, size_t off, Str s) { ASSERT(sb); if (sb) { size_t i = off; while (i<sb->len && *s) { if (sb->s[i++] != *s++) { return False; } } return BoolValue(!(*s)); } return False; } /** * Tests if this string starts with the specified prefix. */ Bool STRBUF_StartsWith(const StrBuf * sb, Str s) { return STRBUF_StartsWithOffset(sb, 0, s); } /** * Tests if this string ends with the specified suffix. */ Bool STRBUF_EndsWith(const StrBuf * sb, Str s) { ASSERT(sb); if (s && sb) { size_t len = StrLen(s); if (len <= sb->len) { return STRBUF_StartsWithOffset(sb, sb->len - len, s); } } return False; } #ifndef __KERNEL__ /** * Tests if this string starts with the specified prefix. Ignores the case. */ STATIC Bool STRBUF_StartsWithOffsetNoCase(const StrBuf* sb, size_t off, Str s) { ASSERT(sb); if (sb) { size_t i = off; while (i<sb->len && *s) { if (sb->s[i++] != *s++) { /* switch to more expensive case-insensitive algorithm */ size_t len1 = sb->len-(--i); size_t len2 = StrLen(s--)+1; if (len1 >= len2) { if (StrnCaseCmp(sb->s+i,s,len2) == 0) { return True; } } return False; } } return BoolValue(!(*s)); } return False; } /** * Tests if this string starts with the specified prefix. Ignores the case. */ Bool STRBUF_StartsWithNoCase(const StrBuf * sb, Str s) { return STRBUF_StartsWithOffsetNoCase(sb, 0, s); } /** * Tests if this string ends with the specified suffix. Ignores the case. */ Bool STRBUF_EndsWithNoCase(const StrBuf * sb, Str s) { ASSERT(sb); if (s && sb) { size_t len = StrLen(s); if (len <= sb->len) { return STRBUF_StartsWithOffsetNoCase(sb, sb->len - len, s); } } return False; } #endif /* __KERNEL__ */ /** * Converts all of the characters in this string to upper case */ void STRBUF_ToUpperCase(StrBuf * sb) { size_t i; for (i=0; i<sb->len; i++) { sb->s[i] = (Char)ToUpper(sb->s[i]); } } /** * Converts all of the characters in this string to lower case */ void STRBUF_ToLowerCase(StrBuf * sb) { size_t i; for (i=0; i<sb->len; i++) { sb->s[i] = (Char)ToLower(sb->s[i]); } } /** * Retruns string represented by this string buffer. If no memory has ever * been allocated by this string buffer, return statically allocated empty * string. */ Str STRBUF_GetString(const StrBuf * sb) { if (sb && sb->len) { ASSERT(sb->s && sb->s[0]); return sb->s; } return TEXT(""); } /** * Reallocate the buffer if necessary, to ensure that it may contain at * least a string of specified length (i.e. minlen+1 characters). */ Bool STRBUF_Alloc(StrBuf * sb, size_t minlen) { size_t minsize = minlen+1; size_t oldsize = sb->alloc; ASSERT(minlen != ((size_t)-1)); if (minsize > oldsize) { Char* newbuf; size_t newsize = (oldsize * 3)/2 + 1; if (newsize < minsize) newsize = minsize; /* cannot realloc external buffer */ if (!sb->s || (sb->s && (sb->s == sb->ext))) { newbuf = MEM_NewArray(Char,newsize); if (newbuf) { if (sb->len > 0) { memcpy(newbuf, sb->s, sizeof(Char)*(sb->len + 1)); } else { newbuf[0] = 0; } } } else { #ifdef NO_REALLOC newbuf = MEM_NewArray(Char, newsize); if (newbuf && sb->s) { memcpy(newbuf, sb->s, sb->alloc * sizeof(Char)); MEM_Free(sb->s); } #else newbuf = (Char*)MEM_Realloc(sb->s, newsize * sizeof(Char)); #endif /* NO_REALLOC */ } /* failed to allocate new buffer - bail out */ if (!newbuf) return False; /* otherwise switch to the new buffer */ sb->s = newbuf; sb->alloc = newsize; } return True; } /** * Allocates a NULL terminated string initialized with the current contents * of the string buffer. The caller is responsible for deallocating the * returned string with MEM_Free. Returns NULL on failure. */ Char * STRBUF_Dup(const StrBuf * sb) { Char * copy = NULL; if (sb) { copy = MEM_NewArray(Char,sb->len+1); if (copy) { if (sb->len > 0) { StrCpy(copy, sb->s); ASSERT(StrLen(copy) == sb->len); } else { copy[0] = 0; } } } return copy; } /** * Copies a string into the buffer */ Bool STRBUF_Copy(StrBuf * sb, Str s) { ASSERT(s); if (s) { STRBUF_Clear(sb); return STRBUF_Append(sb, s); } return False; } /** * Copies the contents of one buffer into another. */ Bool STRBUF_CopyBuf(StrBuf * sb, const StrBuf * from) { ASSERT(sb && from); if (!sb || !from) { return False; } else if (sb == from) { return True; } else { const size_t oldlen = sb->len; sb->len = 0; if (STRBUF_Alloc(sb, from->len)) { memcpy(sb->s, from->s, sizeof(Char)*(from->len + 1)); sb->len = from->len; ASSERT(StrLen(sb->s) == sb->len); return True; } else { sb->len = oldlen; return False; } } } /** * Replace contents of the string buffer with the specified string. */ Bool STRBUF_CopyN(StrBuf * sb, Str s, size_t size) { ASSERT(s); if (s) { STRBUF_Clear(sb); return STRBUF_AppendN(sb, s, size); } return False; } /** * Append a string to the buffer */ Bool STRBUF_Append(StrBuf * sb, Str s) { if (s) { size_t len = StrLen(s); if (STRBUF_Alloc(sb, sb->len + len)) { memcpy(sb->s + sb->len, s, sizeof(Char)*(len + 1)); sb->len += len; ASSERT(StrLen(sb->s) == sb->len); return True; } } return False; } /** * Append the contents of sb2 to sb1. This is faster than STRBUF_Append * because it does not need to calculate the length of the second string. * Also, memcpy is probably slightly faster than strcpy. */ Bool STRBUF_AppendBuf(StrBuf * sb1, const StrBuf * sb2) { if (sb2) { /* allocate necessary amount of space */ if (STRBUF_Alloc(sb1, sb1->len + sb2->len)) { memcpy(sb1->s + sb1->len, sb2->s, sizeof(Char)*sb2->len); sb1->len += sb2->len; sb1->s[sb1->len] = 0; ASSERT(StrLen(sb1->s) == sb1->len); return True; } } return False; } /** * Append no more than N characters to the buffer */ Bool STRBUF_AppendN(StrBuf * sb, Str s, size_t max) { if (s && max > 0) { /* calculate the number of bytes we are about to copy... */ size_t n = 0; Str sp = s; while (n < max && *sp++) n++; /* allocate necessary amount of space */ if (STRBUF_Alloc(sb, sb->len + n)) { memcpy(sb->s + sb->len, s, sizeof(Char)*n); sb->len += n; sb->s[sb->len] = 0; ASSERT(StrLen(sb->s) == sb->len); return True; } } /* always return True if appending 0 characters */ return BoolValue(max == 0); } /** * Append an integer (string representation of it) to the buffer */ Bool STRBUF_AppendInt(StrBuf * sb, int i) { Char buf[32]; Char* s = STRING_Format(buf, COUNT(buf), TEXT("%d"), i); Bool success = STRBUF_Append(sb, s); if (s != buf) MEM_Free(s); return success; } /** * Append a character to the buffer. */ Bool STRBUF_AppendChar(StrBuf * sb, Char c) { if (STRBUF_Alloc(sb, sb->len+1)) { sb->s[sb->len++] = c; sb->s[sb->len] = 0; return True; } return False; } /** * Append an boolean (string representation of it) to the buffer */ Bool STRBUF_AppendBool(StrBuf * sb, Bool b) { Str s = (b ? TRUE_STRING : FALSE_STRING); return STRBUF_Append(sb, s); } /** * Append an double (string representation of it) to the buffer */ #ifndef __KERNEL__ Bool STRBUF_AppendDouble(StrBuf * sb, double d) { Bool ok; StrBuf64 buf; STRBUF_InitBufXXX(&buf); ok = (STRING_FormatDouble(&buf.sb, d) && STRBUF_AppendBuf(sb, &buf.sb)); STRBUF_Destroy(&buf.sb); return ok; } /** * Append time to the buffer in the form "Wed Jun 30 21:49:08 1993 EST" */ Bool STRBUF_AppendTime(StrBuf * sb, Time t) { Str s = TIME_ToString(t); if (s) { if (STRBUF_Append(sb, s)) { Bool success = True; #if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) static Bool tzisset = False; if (!tzisset) { tzisset = True; tzset(); } if (tzname[0]) { if (STRBUF_AppendChar(sb, ' ')) { # ifdef UNICODE Char * tmp = STRING_ToUnicode(tzname[0]); if (tmp) { success = STRBUF_Append(sb, tmp); MEM_Free(tmp); } # else /* !UNICODE */ success = STRBUF_Append(sb, tzname[0]); # endif /* !UNICODE */ } } #endif /* !_WIN32_WCE */ return success; } } return False; } /** * Formats time in the form "Wed Jun 30 21:49:08 1993 EST" */ Bool STRBUF_FormatTime(StrBuf * sb, Time t) { STRBUF_Clear(sb); return STRBUF_AppendTime(sb, t); } #endif /* !__KERNEL__ */ /** * Appends the specified character to the string until its length * reaches specified minimum length. If len parameter is less than * the string length, the string is not modified (including the case * if len is negative) */ Bool STRBUF_Inflate(StrBuf * sb, size_t len, Char fill) { Bool success = True; if (sb->len < len) { success = STRBUF_Alloc(sb, sb->len + len); if (success) { memset(sb->s + sb->len, fill, sizeof(Char)*(len - sb->len)); sb->s[len] = 0; sb->len = len; } } return success; } /** * Inserts string at specified position. The length of the string is * given as a parameter. */ Bool STRBUF_InsertN(StrBuf * sb, size_t pos, Str s, size_t len) { ASSERT(pos <= sb->len); if (pos <= sb->len) { if (s && len > 0) { DEBUG_ONLY(size_t i; for (i=0; i<len; i++) ASSERT(s[i])); if (STRBUF_Alloc(sb, sb->len + len)) { memmove(sb->s+pos+len,sb->s+pos,sizeof(Char)*(sb->len-pos+1)); memmove(sb->s+pos, s, sizeof(Char)*len); sb->len += len; } else { return False; } } return True; } return False; } /** * Inserts string at specified position. */ Bool STRBUF_Insert(StrBuf * sb, Str s, size_t pos) { return STRBUF_InsertN(sb, pos, s, StrLen(s)); } /** * Inserts character at specified position. Inserrting NULL character has * no effect. */ Bool STRBUF_InsertChar(StrBuf * sb, Char c, size_t pos) { /* should not insert NULL character */ return c ? STRBUF_InsertN(sb, pos, &c, 1) : False; } /** * Store formatted message in the buffer. Appends the formatted string to * the current contents of the buffer. */ Bool STRBUF_AppendFormatVa(StrBuf * sb, Str format, va_list va) { if (sb->alloc <= (sb->len + 1) && !STRBUF_Alloc(sb, sb->len + 100)) { return False; } for (;;) { size_t avail = sb->alloc - sb->len; size_t newsize = sb->alloc; int nchars; #if defined(_NT_KERNEL) && defined(UNICODE) /* All Unicode-related sprintf-style functions * are banned at >= DISPATCH_LEVEL */ ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); #endif /* _NT_KERNEL && UNICODE */ /* try to print in the allocated space. */ #ifdef va_copy va_list va2; va_copy(va2, va); nchars = Vsnprintf(sb->s + sb->len, avail, format, va2); va_end(va2); #else /* va_copy */ /* NOTE: reusing va_list is risky and may not work... */ nchars = Vsnprintf(sb->s + sb->len, avail, format, va); #endif /* va_copy */ /* if that worked, we are done. */ if (nchars > -1 && nchars < (int)avail) { sb->len += nchars; break; } /* else try again with more space. */ if (nchars > -1) { newsize = sb->len + nchars; /* precisely what is needed */ } else { newsize *= 2; /* twice the old size */ } /* if memory allocation fails, break the loop */ if (!STRBUF_Alloc(sb, newsize)) { sb->s[sb->len] = 0; return False; } } /* * vsnprintf in NT kernel environment doesn't always NULL-terminate * the formatted string. That seems to happen when using %wZ specified * to format a UNICODE_STRING that contains non-printable characters. */ #ifdef _NT_KERNEL sb->s[sb->len] = 0; #endif ASSERT(sb->len == StrLen(sb->s)); return True; } /** * Store formatted message in the buffer. */ Bool STRBUF_FormatVa(StrBuf * sb, Str format, va_list va) { STRBUF_Clear(sb); return STRBUF_AppendFormatVa(sb, format, va); } /** * Store formatted message in the buffer. */ Bool STRBUF_Format(StrBuf * sb, Str format, ...) { Bool ok; va_list va; va_start(va, format); ok = STRBUF_FormatVa(sb, format, va); va_end(va); return ok; } /** * Append formatted message in the buffer. */ Bool STRBUF_AppendFormat(StrBuf * sb, Str format, ...) { Bool ok; va_list va; va_start(va, format); ok = STRBUF_AppendFormatVa(sb, format, va); va_end(va); return ok; } /*==========================================================================* * U T F - 8 C O N V E R S I O N *==========================================================================*/ #ifdef _UNICODE Bool STRBUF_CopyUTF8(StrBuf * sb, const char * utf8) { ASSERT(utf8); if (utf8) { STRBUF_Clear(sb); return STRBUF_AppendUTF8(sb, utf8); } return False; } Bool STRBUF_AppendUTF8(StrBuf * sb, const char * utf8) { if (utf8) { const size_t len = UTF8_Length(utf8); if (len != UTF8_ERROR && STRBUF_Alloc(sb, sb->len + len)) { int n = 0; const char * src = utf8; size_t bytesleft = strlen(utf8); wchar_t * dest = sb->s + sb->len; while (*src && (n = UTF8_DecodeChar(src, &bytesleft, dest)) > 0) { src += n; dest++; } ASSERT(!bytesleft); if (n >= 0) { *dest = 0; sb->len += len; return True; } } } return False; } #endif /* _UNICODE */ /* * HISTORY: * * $Log: s_strbuf.c,v $ * Revision 1.79 2016/08/27 17:07:54 slava * o use CDECL instead of __cdecl * * Revision 1.78 2016/08/27 17:01:58 slava * o define __cdecl for non-Microsoft compilers * * Revision 1.77 2016/08/27 14:30:43 slava * o removed unnecessary check from STRBUF_AppendFormatVa * * Revision 1.76 2016/08/27 13:51:38 slava * o STRBUF_ReplaceStr should always search from the beginning * * Revision 1.75 2016/08/27 13:27:39 slava * o removed unnecessary check from STRBUF_GetString. If sb->len is not * zero then sb->s must not be NULL, otherwise something is already * broken beyond repair and no additional checks will stop us from * crashing either here or a few steps further * * Revision 1.74 2016/08/27 13:07:56 slava * o eliminated some duplicate code * * Revision 1.73 2016/08/27 12:42:39 slava * o removed unnecessary checks from STRBUF_StartsWithOffsetNoCase * and STRBUF_StartsWithOffset functions * * Revision 1.72 2016/08/21 21:25:15 slava * o STRBUF_InsertChar shouldn't allow to insert NULL characters * o minor optimization in STRBUF_Append * * Revision 1.71 2016/08/21 15:08:42 slava * o added STRBUF_CopyBuf function * * Revision 1.70 2016/08/21 14:35:14 slava * o STRBUF_IndexOf and STRBUF_LastIndexOf shouldn't consider NULL character * to be part of the string (even though strchr and strrchr do) * * Revision 1.69 2016/08/21 14:13:30 slava * o fixed possible crash in STRBUF_CharAt (when position is zero and no * memory has been allocated yet) * * Revision 1.68 2015/11/22 16:26:46 slava * o use STRING_FormatDouble to format floating point numbers * * Revision 1.67 2015/08/16 16:07:33 slava * o housekeeping * * Revision 1.66 2013/10/24 21:33:57 slava * o ASSERT that Unicode-related sprintf-style functions are not invoked * in NT kernel envronment at IRQL >= DISPATCH_LEVEL * * Revision 1.65 2012/08/03 16:45:43 slava * o fixed 64-bit compilation warning (this time correctly) * * Revision 1.64 2012/07/14 09:10:43 slava * o fixed a bug in STRBUF_ReplaceStr (signed vs unsigned) * * Revision 1.63 2011/02/16 18:25:50 slava * o fixed a bug in STRBUF_AppendUTF8 (affected the case if resize is needed) * * Revision 1.62 2010/10/25 09:49:00 slava * o use va_copy (if available) when we need to reuse va_list * * Revision 1.61 2010/07/04 09:44:30 slava * o need to check for UTF8_Length failure in STRBUF_AppendUTF8 to handle * the case of broken UTF-8 strings * * Revision 1.60 2010/07/03 12:13:27 slava * o more UTF-8 stuff * * Revision 1.59 2010/03/10 21:16:25 slava * o added STRBUF_EqualsNoCase and STRBUF_EqualsToNoCase functions * * Revision 1.58 2010/02/15 17:54:42 slava * o changed STRBUF_Dup to better handle empty strings - it would crash on a * freshly initialized string buffer * * Revision 1.57 2009/12/26 12:21:32 slava * o working on 64-bit issues * * Revision 1.56 2009/04/13 18:25:07 slava * o reduced number of warnings in 64-bit build * * Revision 1.55 2006/07/17 20:58:23 slava * o workaround against strange behavior of vsnprintf in NT kernel environment * * Revision 1.54 2005/10/19 21:39:58 slava * o fixed a bug in STRBUF_FindLast * o added STRBUF_FindLastNoCase function * * Revision 1.53 2005/08/26 21:11:39 slava * o added STRBUF_StartsWithNoCase and STRBUF_EndsWithNoCase functions * * Revision 1.52 2005/08/24 01:19:20 slava * o added STRBUF_FindNoCase and STRBUF_FindFromNoCase functions * * Revision 1.51 2005/02/20 20:31:30 slava * o porting SLIB to EPOC gcc compiler * * Revision 1.50 2005/01/23 16:02:43 slava * o added STRBUF_Dup function * * Revision 1.49 2004/12/31 01:53:55 slava * o added STRBUF_AppendBuf function * * Revision 1.48 2004/11/08 06:56:03 slava * o new functions: STRBUF_InitBuf2, STRBUF_Find, STRBUF_FindFrom, * STRBUF_FindLast, STRBUF_ReplaceStr and STRBUF_InsertN * * Revision 1.47 2004/10/20 00:38:15 slava * o use const pointer if we are not planning to modify the string * * Revision 1.46 2004/04/08 01:44:17 slava * o made it compilable with C++ compiler * * Revision 1.45 2004/03/25 19:06:00 slava * o fixed a few pedantic compilation warnings * * Revision 1.44 2003/11/30 02:49:58 slava * o port to Linux kernel mode environment * * Revision 1.43 2003/07/28 05:04:49 slava * o added STRBUF_Create and STRBUF_Delete functions * * Revision 1.42 2003/05/21 00:11:04 slava * o resolved the issue with the Bool type being defined in two places; * in s_def.h and in s_os.h; which prevented slib headers from being * compiled by the GNU compiler in C++ mode. The downside is that now * s_mem.h has to be included from every file referencing slib memory * allocation functions and macros, but that should not be a problem * for the apps because the apps (at least mine) typically include * the whole s_lib.h rather than the individual headers. * * Revision 1.41 2003/03/18 16:52:44 slava * o added Unicode build configurations for Windoze * * Revision 1.40 2003/02/13 23:15:54 slava * o fixed a bug STRBUF_EqualsTo - empty string buffer wasn't always * equal to an empty string * * Revision 1.39 2002/11/23 05:33:03 slava * o fixed a bug in STRBUF_AppendN - it was reading one byte more than necessary * from the input buffer. If the input buffer ends exactly at the end of the * page and the next page is not mapped, this could cause a crash. * * Revision 1.38 2002/08/27 11:52:03 slava * o some reformatting * * Revision 1.37 2002/07/08 06:56:41 slava * o fixed a bug in STRBUF_AppendN * * Revision 1.36 2002/07/01 04:19:54 slava * o no time zone information on WinCE (yet) * * Revision 1.35 2002/07/01 02:39:20 slava * o compile STRBUF_AppendTime and STRBUF_FormatTime on WinCE * * Revision 1.34 2002/05/31 06:56:08 slava * o added STRBUF_ToUpperCase and STRBUF_ToLowerCase * * Revision 1.33 2002/05/22 04:04:55 slava * o renamed s_buf files into s_strbuf, renamed STRBUF_Read into * FILE_ReadLine and moved it to s_file module. * * Revision 1.32 2002/02/25 16:03:49 slava * o optimized STRBUF_Read to avoid unnecessary memory allocations * * Revision 1.31 2002/01/22 05:04:58 slava * o call tzset() before using tzname for the first time * * Revision 1.30 2001/12/31 01:03:23 slava * o added another ASSERT * * Revision 1.29 2001/12/23 18:41:16 slava * o moved STRING functions to s_str.c * o added STRING_ToMultiByte and STRING_ToUnicode * * Revision 1.28 2001/12/20 10:44:31 slava * o port to Windows CE * * Revision 1.27 2001/12/20 02:47:33 slava * o added STRING_StartsWith and STRING_EndsWith * * Revision 1.26 2001/12/07 03:26:40 slava * o added STRBUF_Replace() function * * Revision 1.25 2001/12/01 06:52:44 slava * o do not ASSERT if STRBUF_Destroy() is called twice for the same object * * Revision 1.24 2001/11/10 11:42:49 slava * o added STRBUF_Trim() * * Revision 1.23 2001/11/09 11:52:58 slava * o quite a few bug fixes. This only affects UNICODE build (i.e. WinCE) * * Revision 1.22 2001/10/22 00:25:36 slava * o fixed a bug in STRBUF_Read * * Revision 1.21 2001/10/09 05:40:15 slava * o STRBUF_AppendN() new returns True when asked to append 0 characters * * Revision 1.20 2001/10/08 05:17:51 slava * o eliminated some strict gcc warnings (mostly shadow declarations) * * Revision 1.19 2001/08/06 07:10:34 slava * o fixed a Unicode specific bug (affects Windows CE build) * * Revision 1.18 2001/06/27 03:01:51 slava * o slightly optimized STRING_HashCode() and STRING_HashCodeNoCase() * * Revision 1.17 2001/06/27 01:56:34 slava * o added STRING_HashCode() and STRING_HashCodeNoCase() functions * * Revision 1.16 2001/05/30 04:42:13 slava * o from now on this code is distributed under BSD-style license which * permits unlimited redistribution and use in source and binary forms * * Revision 1.15 2001/05/27 11:45:51 slava * o port to NT kernel mode environment * * Revision 1.14 2001/05/18 22:36:57 slava * o THIS_FILE variable is no longer being used * * Revision 1.13 2001/05/18 22:29:54 slava * o slib has been (partially) ported to Windows CE * * Revision 1.12 2001/01/03 09:18:23 slava * o new file I/O support for transparent access to plain or compressed * files, sockets, etc. * * Revision 1.11 2000/12/25 04:39:27 slava * o added STRBUF_Equals() and STRBUF_EqualsTo() functions and * STRBUF_INIT() macro * * Revision 1.10 2000/11/17 17:05:18 slava * o fixed bug in STRBUF_AppendN (assumption was made that buffer * allocated STRBUF_Alloc() was always null-terminated, but it * wasn't the case if a fresh buffer was realloc'ed rather than * malloc'ed). Fixed STRBUF_AppendN not to make this assumption * and STRBUF_Alloc() to malloc fresh buffers * * Revision 1.9 2000/11/17 05:24:04 slava * o STRBUF_CopyFromN() has been renamed into STRBUF_CopyN() * o STRBUF_CopyFrom() and STRBUF_Copy() were doing the same thing - * removed STRBUF_CopyFrom() * * Revision 1.8 2000/11/12 11:45:22 slava * o fixed bug in STRBUF_AppendFormatVa() which could try to reallocate * a bad (allocated on stack) memory block * * Revision 1.7 2000/11/01 13:25:05 slava * o replaced TRUE/FALSE with True/False * * Revision 1.6 2000/09/18 07:04:09 slava * o new functions: STRBUF_AppendFormat(), STRBUF_AppendFormatVa() and * STRBUF_FormatVa() * * Revision 1.5 2000/09/16 03:43:55 slava * o fixed compilation warning produced by gcc -03 * * Revision 1.4 2000/09/03 00:34:50 slava * o added STRBUF_AppendN() function * * Revision 1.3 2000/09/02 13:18:34 slava * o added STRBUF_IndexOf() and STRBUF_LastIndexOf() * * Revision 1.2 2000/08/19 05:07:58 slava * o fixed "signed/unsigned mismatch" warnings issued by Microsoft * VC 6.0 compiler * * Revision 1.1 2000/08/19 04:48:58 slava * o initial checkin * * Local Variables: * c-basic-offset: 4 * indent-tabs-mode: nil * compile-command: "make -C .." * End: */
83807ff675162bbf6b7f668d912f36a853c1252e
fea15ed27900af8442bd20c703040f8482487b28
/client.h
655cf2ebef77bd1ee527409273aa1aeb80cf2f2e
[]
no_license
ytailor/ftp
2b6706fd09603de0206f1add1df424be5b876187
03858d22884e8cc0148ab3a546cda1dadcfc96b0
refs/heads/master
2016-09-06T19:04:14.435374
2014-05-23T16:43:50
2014-05-23T16:43:50
null
0
0
null
null
null
null
UTF-8
C
false
false
1,420
h
client.h
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* client.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ytailor <ytailor@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2014/05/18 22:51:15 by ytailor #+# #+# */ /* Updated: 2014/05/18 23:00:12 by ytailor ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef CLIENT_H # define CLIENT_H # include <unistd.h> # include <stdlib.h> # include <sys/socket.h> # include <netdb.h> # include <netinet/in.h> # include <arpa/inet.h> # include <fcntl.h> # include <sys/stat.h> # include <sys/mman.h> # include "libft/includes/libft.h" /* ** ft_client.c */ void ft_get_response(int sock, char *str); int ft_error(int nb); int ft_create_client(char *addr, int port); /* ** ft_get_put.c */ void ft_get_file(int sock, char *file); void ft_put_file(int sock, char *file); #endif
e5c7b1bb0b7de67653e72ca3fd684f20ae4415cb
bec784321a1439820d1ddda0342867c1da2eed25
/thirdparty/openldap-2.4.25/contrib/slapd-modules/lastmod/lastmod.c
10c8b7351eda47b65600fa28c3eea534726f0c71
[ "OLDAP-2.8", "LicenseRef-scancode-warranty-disclaimer", "BSD-4.3RENO", "LicenseRef-scancode-free-unknown", "Apache-2.0" ]
permissive
sarvex/Impala
b701cf218f15e14174714aea3cd35331c38cabcc
e8d9eee772ae58b45a12941933d57d0ab26f99b7
refs/heads/cdh5-trunk
2023-05-13T21:51:35.396275
2023-05-02T03:02:22
2023-05-02T03:02:22
32,574,358
0
0
Apache-2.0
2023-05-02T03:02:23
2015-03-20T09:18:06
C++
UTF-8
C
false
false
24,957
c
lastmod.c
/* lastmod.c - returns last modification info */ /* $OpenLDAP: pkg/ldap/contrib/slapd-modules/lastmod/lastmod.c,v 1.2.2.7 2011/01/04 23:49:32 kurt Exp $ */ /* This work is part of OpenLDAP Software <http://www.openldap.org/>. * * Copyright 2004-2011 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted only as authorized by the OpenLDAP * Public License. * * A copy of this license is available in the file LICENSE in the * top-level directory of the distribution or, alternatively, at * <http://www.OpenLDAP.org/license.html>. */ /* ACKNOWLEDGEMENTS: * This work was initially developed by Pierangelo Masarati for inclusion in * OpenLDAP Software. */ #include "portable.h" #ifdef SLAPD_OVER_LASTMOD #include <stdio.h> #include <ac/string.h> #include <ac/socket.h> #include "slap.h" #include "lutil.h" typedef struct lastmod_info_t { struct berval lmi_rdnvalue; Entry *lmi_e; ldap_pvt_thread_mutex_t lmi_entry_mutex; int lmi_enabled; } lastmod_info_t; struct lastmod_schema_t { ObjectClass *lms_oc_lastmod; AttributeDescription *lms_ad_lastmodDN; AttributeDescription *lms_ad_lastmodType; AttributeDescription *lms_ad_lastmodEnabled; } lastmod_schema; enum lastmodType_e { LASTMOD_ADD = 0, LASTMOD_DELETE, LASTMOD_EXOP, LASTMOD_MODIFY, LASTMOD_MODRDN, LASTMOD_UNKNOWN }; struct berval lastmodType[] = { BER_BVC( "add" ), BER_BVC( "delete" ), BER_BVC( "exop" ), BER_BVC( "modify" ), BER_BVC( "modrdn" ), BER_BVC( "unknown" ), BER_BVNULL }; static struct m_s { char *schema; slap_mask_t flags; int offset; } moc[] = { { "( 1.3.6.1.4.1.4203.666.3.13" "NAME 'lastmod' " "DESC 'OpenLDAP per-database last modification monitoring' " "STRUCTURAL " "SUP top " "MUST cn " "MAY ( " "lastmodDN " "$ lastmodType " "$ description " "$ seeAlso " ") )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE, offsetof( struct lastmod_schema_t, lms_oc_lastmod ) }, { NULL } }, mat[] = { { "( 1.3.6.1.4.1.4203.666.1.28" "NAME 'lastmodDN' " "DESC 'DN of last modification' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 " "NO-USER-MODIFICATION " "USAGE directoryOperation )", SLAP_AT_HIDE, offsetof( struct lastmod_schema_t, lms_ad_lastmodDN ) }, { "( 1.3.6.1.4.1.4203.666.1.29" "NAME 'lastmodType' " "DESC 'Type of last modification' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " "EQUALITY caseIgnoreMatch " "SINGLE-VALUE " "NO-USER-MODIFICATION " "USAGE directoryOperation )", SLAP_AT_HIDE, offsetof( struct lastmod_schema_t, lms_ad_lastmodType ) }, { "( 1.3.6.1.4.1.4203.666.1.30" "NAME 'lastmodEnabled' " "DESC 'Lastmod overlay state' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 " "EQUALITY booleanMatch " "SINGLE-VALUE )", 0, offsetof( struct lastmod_schema_t, lms_ad_lastmodEnabled ) }, { NULL } /* FIXME: what about UUID of last modified entry? */ }; static int lastmod_search( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; int rc; /* if we get here, it must be a success */ rs->sr_err = LDAP_SUCCESS; ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex ); rc = test_filter( op, lmi->lmi_e, op->oq_search.rs_filter ); if ( rc == LDAP_COMPARE_TRUE ) { rs->sr_attrs = op->ors_attrs; rs->sr_flags = 0; rs->sr_entry = lmi->lmi_e; rs->sr_err = send_search_entry( op, rs ); rs->sr_entry = NULL; rs->sr_flags = 0; rs->sr_attrs = NULL; } ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); send_ldap_result( op, rs ); return 0; } static int lastmod_compare( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; Attribute *a; ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex ); if ( get_assert( op ) && ( test_filter( op, lmi->lmi_e, get_assertion( op ) ) != LDAP_COMPARE_TRUE ) ) { rs->sr_err = LDAP_ASSERTION_FAILED; goto return_results; } rs->sr_err = access_allowed( op, lmi->lmi_e, op->oq_compare.rs_ava->aa_desc, &op->oq_compare.rs_ava->aa_value, ACL_COMPARE, NULL ); if ( ! rs->sr_err ) { rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; } rs->sr_err = LDAP_NO_SUCH_ATTRIBUTE; for ( a = attr_find( lmi->lmi_e->e_attrs, op->oq_compare.rs_ava->aa_desc ); a != NULL; a = attr_find( a->a_next, op->oq_compare.rs_ava->aa_desc ) ) { rs->sr_err = LDAP_COMPARE_FALSE; if ( value_find_ex( op->oq_compare.rs_ava->aa_desc, SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH, a->a_nvals, &op->oq_compare.rs_ava->aa_value, op->o_tmpmemctx ) == 0 ) { rs->sr_err = LDAP_COMPARE_TRUE; break; } } return_results:; ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); send_ldap_result( op, rs ); if( rs->sr_err == LDAP_COMPARE_FALSE || rs->sr_err == LDAP_COMPARE_TRUE ) { rs->sr_err = LDAP_SUCCESS; } return rs->sr_err; } static int lastmod_exop( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; /* Temporary */ op->o_bd->bd_info = (BackendInfo *)on->on_info; rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "not allowed within namingContext"; send_ldap_result( op, rs ); rs->sr_text = NULL; return -1; } static int lastmod_modify( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; Modifications *ml; ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex ); if ( !acl_check_modlist( op, lmi->lmi_e, op->orm_modlist ) ) { rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto cleanup; } for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) { Attribute *a; if ( ml->sml_desc != lastmod_schema.lms_ad_lastmodEnabled ) { continue; } if ( ml->sml_op != LDAP_MOD_REPLACE ) { rs->sr_text = "unsupported mod type"; rs->sr_err = LDAP_UNWILLING_TO_PERFORM; goto cleanup; } a = attr_find( lmi->lmi_e->e_attrs, ml->sml_desc ); if ( a == NULL ) { rs->sr_text = "lastmod overlay internal error"; rs->sr_err = LDAP_OTHER; goto cleanup; } ch_free( a->a_vals[ 0 ].bv_val ); ber_dupbv( &a->a_vals[ 0 ], &ml->sml_values[ 0 ] ); if ( a->a_nvals ) { ch_free( a->a_nvals[ 0 ].bv_val ); if ( ml->sml_nvalues && !BER_BVISNULL( &ml->sml_nvalues[ 0 ] ) ) { ber_dupbv( &a->a_nvals[ 0 ], &ml->sml_nvalues[ 0 ] ); } else { ber_dupbv( &a->a_nvals[ 0 ], &ml->sml_values[ 0 ] ); } } if ( strcmp( ml->sml_values[ 0 ].bv_val, "TRUE" ) == 0 ) { lmi->lmi_enabled = 1; } else if ( strcmp( ml->sml_values[ 0 ].bv_val, "FALSE" ) == 0 ) { lmi->lmi_enabled = 0; } else { assert( 0 ); } } rs->sr_err = LDAP_SUCCESS; cleanup:; ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); send_ldap_result( op, rs ); rs->sr_text = NULL; return rs->sr_err; } static int lastmod_op_func( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; Modifications *ml; if ( dn_match( &op->o_req_ndn, &lmi->lmi_e->e_nname ) ) { switch ( op->o_tag ) { case LDAP_REQ_SEARCH: if ( op->ors_scope != LDAP_SCOPE_BASE ) { goto return_referral; } /* process */ return lastmod_search( op, rs ); case LDAP_REQ_COMPARE: return lastmod_compare( op, rs ); case LDAP_REQ_EXTENDED: /* if write, reject; otherwise process */ if ( exop_is_write( op )) { rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "not allowed within namingContext"; goto return_error; } return lastmod_exop( op, rs ); case LDAP_REQ_MODIFY: /* allow only changes to overlay status */ for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) { if ( ad_cmp( ml->sml_desc, slap_schema.si_ad_modifiersName ) != 0 && ad_cmp( ml->sml_desc, slap_schema.si_ad_modifyTimestamp ) != 0 && ad_cmp( ml->sml_desc, slap_schema.si_ad_entryCSN ) != 0 && ad_cmp( ml->sml_desc, lastmod_schema.lms_ad_lastmodEnabled ) != 0 ) { rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "not allowed within namingContext"; goto return_error; } } return lastmod_modify( op, rs ); default: rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "not allowed within namingContext"; goto return_error; } } if ( dnIsSuffix( &op->o_req_ndn, &lmi->lmi_e->e_nname ) ) { goto return_referral; } return SLAP_CB_CONTINUE; return_referral:; op->o_bd->bd_info = (BackendInfo *)on->on_info; rs->sr_ref = referral_rewrite( default_referral, NULL, &op->o_req_dn, op->ors_scope ); if ( !rs->sr_ref ) { rs->sr_ref = default_referral; } rs->sr_err = LDAP_REFERRAL; send_ldap_result( op, rs ); if ( rs->sr_ref != default_referral ) { ber_bvarray_free( rs->sr_ref ); } rs->sr_ref = NULL; return -1; return_error:; op->o_bd->bd_info = (BackendInfo *)on->on_info; send_ldap_result( op, rs ); rs->sr_text = NULL; return -1; } static int best_guess( Operation *op, struct berval *bv_entryCSN, struct berval *bv_nentryCSN, struct berval *bv_modifyTimestamp, struct berval *bv_nmodifyTimestamp, struct berval *bv_modifiersName, struct berval *bv_nmodifiersName ) { if ( bv_entryCSN ) { char csnbuf[ LDAP_PVT_CSNSTR_BUFSIZE ]; struct berval entryCSN; entryCSN.bv_val = csnbuf; entryCSN.bv_len = sizeof( csnbuf ); slap_get_csn( NULL, &entryCSN, 0 ); ber_dupbv( bv_entryCSN, &entryCSN ); ber_dupbv( bv_nentryCSN, &entryCSN ); } if ( bv_modifyTimestamp ) { char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; struct berval timestamp; time_t currtime; /* best guess */ #if 0 currtime = slap_get_time(); #endif /* maybe we better use the time the operation was initiated */ currtime = op->o_time; timestamp.bv_val = tmbuf; timestamp.bv_len = sizeof(tmbuf); slap_timestamp( &currtime, &timestamp ); ber_dupbv( bv_modifyTimestamp, &timestamp ); ber_dupbv( bv_nmodifyTimestamp, bv_modifyTimestamp ); } if ( bv_modifiersName ) { /* best guess */ ber_dupbv( bv_modifiersName, &op->o_dn ); ber_dupbv( bv_nmodifiersName, &op->o_ndn ); } return 0; } static int lastmod_update( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; Attribute *a; Modifications *ml = NULL; struct berval bv_entryCSN = BER_BVNULL, bv_nentryCSN = BER_BVNULL, bv_modifyTimestamp = BER_BVNULL, bv_nmodifyTimestamp = BER_BVNULL, bv_modifiersName = BER_BVNULL, bv_nmodifiersName = BER_BVNULL, bv_name = BER_BVNULL, bv_nname = BER_BVNULL; enum lastmodType_e lmt = LASTMOD_UNKNOWN; Entry *e = NULL; int rc = -1; /* FIXME: timestamp? modifier? */ switch ( op->o_tag ) { case LDAP_REQ_ADD: lmt = LASTMOD_ADD; e = op->ora_e; a = attr_find( e->e_attrs, slap_schema.si_ad_entryCSN ); if ( a != NULL ) { ber_dupbv( &bv_entryCSN, &a->a_vals[0] ); if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) { ber_dupbv( &bv_nentryCSN, &a->a_nvals[0] ); } else { ber_dupbv( &bv_nentryCSN, &a->a_vals[0] ); } } a = attr_find( e->e_attrs, slap_schema.si_ad_modifyTimestamp ); if ( a != NULL ) { ber_dupbv( &bv_modifyTimestamp, &a->a_vals[0] ); if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) { ber_dupbv( &bv_nmodifyTimestamp, &a->a_nvals[0] ); } else { ber_dupbv( &bv_nmodifyTimestamp, &a->a_vals[0] ); } } a = attr_find( e->e_attrs, slap_schema.si_ad_modifiersName ); if ( a != NULL ) { ber_dupbv( &bv_modifiersName, &a->a_vals[0] ); ber_dupbv( &bv_nmodifiersName, &a->a_nvals[0] ); } ber_dupbv( &bv_name, &e->e_name ); ber_dupbv( &bv_nname, &e->e_nname ); break; case LDAP_REQ_DELETE: lmt = LASTMOD_DELETE; best_guess( op, &bv_entryCSN, &bv_nentryCSN, &bv_modifyTimestamp, &bv_nmodifyTimestamp, &bv_modifiersName, &bv_nmodifiersName ); ber_dupbv( &bv_name, &op->o_req_dn ); ber_dupbv( &bv_nname, &op->o_req_ndn ); break; case LDAP_REQ_EXTENDED: lmt = LASTMOD_EXOP; /* actually, password change is wrapped around a backend * call to modify, so it never shows up as an exop... */ best_guess( op, &bv_entryCSN, &bv_nentryCSN, &bv_modifyTimestamp, &bv_nmodifyTimestamp, &bv_modifiersName, &bv_nmodifiersName ); ber_dupbv( &bv_name, &op->o_req_dn ); ber_dupbv( &bv_nname, &op->o_req_ndn ); break; case LDAP_REQ_MODIFY: lmt = LASTMOD_MODIFY; rc = 3; for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) { if ( ad_cmp( ml->sml_desc , slap_schema.si_ad_modifiersName ) == 0 ) { ber_dupbv( &bv_modifiersName, &ml->sml_values[0] ); ber_dupbv( &bv_nmodifiersName, &ml->sml_nvalues[0] ); rc--; if ( !rc ) { break; } } else if ( ad_cmp( ml->sml_desc, slap_schema.si_ad_entryCSN ) == 0 ) { ber_dupbv( &bv_entryCSN, &ml->sml_values[0] ); if ( ml->sml_nvalues && !BER_BVISNULL( &ml->sml_nvalues[0] ) ) { ber_dupbv( &bv_nentryCSN, &ml->sml_nvalues[0] ); } else { ber_dupbv( &bv_nentryCSN, &ml->sml_values[0] ); } rc --; if ( !rc ) { break; } } else if ( ad_cmp( ml->sml_desc, slap_schema.si_ad_modifyTimestamp ) == 0 ) { ber_dupbv( &bv_modifyTimestamp, &ml->sml_values[0] ); if ( ml->sml_nvalues && !BER_BVISNULL( &ml->sml_nvalues[0] ) ) { ber_dupbv( &bv_nmodifyTimestamp, &ml->sml_nvalues[0] ); } else { ber_dupbv( &bv_nmodifyTimestamp, &ml->sml_values[0] ); } rc --; if ( !rc ) { break; } } } /* if rooted at global overlay, opattrs are not yet in place */ if ( BER_BVISNULL( &bv_modifiersName ) ) { best_guess( op, NULL, NULL, NULL, NULL, &bv_modifiersName, &bv_nmodifiersName ); } if ( BER_BVISNULL( &bv_entryCSN ) ) { best_guess( op, &bv_entryCSN, &bv_nentryCSN, NULL, NULL, NULL, NULL ); } if ( BER_BVISNULL( &bv_modifyTimestamp ) ) { best_guess( op, NULL, NULL, &bv_modifyTimestamp, &bv_nmodifyTimestamp, NULL, NULL ); } ber_dupbv( &bv_name, &op->o_req_dn ); ber_dupbv( &bv_nname, &op->o_req_ndn ); break; case LDAP_REQ_MODRDN: lmt = LASTMOD_MODRDN; e = NULL; if ( op->orr_newSup && !BER_BVISNULL( op->orr_newSup ) ) { build_new_dn( &bv_name, op->orr_newSup, &op->orr_newrdn, NULL ); build_new_dn( &bv_nname, op->orr_nnewSup, &op->orr_nnewrdn, NULL ); } else { struct berval pdn; dnParent( &op->o_req_dn, &pdn ); build_new_dn( &bv_name, &pdn, &op->orr_newrdn, NULL ); dnParent( &op->o_req_ndn, &pdn ); build_new_dn( &bv_nname, &pdn, &op->orr_nnewrdn, NULL ); } if ( on->on_info->oi_orig->bi_entry_get_rw ) { BackendInfo *bi = op->o_bd->bd_info; int rc; op->o_bd->bd_info = (BackendInfo *)on->on_info->oi_orig; rc = op->o_bd->bd_info->bi_entry_get_rw( op, &bv_name, NULL, NULL, 0, &e ); if ( rc == LDAP_SUCCESS ) { a = attr_find( e->e_attrs, slap_schema.si_ad_modifiersName ); if ( a != NULL ) { ber_dupbv( &bv_modifiersName, &a->a_vals[0] ); ber_dupbv( &bv_nmodifiersName, &a->a_nvals[0] ); } a = attr_find( e->e_attrs, slap_schema.si_ad_entryCSN ); if ( a != NULL ) { ber_dupbv( &bv_entryCSN, &a->a_vals[0] ); if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) { ber_dupbv( &bv_nentryCSN, &a->a_nvals[0] ); } else { ber_dupbv( &bv_nentryCSN, &a->a_vals[0] ); } } a = attr_find( e->e_attrs, slap_schema.si_ad_modifyTimestamp ); if ( a != NULL ) { ber_dupbv( &bv_modifyTimestamp, &a->a_vals[0] ); if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) { ber_dupbv( &bv_nmodifyTimestamp, &a->a_nvals[0] ); } else { ber_dupbv( &bv_nmodifyTimestamp, &a->a_vals[0] ); } } assert( dn_match( &bv_name, &e->e_name ) ); assert( dn_match( &bv_nname, &e->e_nname ) ); op->o_bd->bd_info->bi_entry_release_rw( op, e, 0 ); } op->o_bd->bd_info = bi; } /* if !bi_entry_get_rw || bi_entry_get_rw failed for any reason... */ if ( e == NULL ) { best_guess( op, &bv_entryCSN, &bv_nentryCSN, &bv_modifyTimestamp, &bv_nmodifyTimestamp, &bv_modifiersName, &bv_nmodifiersName ); } break; default: return -1; } ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex ); #if 0 fprintf( stderr, "### lastmodDN: %s %s\n", bv_name.bv_val, bv_nname.bv_val ); #endif a = attr_find( lmi->lmi_e->e_attrs, lastmod_schema.lms_ad_lastmodDN ); if ( a == NULL ) { goto error_return; } ch_free( a->a_vals[0].bv_val ); a->a_vals[0] = bv_name; ch_free( a->a_nvals[0].bv_val ); a->a_nvals[0] = bv_nname; #if 0 fprintf( stderr, "### lastmodType: %s %s\n", lastmodType[ lmt ].bv_val, lastmodType[ lmt ].bv_val ); #endif a = attr_find( lmi->lmi_e->e_attrs, lastmod_schema.lms_ad_lastmodType ); if ( a == NULL ) { goto error_return; } ch_free( a->a_vals[0].bv_val ); ber_dupbv( &a->a_vals[0], &lastmodType[ lmt ] ); ch_free( a->a_nvals[0].bv_val ); ber_dupbv( &a->a_nvals[0], &lastmodType[ lmt ] ); #if 0 fprintf( stderr, "### modifiersName: %s %s\n", bv_modifiersName.bv_val, bv_nmodifiersName.bv_val ); #endif a = attr_find( lmi->lmi_e->e_attrs, slap_schema.si_ad_modifiersName ); if ( a == NULL ) { goto error_return; } ch_free( a->a_vals[0].bv_val ); a->a_vals[0] = bv_modifiersName; ch_free( a->a_nvals[0].bv_val ); a->a_nvals[0] = bv_nmodifiersName; #if 0 fprintf( stderr, "### modifyTimestamp: %s %s\n", bv_nmodifyTimestamp.bv_val, bv_modifyTimestamp.bv_val ); #endif a = attr_find( lmi->lmi_e->e_attrs, slap_schema.si_ad_modifyTimestamp ); if ( a == NULL ) { goto error_return; } ch_free( a->a_vals[0].bv_val ); a->a_vals[0] = bv_modifyTimestamp; ch_free( a->a_nvals[0].bv_val ); a->a_nvals[0] = bv_nmodifyTimestamp; #if 0 fprintf( stderr, "### entryCSN: %s %s\n", bv_nentryCSN.bv_val, bv_entryCSN.bv_val ); #endif a = attr_find( lmi->lmi_e->e_attrs, slap_schema.si_ad_entryCSN ); if ( a == NULL ) { goto error_return; } ch_free( a->a_vals[0].bv_val ); a->a_vals[0] = bv_entryCSN; ch_free( a->a_nvals[0].bv_val ); a->a_nvals[0] = bv_nentryCSN; rc = 0; error_return:; ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); return rc; } static int lastmod_response( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; /* don't record failed operations */ switch ( rs->sr_err ) { case LDAP_SUCCESS: /* FIXME: other cases? */ break; default: return SLAP_CB_CONTINUE; } /* record only write operations */ switch ( op->o_tag ) { case LDAP_REQ_ADD: case LDAP_REQ_MODIFY: case LDAP_REQ_MODRDN: case LDAP_REQ_DELETE: break; case LDAP_REQ_EXTENDED: /* if write, process */ if ( exop_is_write( op )) break; /* fall thru */ default: return SLAP_CB_CONTINUE; } /* skip if disabled */ ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex ); if ( !lmi->lmi_enabled ) { ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); return SLAP_CB_CONTINUE; } ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); (void)lastmod_update( op, rs ); return SLAP_CB_CONTINUE; } static int lastmod_db_init( BackendDB *be ) { slap_overinst *on = (slap_overinst *)be->bd_info; lastmod_info_t *lmi; if ( lastmod_schema.lms_oc_lastmod == NULL ) { int i; const char *text; /* schema integration */ for ( i = 0; mat[i].schema; i++ ) { int code; AttributeDescription **ad = ((AttributeDescription **)&(((char *)&lastmod_schema)[mat[i].offset])); ad[0] = NULL; code = register_at( mat[i].schema, ad, 0 ); if ( code ) { Debug( LDAP_DEBUG_ANY, "lastmod_init: register_at failed\n", 0, 0, 0 ); return -1; } (*ad)->ad_type->sat_flags |= mat[i].flags; } for ( i = 0; moc[i].schema; i++ ) { int code; ObjectClass **Oc = ((ObjectClass **)&(((char *)&lastmod_schema)[moc[i].offset])); code = register_oc( moc[i].schema, Oc, 0 ); if ( code ) { Debug( LDAP_DEBUG_ANY, "lastmod_init: register_oc failed\n", 0, 0, 0 ); return -1; } (*Oc)->soc_flags |= moc[i].flags; } } lmi = (lastmod_info_t *)ch_malloc( sizeof( lastmod_info_t ) ); memset( lmi, 0, sizeof( lastmod_info_t ) ); lmi->lmi_enabled = 1; on->on_bi.bi_private = lmi; return 0; } static int lastmod_db_config( BackendDB *be, const char *fname, int lineno, int argc, char **argv ) { slap_overinst *on = (slap_overinst *)be->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; if ( strcasecmp( argv[ 0 ], "lastmod-rdnvalue" ) == 0 ) { if ( lmi->lmi_rdnvalue.bv_val ) { /* already defined! */ ch_free( lmi->lmi_rdnvalue.bv_val ); } ber_str2bv( argv[ 1 ], 0, 1, &lmi->lmi_rdnvalue ); } else if ( strcasecmp( argv[ 0 ], "lastmod-enabled" ) == 0 ) { if ( strcasecmp( argv[ 1 ], "yes" ) == 0 ) { lmi->lmi_enabled = 1; } else if ( strcasecmp( argv[ 1 ], "no" ) == 0 ) { lmi->lmi_enabled = 0; } else { return -1; } } else { return SLAP_CONF_UNKNOWN; } return 0; } static int lastmod_db_open( BackendDB *be ) { slap_overinst *on = (slap_overinst *) be->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; char buf[ 8192 ]; static char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; char csnbuf[ LDAP_PVT_CSNSTR_BUFSIZE ]; struct berval entryCSN; struct berval timestamp; if ( !SLAP_LASTMOD( be ) ) { fprintf( stderr, "set \"lastmod on\" to make this overlay effective\n" ); return -1; } /* * Start */ timestamp.bv_val = tmbuf; timestamp.bv_len = sizeof(tmbuf); slap_timestamp( &starttime, &timestamp ); entryCSN.bv_val = csnbuf; entryCSN.bv_len = sizeof( csnbuf ); slap_get_csn( NULL, &entryCSN, 0 ); if ( BER_BVISNULL( &lmi->lmi_rdnvalue ) ) { ber_str2bv( "Lastmod", 0, 1, &lmi->lmi_rdnvalue ); } snprintf( buf, sizeof( buf ), "dn: cn=%s%s%s\n" "objectClass: %s\n" "structuralObjectClass: %s\n" "cn: %s\n" "description: This object contains the last modification to this database\n" "%s: cn=%s%s%s\n" "%s: %s\n" "%s: %s\n" "createTimestamp: %s\n" "creatorsName: %s\n" "entryCSN: %s\n" "modifyTimestamp: %s\n" "modifiersName: %s\n" "hasSubordinates: FALSE\n", lmi->lmi_rdnvalue.bv_val, BER_BVISEMPTY( &be->be_suffix[ 0 ] ) ? "" : ",", be->be_suffix[ 0 ].bv_val, lastmod_schema.lms_oc_lastmod->soc_cname.bv_val, lastmod_schema.lms_oc_lastmod->soc_cname.bv_val, lmi->lmi_rdnvalue.bv_val, lastmod_schema.lms_ad_lastmodDN->ad_cname.bv_val, lmi->lmi_rdnvalue.bv_val, BER_BVISEMPTY( &be->be_suffix[ 0 ] ) ? "" : ",", be->be_suffix[ 0 ].bv_val, lastmod_schema.lms_ad_lastmodType->ad_cname.bv_val, lastmodType[ LASTMOD_ADD ].bv_val, lastmod_schema.lms_ad_lastmodEnabled->ad_cname.bv_val, lmi->lmi_enabled ? "TRUE" : "FALSE", tmbuf, BER_BVISNULL( &be->be_rootdn ) ? SLAPD_ANONYMOUS : be->be_rootdn.bv_val, entryCSN.bv_val, tmbuf, BER_BVISNULL( &be->be_rootdn ) ? SLAPD_ANONYMOUS : be->be_rootdn.bv_val ); #if 0 fprintf( stderr, "# entry:\n%s\n", buf ); #endif lmi->lmi_e = str2entry( buf ); if ( lmi->lmi_e == NULL ) { return -1; } ldap_pvt_thread_mutex_init( &lmi->lmi_entry_mutex ); return 0; } static int lastmod_db_destroy( BackendDB *be ) { slap_overinst *on = (slap_overinst *)be->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; if ( lmi ) { if ( !BER_BVISNULL( &lmi->lmi_rdnvalue ) ) { ch_free( lmi->lmi_rdnvalue.bv_val ); } if ( lmi->lmi_e ) { entry_free( lmi->lmi_e ); ldap_pvt_thread_mutex_destroy( &lmi->lmi_entry_mutex ); } ch_free( lmi ); } return 0; } /* This overlay is set up for dynamic loading via moduleload. For static * configuration, you'll need to arrange for the slap_overinst to be * initialized and registered by some other function inside slapd. */ static slap_overinst lastmod; int lastmod_initialize() { lastmod.on_bi.bi_type = "lastmod"; lastmod.on_bi.bi_db_init = lastmod_db_init; lastmod.on_bi.bi_db_config = lastmod_db_config; lastmod.on_bi.bi_db_destroy = lastmod_db_destroy; lastmod.on_bi.bi_db_open = lastmod_db_open; lastmod.on_bi.bi_op_add = lastmod_op_func; lastmod.on_bi.bi_op_compare = lastmod_op_func; lastmod.on_bi.bi_op_delete = lastmod_op_func; lastmod.on_bi.bi_op_modify = lastmod_op_func; lastmod.on_bi.bi_op_modrdn = lastmod_op_func; lastmod.on_bi.bi_op_search = lastmod_op_func; lastmod.on_bi.bi_extended = lastmod_op_func; lastmod.on_response = lastmod_response; return overlay_register( &lastmod ); } #if SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC int init_module( int argc, char *argv[] ) { return lastmod_initialize(); } #endif /* SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC */ #endif /* defined(SLAPD_OVER_LASTMOD) */
b832eb62024f6933c17bb1476433f0b34796f16e
8b007daa5863d0ffc0bb0d36dd9c4b1c56cde786
/hackerrank/bucket_sort/bs.c
307164091852a9ff1a189d0f7eae344462ad8561
[]
no_license
gawande/practicerepo
573d1d4120599659723f4b75c2ec01bd3f6ac682
edab3d02097ae286d7b98974f387c9c7e34dac95
refs/heads/master
2020-06-04T13:56:23.473398
2019-03-16T06:21:03
2019-03-16T06:21:03
33,526,983
0
0
null
null
null
null
UTF-8
C
false
false
818
c
bs.c
#include "../singly_linked_list.h" #include <math.h> void bucketSort(object*,int); int main(){ object* arr; int arraySize=fillArray(&arr); printArray(arr,arraySize); bucketSort(arr,arraySize); printArray(arr,arraySize); //node* head=NULL; //insertInOrder(&head,arr[0]); //insertInOrder(&head,arr[1]); //insertInOrder(&head,arr[2]); //insertInOrder(&head,arr[3]); return 0; } void bucketSort(object arr[],int n){ node* buckets[n]; int i; for(i=0;i<n;i++){ buckets[i]=NULL; } for(i=0;i<n;i++){ insertInOrder(&buckets[(int)floor((double)n*(arr[i].key))],arr[i]); } printf("BUCKETS\n"); for(i=0;i<n;i++){ printf("%d : ",i); printList(buckets[i]); } int j=0; for(i=0;i<n;i++){ while(buckets[i]!=NULL){ arr[j++]=buckets[i]->data; removeFromHead(&buckets[i]); } } }
a7b4da234ef30e90f7173b4ad71dc162bcdfd3d6
1390cb4f58bd09087184a64fe2838dec29600d8a
/8846.c
2d6b14f16a89fae3eaa0af17ba663df8e2018454
[]
no_license
imasker/obfuscatorTestCases
bf21352be1dbd6c8bdd868b093af03f315d92a45
5f5561846ec09a040b42dc12842c9581e7be6b4d
refs/heads/master
2023-03-27T11:35:21.843689
2021-03-25T07:38:05
2021-03-25T07:38:05
351,342,479
0
0
null
null
null
null
UTF-8
C
false
false
200,533
c
8846.c
/* * This is a RANDOMLY GENERATED PROGRAM. * * Generator: csmith 2.3.0 * Git version: 30dccd7 * Options: -o /home/x/obfuscator/data/programs/8846.c * Seed: 1933113060 */ #include "csmith.h" static long __undefined; /* --- Struct/Union Declarations --- */ struct S0 { const volatile int32_t f0; volatile uint8_t f1; volatile signed f2 : 24; uint16_t f3; int16_t f4; volatile int32_t f5; const int8_t f6; uint32_t f7; volatile int64_t f8; }; union U1 { volatile uint8_t f0; volatile int64_t f1; int8_t * f2; }; /* --- GLOBAL VARIABLES --- */ static volatile int8_t g_7 = 3L;/* VOLATILE GLOBAL g_7 */ static volatile int8_t *g_6 = &g_7; static uint16_t g_28[8] = {0xEF9AL,0xEF9AL,0xEF9AL,0xEF9AL,0xEF9AL,0xEF9AL,0xEF9AL,0xEF9AL}; static int8_t g_30 = (-8L); static uint64_t g_93[3] = {0x2D3B6D3E8DF325ECLL,0x2D3B6D3E8DF325ECLL,0x2D3B6D3E8DF325ECLL}; static int32_t g_98 = 0xD787CCB4L; static int32_t g_143 = 1L; static uint32_t g_145 = 0xC1DEFFE8L; static uint16_t g_146 = 65530UL; static int16_t g_169 = 0x8D7AL; static int16_t g_171 = 0x1C6EL; static uint32_t g_192 = 0x41E3A302L; static uint32_t g_199 = 1UL; static int32_t *g_202 = &g_143; static int8_t g_208 = (-9L); static int32_t g_209 = 0xE3192B74L; static uint32_t g_211 = 0x25431BEDL; static uint8_t g_219 = 1UL; static uint32_t g_238 = 0x194EF103L; static int64_t g_252 = 0x30B18F1BF990C31ALL; static int64_t g_256 = 0L; static uint8_t g_329 = 255UL; static int32_t * volatile *g_365 = &g_202; static volatile int8_t **g_402[1][6] = {{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}; static volatile int8_t ***g_401 = &g_402[0][3]; static uint16_t *g_422 = &g_28[2]; static uint16_t ** const g_421 = &g_422; static uint64_t *g_467[7][3] = {{&g_93[2],&g_93[2],&g_93[2]},{(void*)0,&g_93[2],&g_93[1]},{&g_93[2],&g_93[2],&g_93[1]},{&g_93[2],(void*)0,&g_93[2]},{&g_93[2],&g_93[2],&g_93[2]},{&g_93[2],&g_93[2],&g_93[2]},{&g_93[2],&g_93[2],&g_93[2]}}; static int16_t g_530 = (-6L); static uint16_t g_532 = 0xDC0AL; static uint64_t g_557[9] = {0x9B57CE6A74B907FBLL,0xA75F79AE890F38BFLL,0xA75F79AE890F38BFLL,0x9B57CE6A74B907FBLL,0xA75F79AE890F38BFLL,0xA75F79AE890F38BFLL,0x9B57CE6A74B907FBLL,0xA75F79AE890F38BFLL,1UL}; static uint8_t g_567 = 0xEEL; static const uint8_t g_578 = 0x67L; static uint32_t g_610 = 0UL; static int32_t g_631 = 0L; static uint16_t g_632 = 2UL; static const struct S0 g_636 = {0xF42B542FL,0x6BL,-2076,0x7993L,-3L,0x98496C20L,5L,0x3711DB81L,-1L};/* VOLATILE GLOBAL g_636 */ static struct S0 g_662[5][10] = {{{0x22D6BFA9L,3UL,-808,3UL,-3L,0x9218DEE5L,0L,0x3BBC7A37L,0x1A23FB20CDA878C4LL},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL},{0x416A81A4L,246UL,-1155,0x8C98L,0x2897L,-8L,0x33L,0xCDD67612L,1L},{0L,0x4CL,3599,1UL,0xD26EL,0x66CDA521L,0x97L,0x17CFC046L,0x830D21C66BD0576BLL},{0x3FBBA899L,1UL,-3615,0UL,0xDB66L,0x39EA8E0AL,1L,0x196A1100L,1L},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0x3FBBA899L,1UL,-3615,0UL,0xDB66L,0x39EA8E0AL,1L,0x196A1100L,1L},{0L,0x4CL,3599,1UL,0xD26EL,0x66CDA521L,0x97L,0x17CFC046L,0x830D21C66BD0576BLL},{0x416A81A4L,246UL,-1155,0x8C98L,0x2897L,-8L,0x33L,0xCDD67612L,1L}},{{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0x3FBBA899L,1UL,-3615,0UL,0xDB66L,0x39EA8E0AL,1L,0x196A1100L,1L},{0L,0x4CL,3599,1UL,0xD26EL,0x66CDA521L,0x97L,0x17CFC046L,0x830D21C66BD0576BLL},{0x416A81A4L,246UL,-1155,0x8C98L,0x2897L,-8L,0x33L,0xCDD67612L,1L},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL},{0x22D6BFA9L,3UL,-808,3UL,-3L,0x9218DEE5L,0L,0x3BBC7A37L,0x1A23FB20CDA878C4LL},{0x5DEE8B2CL,255UL,1619,1UL,0L,0xC1CBE477L,-1L,0xD1DC6CD4L,8L},{0x22D6BFA9L,3UL,-808,3UL,-3L,0x9218DEE5L,0L,0x3BBC7A37L,0x1A23FB20CDA878C4LL},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL}},{{0xC6DD9DCCL,0x66L,2805,0x9886L,-10L,6L,-9L,4294967295UL,8L},{0x3FBBA899L,1UL,-3615,0UL,0xDB66L,0x39EA8E0AL,1L,0x196A1100L,1L},{0x7A8503EAL,0x17L,850,0x9E96L,0x7443L,-3L,-7L,4294967289UL,0x277713E27871541CLL},{0x3FBBA899L,1UL,-3615,0UL,0xDB66L,0x39EA8E0AL,1L,0x196A1100L,1L},{0xC6DD9DCCL,0x66L,2805,0x9886L,-10L,6L,-9L,4294967295UL,8L},{8L,0xAFL,-2005,0xCE4BL,0x53B5L,0x3B14E47FL,6L,4294967295UL,-2L},{0x22D6BFA9L,3UL,-808,3UL,-3L,0x9218DEE5L,0L,0x3BBC7A37L,0x1A23FB20CDA878C4LL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0xA7C258A8L,255UL,2921,65529UL,0xD9E4L,-1L,-8L,4294967295UL,1L},{0xA7C258A8L,255UL,2921,65529UL,0xD9E4L,-1L,-8L,4294967295UL,1L}},{{0L,0x4CL,3599,1UL,0xD26EL,0x66CDA521L,0x97L,0x17CFC046L,0x830D21C66BD0576BLL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0x153D8A80L,250UL,1890,0x15CBL,1L,0x7DC391F1L,-1L,4294967294UL,0x42F064A6C492F84BLL},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL},{0x153D8A80L,250UL,1890,0x15CBL,1L,0x7DC391F1L,-1L,4294967294UL,0x42F064A6C492F84BLL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0L,0x4CL,3599,1UL,0xD26EL,0x66CDA521L,0x97L,0x17CFC046L,0x830D21C66BD0576BLL},{0x7A8503EAL,0x17L,850,0x9E96L,0x7443L,-3L,-7L,4294967289UL,0x277713E27871541CLL},{0xA7C258A8L,255UL,2921,65529UL,0xD9E4L,-1L,-8L,4294967295UL,1L}},{{0x5DEE8B2CL,255UL,1619,1UL,0L,0xC1CBE477L,-1L,0xD1DC6CD4L,8L},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{0x2A8F651CL,4UL,-3481,0x826AL,0x8813L,0x0DC23962L,2L,0UL,0L},{0xC6DD9DCCL,0x66L,2805,0x9886L,-10L,6L,-9L,4294967295UL,8L},{0x22D6BFA9L,3UL,-808,3UL,-3L,0x9218DEE5L,0L,0x3BBC7A37L,0x1A23FB20CDA878C4LL},{0xC6DD9DCCL,0x66L,2805,0x9886L,-10L,6L,-9L,4294967295UL,8L},{0x2A8F651CL,4UL,-3481,0x826AL,0x8813L,0x0DC23962L,2L,0UL,0L},{-7L,0UL,1350,1UL,0L,0x0F75BE9EL,0x26L,0x5DA6895BL,0xC8A56B187D94E97ALL},{1L,248UL,101,0x3A76L,0x9F6BL,4L,-4L,4294967292UL,0x2EC222700A5D85D0LL}}}; static struct S0 g_667 = {0xFB1351C2L,0xEFL,1081,65529UL,0x5CCDL,-6L,0xB3L,4294967295UL,0x5EBB6ABE90032489LL};/* VOLATILE GLOBAL g_667 */ static struct S0 *g_666[5] = {&g_667,&g_667,&g_667,&g_667,&g_667}; static struct S0 g_686 = {0x11CB596BL,0x27L,-3080,0x5F53L,1L,0L,-5L,4294967295UL,0xDED9496CB9B563D0LL};/* VOLATILE GLOBAL g_686 */ static uint32_t g_696 = 0xA4A8DAD2L; static int16_t g_737[2] = {(-1L),(-1L)}; static int32_t g_765 = 4L; static int8_t g_766 = 0xF5L; static int64_t g_767 = 5L; static uint8_t g_768 = 0x4FL; static struct S0 g_772 = {-4L,255UL,-2425,0UL,0x4E24L,-9L,0xE6L,4294967293UL,1L};/* VOLATILE GLOBAL g_772 */ static const volatile int32_t g_803 = 0xFAC365C9L;/* VOLATILE GLOBAL g_803 */ static const volatile int32_t *g_802 = &g_803; static const volatile int32_t g_806 = 0x85C732DEL;/* VOLATILE GLOBAL g_806 */ static uint16_t *g_820 = (void*)0; static uint16_t **g_819 = &g_820; static struct S0 **g_826 = (void*)0; static struct S0 g_832 = {6L,255UL,-611,65535UL,0xEE0BL,0L,0x14L,0x66DD93EBL,0x6E78750F94E9FF6ELL};/* VOLATILE GLOBAL g_832 */ static struct S0 *g_831 = &g_832; static struct S0 g_834 = {-1L,0xC1L,1161,65528UL,1L,0L,0x15L,1UL,0x25118E8DEFB1A822LL};/* VOLATILE GLOBAL g_834 */ static struct S0 g_849 = {1L,255UL,-606,1UL,0xFDD1L,0x7266CB8EL,0xF1L,0xCE807389L,0xD0B577242A024416LL};/* VOLATILE GLOBAL g_849 */ static int8_t g_959 = (-1L); static uint64_t * const *g_975 = (void*)0; static int32_t **g_981 = (void*)0; static int32_t ***g_980 = &g_981; static struct S0 ****g_1009 = (void*)0; static struct S0 g_1055 = {0L,0UL,361,1UL,0x66CAL,-1L,0x86L,0x5FE05535L,0xDB24967FD05D22DBLL};/* VOLATILE GLOBAL g_1055 */ static int64_t g_1089 = 1L; static int16_t g_1090 = 0xBC91L; static uint64_t g_1091 = 1UL; static uint64_t g_1098 = 0xF5A2EC9FD615932CLL; static union U1 g_1104 = {0x03L};/* VOLATILE GLOBAL g_1104 */ static union U1 g_1105 = {0UL};/* VOLATILE GLOBAL g_1105 */ static union U1 g_1106 = {0xCCL};/* VOLATILE GLOBAL g_1106 */ static union U1 g_1107 = {0x8FL};/* VOLATILE GLOBAL g_1107 */ static union U1 g_1108[2] = {{0x95L},{0x95L}}; static union U1 g_1109 = {3UL};/* VOLATILE GLOBAL g_1109 */ static union U1 g_1110[9][6] = {{{0UL},{0xB7L},{1UL},{251UL},{0UL},{0x00L}},{{0x5AL},{0UL},{1UL},{255UL},{5UL},{1UL}},{{0x43L},{255UL},{0x00L},{0xF9L},{0x5AL},{1UL}},{{0xF9L},{0x5AL},{1UL},{0x5AL},{0xF9L},{0x00L}},{{0xB7L},{0UL},{1UL},{5UL},{255UL},{1UL}},{{255UL},{0x43L},{0x00L},{0UL},{251UL},{1UL}},{{0UL},{251UL},{1UL},{0xB7L},{0UL},{0x00L}},{{251UL},{0xF9L},{1UL},{0x43L},{0x43L},{1UL}},{{5UL},{5UL},{0x00L},{0UL},{0xB7L},{1UL}}}; static union U1 *g_1103[4][6][4] = {{{(void*)0,&g_1106,&g_1109,&g_1109},{(void*)0,(void*)0,(void*)0,&g_1109},{&g_1105,&g_1106,&g_1105,(void*)0},{&g_1105,(void*)0,(void*)0,&g_1105},{(void*)0,(void*)0,&g_1109,(void*)0},{(void*)0,&g_1106,&g_1109,&g_1109}},{{(void*)0,(void*)0,(void*)0,&g_1109},{&g_1105,&g_1106,&g_1105,(void*)0},{&g_1105,(void*)0,(void*)0,&g_1105},{(void*)0,(void*)0,&g_1109,(void*)0},{(void*)0,&g_1106,&g_1109,&g_1109},{(void*)0,(void*)0,(void*)0,&g_1109}},{{&g_1105,&g_1106,&g_1105,(void*)0},{&g_1105,(void*)0,(void*)0,&g_1105},{(void*)0,(void*)0,&g_1109,(void*)0},{(void*)0,&g_1106,&g_1109,&g_1109},{(void*)0,(void*)0,(void*)0,&g_1109},{&g_1105,&g_1106,&g_1105,(void*)0}},{{&g_1105,(void*)0,(void*)0,&g_1105},{(void*)0,&g_1105,&g_1106,&g_1105},{&g_1105,(void*)0,&g_1106,&g_1106},{(void*)0,(void*)0,&g_1105,&g_1106},{&g_1109,(void*)0,&g_1109,&g_1105},{&g_1109,&g_1105,&g_1105,&g_1109}}}; static int64_t g_1207 = 0xF831EC807DEFB4F7LL; static struct S0 g_1233 = {0x7C636744L,255UL,3528,0xEABCL,8L,-3L,1L,4294967295UL,-7L};/* VOLATILE GLOBAL g_1233 */ static struct S0 g_1235 = {0L,250UL,338,65529UL,-2L,-5L,0L,4294967287UL,-1L};/* VOLATILE GLOBAL g_1235 */ static int8_t g_1268 = 0xD2L; static uint8_t *g_1317 = &g_329; static uint8_t **g_1316 = &g_1317; static uint8_t g_1326 = 0x53L; static struct S0 g_1401 = {0x8ED94B19L,6UL,1681,0x88F0L,1L,-5L,-1L,6UL,0xF4D6B0B1042A69F4LL};/* VOLATILE GLOBAL g_1401 */ static int64_t **g_1406 = (void*)0; static uint32_t g_1434 = 18446744073709551610UL; static uint32_t *g_1463 = (void*)0; static uint32_t **g_1462 = &g_1463; static uint64_t g_1493 = 18446744073709551615UL; static int32_t g_1541 = 7L; static int8_t g_1542[7][5] = {{0xECL,(-2L),(-6L),6L,0x9AL},{(-6L),0x71L,(-2L),(-2L),0x71L},{0x71L,7L,(-6L),0x9AL,(-10L)},{0L,7L,0x9AL,0xD2L,0xB0L},{3L,0x71L,0x71L,3L,0xD2L},{0L,(-2L),(-10L),0L,0xD2L},{0x71L,0L,0xB0L,(-6L),0xB0L}}; static int8_t g_1543 = 8L; static int64_t g_1544 = 1L; static uint16_t g_1545 = 1UL; static int32_t g_1607 = 1L; static int32_t g_1608 = 1L; static uint32_t g_1610 = 0x52A27668L; static int32_t g_1738 = (-1L); static uint32_t g_1739 = 0x3FC8E147L; static struct S0 g_1747 = {0x8C1A81FEL,1UL,-426,0x53C8L,-2L,-1L,-7L,0UL,0x3BCBF86C4FF1FAA4LL};/* VOLATILE GLOBAL g_1747 */ static struct S0 g_1749 = {-9L,8UL,-2157,0x377FL,1L,3L,0L,0x8BEBF189L,2L};/* VOLATILE GLOBAL g_1749 */ static union U1 **g_1767[1][1][8] = {{{&g_1103[1][2][3],&g_1103[3][3][2],&g_1103[1][2][3],&g_1103[3][3][2],&g_1103[1][2][3],&g_1103[3][3][2],&g_1103[1][2][3],&g_1103[3][3][2]}}}; static union U1 ***g_1766 = &g_1767[0][0][3]; static int32_t g_1782 = 0x195A7507L; static volatile uint32_t * const g_1807 = (void*)0; static volatile uint32_t * const *g_1806 = &g_1807; static uint16_t g_1873 = 0xE84EL; static union U1 g_1894 = {0UL};/* VOLATILE GLOBAL g_1894 */ static struct S0 g_1963[1] = {{0x95F1A393L,0x80L,-2410,1UL,0L,0x654044D3L,0L,0UL,-1L}}; static int32_t g_2013 = 0xA68107A6L; static struct S0 *****g_2023 = (void*)0; static volatile uint16_t * volatile * volatile * volatile *g_2094 = (void*)0; static uint16_t g_2109 = 1UL; static uint16_t * const *g_2116[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; static uint16_t * const ** const g_2115 = &g_2116[0]; static uint16_t * const ** const *g_2114[4][8][7] = {{{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,(void*)0,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,(void*)0,(void*)0,&g_2115,&g_2115}},{{&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0},{&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{(void*)0,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115}},{{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,&g_2115},{&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0},{(void*)0,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,(void*)0},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115}},{{&g_2115,&g_2115,(void*)0,&g_2115,&g_2115,&g_2115,(void*)0},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,(void*)0,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,(void*)0,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115},{&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115,&g_2115}}}; static uint16_t g_2121 = 0x5D4DL; static uint16_t g_2122 = 0UL; static uint16_t g_2123 = 0xA6F2L; static uint16_t g_2124 = 0x4000L; static uint16_t g_2125 = 0xE079L; static uint16_t g_2126 = 0x4CF7L; static uint16_t g_2127 = 0x74ECL; static uint16_t g_2128 = 1UL; static uint16_t g_2129[1] = {1UL}; static uint16_t g_2130 = 0x594BL; static uint16_t g_2131 = 0x9DBEL; static uint16_t g_2132 = 4UL; static uint16_t g_2133 = 0xCA92L; static uint16_t g_2134[6] = {1UL,1UL,1UL,1UL,1UL,1UL}; static uint16_t g_2135 = 0x60BFL; static uint16_t g_2136 = 0xAC7AL; static uint16_t g_2137[8] = {1UL,1UL,1UL,1UL,1UL,1UL,1UL,1UL}; static uint16_t * const g_2120[6][9][4] = {{{(void*)0,(void*)0,(void*)0,&g_2128},{(void*)0,&g_2123,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_2126},{(void*)0,(void*)0,&g_2133,(void*)0},{&g_2123,&g_2132,&g_2123,(void*)0},{(void*)0,(void*)0,&g_2124,&g_2136},{&g_2125,(void*)0,&g_2135,(void*)0},{&g_2121,&g_2124,&g_2135,(void*)0},{&g_2125,(void*)0,&g_2124,&g_2134[2]}},{{(void*)0,(void*)0,&g_2123,&g_2125},{&g_2123,&g_2125,&g_2133,&g_2127},{(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&g_2128,(void*)0,&g_2137[6]},{(void*)0,&g_2133,(void*)0,(void*)0},{(void*)0,&g_2129[0],&g_2125,(void*)0},{&g_2130,&g_2133,&g_2122,&g_2137[6]},{(void*)0,&g_2128,&g_2130,(void*)0},{(void*)0,(void*)0,&g_2126,&g_2127}},{{&g_2124,&g_2125,(void*)0,&g_2121},{&g_2132,&g_2123,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_2127},{(void*)0,(void*)0,&g_2123,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_2137[6]},{&g_2132,&g_2126,&g_2128,&g_2135},{(void*)0,&g_2128,(void*)0,(void*)0},{&g_2137[6],&g_2137[6],&g_2124,(void*)0}},{{&g_2127,(void*)0,(void*)0,&g_2122},{&g_2124,&g_2130,&g_2121,(void*)0},{(void*)0,&g_2130,&g_2133,&g_2122},{&g_2130,(void*)0,&g_2135,(void*)0},{&g_2136,&g_2137[6],&g_2127,(void*)0},{&g_2133,&g_2128,&g_2129[0],&g_2135},{(void*)0,&g_2126,(void*)0,&g_2137[6]},{&g_2135,(void*)0,(void*)0,(void*)0},{&g_2121,(void*)0,&g_2131,(void*)0}},{{(void*)0,(void*)0,&g_2131,&g_2127},{&g_2121,(void*)0,(void*)0,(void*)0},{&g_2135,&g_2123,(void*)0,&g_2121},{(void*)0,&g_2121,&g_2129[0],(void*)0},{&g_2133,&g_2127,&g_2127,&g_2133},{&g_2136,&g_2122,&g_2135,&g_2134[2]},{&g_2130,&g_2129[0],&g_2133,&g_2123},{(void*)0,(void*)0,&g_2121,&g_2123},{&g_2124,&g_2129[0],(void*)0,&g_2134[2]}},{{&g_2127,&g_2122,&g_2124,&g_2133},{&g_2137[6],&g_2127,(void*)0,(void*)0},{(void*)0,&g_2121,&g_2128,&g_2121},{&g_2132,&g_2123,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_2127},{(void*)0,(void*)0,&g_2123,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_2137[6]},{&g_2132,&g_2126,&g_2128,&g_2135}}}; static uint16_t * const *g_2119 = &g_2120[5][4][0]; static uint16_t * const ** const g_2118 = &g_2119; static uint16_t * const ** const *g_2117[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; static union U1 g_2141 = {0x79L};/* VOLATILE GLOBAL g_2141 */ static union U1 g_2143 = {0UL};/* VOLATILE GLOBAL g_2143 */ static int16_t g_2144 = 0L; static int8_t g_2182 = 0x31L; static int32_t g_2183[8][10] = {{0x776D97F7L,7L,0x4A2C2421L,0xC724AC86L,6L,0x776D97F7L,0xDDD5E4BAL,0x8982B0F8L,0xCDF38DE8L,0xEA09D9EDL},{0x776D97F7L,0xDDD5E4BAL,0x8982B0F8L,0xCDF38DE8L,0xEA09D9EDL,0x776D97F7L,0L,0xDC3B47A7L,0xDC3B47A7L,0L},{0x776D97F7L,0L,0xDC3B47A7L,0xDC3B47A7L,0L,0x776D97F7L,0xEA09D9EDL,0xCDF38DE8L,0x8982B0F8L,0xDDD5E4BAL},{0x776D97F7L,0xEA09D9EDL,0xCDF38DE8L,0x8982B0F8L,0xDDD5E4BAL,0x776D97F7L,6L,0xC724AC86L,0x4A2C2421L,7L},{0x776D97F7L,6L,0xC724AC86L,0x4A2C2421L,0x278253C4L,0xD20E61D9L,0x278253C4L,0xEA09D9EDL,0xDDD5E4BAL,9L},{0xD20E61D9L,0x278253C4L,0xEA09D9EDL,0xDDD5E4BAL,9L,0xD20E61D9L,0x5E6B88DDL,7L,6L,0xBF3E3560L},{0xD20E61D9L,0x5E6B88DDL,7L,6L,0xBF3E3560L,0xD20E61D9L,0xF8018517L,0L,0L,0xF8018517L},{0xD20E61D9L,0xF8018517L,0L,0L,0xF8018517L,0xD20E61D9L,0xBF3E3560L,6L,7L,0x5E6B88DDL}}; static int64_t g_2184 = 0xCDF16FCB73794FF0LL; static uint32_t g_2185 = 4294967292UL; static int32_t g_2197 = 0x9C8F5581L; static uint8_t g_2236 = 0x42L; static const uint64_t g_2354 = 0x64D97EA9A3726083LL; static uint32_t g_2375 = 0x8D8AAA09L; static struct S0 g_2388 = {0x49DD2682L,0x88L,-3753,0x1A25L,0L,-1L,-6L,2UL,1L};/* VOLATILE GLOBAL g_2388 */ static uint8_t g_2421 = 0xDBL; static uint32_t ** const * volatile g_2424 = &g_1462;/* VOLATILE GLOBAL g_2424 */ static uint32_t ** const * volatile *g_2423 = &g_2424; static uint32_t g_2449 = 0x268168D9L; static const uint64_t g_2546 = 0x5A49CA6E7D7B09ECLL; static union U1 g_2548[5] = {{248UL},{248UL},{248UL},{248UL},{248UL}}; static union U1 g_2560 = {0x22L};/* VOLATILE GLOBAL g_2560 */ static union U1 g_2561[2] = {{0x37L},{0x37L}}; static union U1 g_2567 = {0x9FL};/* VOLATILE GLOBAL g_2567 */ static int32_t g_2687 = 0xBDB1A595L; static int64_t g_2706 = (-1L); static uint8_t g_2707[7] = {0xC6L,0xC6L,0xC6L,0xC6L,0xC6L,0xC6L,0xC6L}; static uint32_t g_2712 = 18446744073709551609UL; static uint32_t g_2730 = 0x986FEB2EL; static union U1 g_2734 = {2UL};/* VOLATILE GLOBAL g_2734 */ static uint32_t g_2738 = 4294967288UL; static uint64_t g_2743 = 0xF7ABD17671A5D650LL; static const union U1 g_2768 = {255UL};/* VOLATILE GLOBAL g_2768 */ static const union U1 g_2769 = {255UL};/* VOLATILE GLOBAL g_2769 */ static union U1 g_2770[9][10] = {{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}},{{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L},{0xD4L}}}; static const union U1 g_2771 = {1UL};/* VOLATILE GLOBAL g_2771 */ static union U1 g_2772[2][3] = {{{0UL},{0UL},{0xDEL}},{{0UL},{0UL},{0xDEL}}}; static union U1 g_2773[5][3] = {{{0x89L},{0xDBL},{0xA3L}},{{255UL},{0xDBL},{255UL}},{{0xB4L},{0x89L},{0xA3L}},{{0xB4L},{0xB4L},{0x89L}},{{255UL},{0x89L},{0x89L}}}; static const union U1 g_2774 = {0x51L};/* VOLATILE GLOBAL g_2774 */ static const union U1 g_2775 = {0UL};/* VOLATILE GLOBAL g_2775 */ static const union U1 g_2776[4] = {{0xD9L},{0xD9L},{0xD9L},{0xD9L}}; static const union U1 g_2777 = {0xAFL};/* VOLATILE GLOBAL g_2777 */ /* --- FORWARD DECLARATIONS --- */ static int32_t func_1(void); static int16_t func_8(uint32_t p_9, int64_t p_10, int16_t p_11); static int8_t * func_18(int8_t p_19, uint16_t p_20, int8_t * p_21, const int16_t p_22); static int64_t func_23(uint8_t p_24, uint32_t p_25, int8_t * p_26, uint8_t p_27); static int32_t * func_31(uint32_t p_32); static uint16_t func_39(int8_t * p_40, int32_t p_41); static int8_t * func_42(int16_t p_43, int32_t p_44); static int16_t func_45(uint8_t p_46, int32_t * const p_47, int32_t * p_48, int32_t * p_49, uint32_t p_50); static int32_t * const func_52(const int32_t * p_53, const uint32_t p_54, int64_t p_55); static const int32_t * func_56(const int32_t p_57, int8_t * p_58, int32_t * p_59, uint32_t p_60); /* --- FUNCTIONS --- */ /* ------------------------------------------ */ /* * reads : g_6 g_7 g_28 g_2125 g_1543 g_1317 g_329 g_1098 g_1766 g_1767 g_1103 g_202 g_143 g_631 g_2354 g_530 g_422 * writes: g_2125 g_1098 g_143 g_1739 g_329 g_631 */ static int32_t func_1(void) { /* block id: 0 */ int8_t *l_5 = (void*)0; int32_t l_12 = (-4L); uint32_t l_13 = 0x64BA8B35L; int8_t *l_29 = &g_30; const int8_t *l_2815 = &g_2388.f6; const int8_t **l_2814 = &l_2815; const int8_t *l_2817 = (void*)0; const int8_t **l_2816 = &l_2817; (*g_202) = (0UL | (safe_mul_func_int16_t_s_s((safe_unary_minus_func_int32_t_s(((l_5 != g_6) , g_7))), func_8(l_12, (l_13 , (((((safe_sub_func_uint64_t_u_u((safe_lshift_func_uint16_t_u_s(((((*l_2816) = ((*l_2814) = func_18((func_23(l_12, g_28[2], l_29, l_13) , l_13), l_13, &g_1543, l_12))) != l_5) || l_13), l_13)), l_12)) , (*g_202)) >= l_13) >= l_13) != l_13)), l_12)))); return l_13; } /* ------------------------------------------ */ /* * reads : g_202 * writes: g_143 */ static int16_t func_8(uint32_t p_9, int64_t p_10, int16_t p_11) { /* block id: 1140 */ (*g_202) = (safe_rshift_func_uint8_t_u_s(1UL, 2)); return p_9; } /* ------------------------------------------ */ /* * reads : g_1543 g_1317 g_329 g_1098 g_1766 g_1767 g_1103 g_202 g_143 g_631 g_2354 g_530 g_422 g_28 * writes: g_1098 g_143 g_1739 g_329 g_631 */ static int8_t * func_18(int8_t p_19, uint16_t p_20, int8_t * p_21, const int16_t p_22) { /* block id: 1127 */ const uint32_t l_2754 = 18446744073709551608UL; uint64_t *l_2762 = &g_1098; const union U1 *l_2767[6][10] = {{&g_2772[0][0],&g_2772[0][0],&g_2768,&g_2770[5][5],&g_2768,&g_2772[0][0],&g_2772[0][0],&g_2768,&g_2770[5][5],&g_2768},{&g_2772[0][0],&g_2772[0][0],&g_2768,&g_2770[5][5],&g_2768,&g_2772[0][0],&g_2772[0][0],&g_2768,&g_2770[5][5],&g_2768},{&g_2772[0][0],&g_2772[0][0],&g_2768,&g_2770[5][5],&g_2768,&g_2772[0][0],&g_2768,&g_2774,&g_2776[2],&g_2774},{&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774,&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774},{&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774,&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774},{&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774,&g_2768,&g_2768,&g_2774,&g_2776[2],&g_2774}}; int32_t *l_2784 = &g_631; uint32_t *l_2794 = (void*)0; uint32_t *l_2795 = &g_1739; uint8_t l_2807 = 0xEFL; int8_t *l_2811[4][6][1]; int8_t **l_2810[9] = {&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0],&l_2811[3][5][0]}; int8_t **l_2812 = &l_2811[3][5][0]; uint32_t **** const l_2813 = (void*)0; int i, j, k; for (i = 0; i < 4; i++) { for (j = 0; j < 6; j++) { for (k = 0; k < 1; k++) l_2811[i][j][k] = &g_766; } } (*g_202) &= (safe_lshift_func_int8_t_s_s((((safe_rshift_func_int8_t_s_u((*p_21), 5)) <= 0L) ^ (0x92AF6C32L & (!l_2754))), (safe_mul_func_uint8_t_u_u((*g_1317), (((safe_sub_func_uint32_t_u_u(p_19, (!((l_2754 | (0x46L && (safe_mod_func_uint64_t_u_u((++(*l_2762)), (safe_rshift_func_int8_t_s_u(((l_2767[1][4] != (**g_1766)) , 0x2DL), 7)))))) || 0x25D5L)))) && p_20) | l_2754))))); (*l_2784) = ((safe_rshift_func_uint16_t_u_s(((((safe_mul_func_int8_t_s_s((((*g_202) ^= (safe_lshift_func_uint16_t_u_u(p_20, l_2754))) & ((void*)0 == l_2784)), (((*g_1317) ^= (safe_mul_func_int8_t_s_s((*l_2784), (safe_mul_func_int16_t_s_s(0xC8C1L, ((safe_div_func_int16_t_s_s((g_2354 || ((*l_2795) = ((safe_lshift_func_uint16_t_u_s((*l_2784), 5)) , (safe_unary_minus_func_int16_t_s(((*l_2784) > 0x49L)))))), g_530)) , (*l_2784))))))) == 1L))) < (*l_2784)) != (*l_2784)) | 0x824D045AL), 10)) != p_19); (*l_2784) = (!((safe_rshift_func_int16_t_s_s((safe_mod_func_int16_t_s_s(((safe_rshift_func_int8_t_s_s((safe_sub_func_uint16_t_u_u(((((*g_422) == (&g_1767[0][0][3] != ((safe_div_func_int64_t_s_s(p_19, l_2807)) , &g_1767[0][0][7]))) || (safe_mod_func_uint64_t_u_u((((8L | ((l_2810[6] = l_2810[1]) != (l_2812 = &l_2811[3][5][0]))) , l_2813) == (void*)0), 2L))) == 0xE8A782DBL), (-1L))), 2)) < p_22), (*l_2784))), 1)) != 18446744073709551615UL)); return &g_1542[6][0]; } /* ------------------------------------------ */ /* * reads : g_2125 * writes: g_2125 */ static int64_t func_23(uint8_t p_24, uint32_t p_25, int8_t * p_26, uint8_t p_27) { /* block id: 1 */ int32_t l_51 = 0xBC906383L; int64_t *l_2273 = (void*)0; int64_t **l_2272 = &l_2273; uint8_t l_2278 = 0xF5L; uint32_t l_2281 = 9UL; uint64_t l_2331 = 18446744073709551613UL; int32_t l_2368 = 1L; int32_t l_2369 = (-6L); int32_t l_2374 = 0x0E13C70FL; int32_t l_2380 = (-4L); uint32_t ***l_2473 = &g_1462; const int64_t l_2505 = 0L; union U1 *l_2559[5] = {&g_2561[1],&g_2561[1],&g_2561[1],&g_2561[1],&g_2561[1]}; uint32_t **l_2571[9][4] = {{&g_1463,&g_1463,(void*)0,(void*)0},{(void*)0,&g_1463,&g_1463,(void*)0},{&g_1463,&g_1463,(void*)0,(void*)0},{(void*)0,&g_1463,&g_1463,(void*)0},{&g_1463,&g_1463,(void*)0,(void*)0},{(void*)0,&g_1463,&g_1463,(void*)0},{&g_1463,&g_1463,(void*)0,(void*)0},{(void*)0,&g_1463,&g_1463,(void*)0},{&g_1463,&g_1463,(void*)0,(void*)0}}; uint16_t l_2663 = 0x7AB4L; uint16_t *** const l_2721 = &g_819; uint32_t l_2725 = 0x790A6013L; uint16_t l_2726 = 0UL; int i, j; for (p_27 = 1; (p_27 <= 7); p_27 += 1) { /* block id: 4 */ int32_t l_35 = (-7L); int8_t *l_61 = &g_30; int32_t *l_62 = (void*)0; int32_t **l_1101 = &l_62; int32_t *l_1102 = &l_51; int32_t l_2263 = 0xBD7279E5L; } l_2281++; for (g_2125 = 0; (g_2125 <= 5); g_2125 += 1) { /* block id: 907 */ int32_t l_2294 = 0x1F5A499CL; struct S0 ** const ** const l_2325 = (void*)0; int32_t l_2329 = 6L; uint64_t *l_2347 = &l_2331; uint64_t l_2371 = 18446744073709551615UL; uint32_t *l_2382 = &g_1739; uint32_t **l_2381 = &l_2382; int8_t l_2450 = (-1L); int32_t l_2481 = 5L; int32_t l_2482[4] = {(-1L),(-1L),(-1L),(-1L)}; uint32_t l_2486 = 4294967290UL; int64_t l_2495 = 0x92E7142132898DD5LL; int16_t l_2520 = 0x48A2L; uint16_t *l_2524 = &g_2124; uint8_t *l_2569 = &l_2278; int32_t *l_2570 = &g_143; int32_t l_2675 = 7L; union U1 *l_2733 = &g_2734; int i; } return p_25; } /* ------------------------------------------ */ /* * reads : g_1317 g_329 g_1326 g_2185 g_1545 g_1608 g_2121 g_93 g_1738 g_2236 * writes: g_767 g_2185 g_1545 g_1608 g_1747.f7 g_1738 g_2236 */ static int32_t * func_31(uint32_t p_32) { /* block id: 863 */ uint32_t l_2164 = 1UL; int64_t *l_2165 = &g_767; union U1 ****l_2173 = &g_1766; int32_t l_2179 = 0xE0A5EFFFL; int32_t l_2180 = 0x6F240AFBL; int8_t l_2181[9][10] = {{(-1L),(-2L),(-1L),0xCAL,0x74L,(-1L),0x13L,8L,(-2L),1L},{0xC6L,0x46L,0x74L,0xC4L,(-7L),(-1L),(-1L),(-7L),0xC4L,0x74L},{(-1L),(-1L),(-6L),(-7L),0x36L,1L,0xCAL,(-1L),0x77L,0xCAL},{0x46L,0xC6L,(-1L),1L,0xC6L,0xC4L,0xCAL,0xC4L,0xC6L,1L},{(-2L),(-1L),(-2L),(-1L),0xCAL,0x74L,(-1L),0x13L,8L,(-2L)},{0x13L,0x46L,0x77L,(-7L),(-1L),0L,0x13L,0x13L,0L,(-1L)},{0x46L,(-2L),(-2L),0x46L,8L,0xC6L,(-1L),0xC4L,(-2L),0x13L},{8L,0x13L,(-1L),0x74L,0xCAL,(-1L),(-2L),(-1L),(-2L),(-1L)},{(-7L),0x46L,(-6L),0x46L,(-7L),0xC9L,1L,(-7L),0L,0xCAL}}; int8_t ***l_2202 = (void*)0; int8_t *l_2206 = &l_2181[5][3]; int8_t **l_2205 = &l_2206; int8_t ***l_2204 = &l_2205; int32_t *l_2227 = (void*)0; int32_t l_2228 = 0x162C15DFL; int32_t l_2229 = (-2L); uint32_t *l_2230 = &g_1747.f7; int32_t *l_2231 = &g_1738; int32_t *l_2232 = &g_143; int32_t *l_2233 = &l_2179; int32_t *l_2234 = &l_2179; int32_t *l_2235[6]; int64_t ***l_2239 = &g_1406; int64_t ****l_2240 = (void*)0; int64_t ****l_2241 = &l_2239; int i, j; for (i = 0; i < 6; i++) l_2235[i] = &g_631; if ((safe_lshift_func_int8_t_s_u((-1L), (0UL != (p_32 && ((*l_2165) = l_2164)))))) { /* block id: 865 */ int16_t l_2166 = 0x1473L; int32_t l_2167[7][3] = {{1L,0x86A7E0B8L,1L},{0x8F597517L,(-1L),0L},{(-1L),(-1L),0L},{0x595A494FL,(-1L),(-1L)},{1L,(-1L),0x86A7E0B8L},{0L,0x8F597517L,0L},{0L,1L,0x86A7E0B8L}}; uint16_t ***l_2172 = &g_819; uint16_t **** const l_2171[2][9] = {{&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172},{&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172,&l_2172}}; uint16_t **** const *l_2170 = &l_2171[1][1]; int8_t *l_2175 = (void*)0; int8_t **l_2174 = &l_2175; int32_t l_2176 = 0xB4282160L; int32_t l_2177 = 0x7869BAFEL; int32_t *l_2178[9]; int i, j; for (i = 0; i < 9; i++) l_2178[i] = &l_2176; l_2176 &= (((l_2166 = (*g_1317)) , ((l_2164 > (((l_2167[1][1] = 0xC9457489L) <= (safe_mul_func_int16_t_s_s(g_1326, 65533UL))) , (&g_2117[2] != l_2170))) ^ p_32)) ^ (((((((&g_1766 == l_2173) & (-2L)) , (void*)0) == l_2174) == 0x29L) <= 255UL) <= l_2164)); ++g_2185; } else { /* block id: 870 */ int8_t l_2193 = 0x9CL; int32_t l_2194 = 3L; int32_t l_2195 = 8L; int32_t l_2196 = 0xE2C45904L; int8_t ****l_2203 = &l_2202; int8_t ****l_2207 = &l_2204; int32_t *l_2208 = &l_2194; for (g_1545 = 0; (g_1545 < 23); g_1545++) { /* block id: 873 */ uint32_t l_2198 = 0x58421E65L; int32_t *l_2201 = (void*)0; for (g_1608 = 28; (g_1608 == (-29)); --g_1608) { /* block id: 876 */ int32_t *l_2192[1][10] = {{(void*)0,&g_143,&g_143,(void*)0,&l_2179,(void*)0,&g_143,&g_143,(void*)0,&l_2179}}; int i, j; l_2198--; l_2179 = 0x75892471L; } return l_2201; } (*l_2208) |= (((*l_2203) = l_2202) == ((*l_2207) = l_2204)); } (*l_2231) |= (g_2121 != ((safe_mul_func_int16_t_s_s(l_2164, (safe_sub_func_uint16_t_u_u(p_32, (p_32 | ((safe_sub_func_uint32_t_u_u(((*l_2230) = ((((safe_add_func_uint32_t_u_u(p_32, ((safe_div_func_int32_t_s_s((l_2228 ^= (safe_mul_func_uint16_t_u_u((((safe_lshift_func_int16_t_s_s(g_93[2], 0)) == (l_2179 = ((safe_add_func_uint16_t_u_u(p_32, (255UL ^ ((safe_sub_func_uint64_t_u_u((((p_32 && (-7L)) , &g_1766) != l_2173), l_2164)) & 0UL)))) ^ l_2179))) >= l_2180), p_32))), p_32)) & 0UL))) ^ l_2229) != p_32) <= l_2229)), p_32)) == 0UL)))))) && p_32)); g_2236--; (*l_2241) = l_2239; return &g_631; } /* ------------------------------------------ */ /* * reads : * writes: */ static uint16_t func_39(int8_t * p_40, int32_t p_41) { /* block id: 861 */ return p_41; } /* ------------------------------------------ */ /* * reads : g_209 g_238 g_1207 g_532 g_1545 g_849.f4 g_1401.f7 g_421 g_422 g_30 g_772.f3 g_143 g_1610 g_1317 g_329 g_767 g_1233.f7 g_631 g_686.f7 g_1055.f7 g_959 g_252 g_636.f6 g_28 g_1739 g_1782 g_1806 g_199 g_1543 g_1235.f6 g_834.f4 g_1873 g_849.f3 g_980 g_981 g_667.f7 g_530 g_832.f3 g_567 g_667.f6 g_2013 g_1544 g_1462 g_662.f7 g_772.f7 g_1055.f3 g_686.f6 g_667.f4 g_1963.f6 g_93 g_834.f7 g_2094 g_2109 g_1767 g_2144 * writes: g_209 g_143 g_1545 g_1235.f4 g_28 g_1009 g_202 g_1610 g_1207 g_1544 g_631 g_686.f7 g_1055.f7 g_329 g_1608 g_832.f4 g_1739 g_610 g_1103 g_1747.f3 g_1766 g_169 g_1543 g_192 g_467 g_557 g_530 g_1749.f4 g_737 g_238 g_2023 g_1463 g_686.f3 g_686.f4 g_30 g_2109 g_2114 g_2117 g_1233.f4 g_1738 */ static int8_t * func_42(int16_t p_43, int32_t p_44) { /* block id: 645 */ int16_t l_1500 = 0x52A8L; int16_t l_1510 = (-9L); uint32_t ** const *l_1534 = &g_1462; uint32_t ** const **l_1533 = &l_1534; int32_t l_1540[7][4][7] = {{{9L,0L,9L,0x0E4AB5A2L,0xB73831FEL,0x8DF63FA2L,0xA1FF7092L},{1L,0x78E86908L,0x83157D82L,0x4D316D95L,0x4D316D95L,0x83157D82L,0x78E86908L},{0L,1L,9L,1L,0xB73831FEL,0xACF224A6L,0xA20DE8B9L},{0x83157D82L,0x11844D11L,0x61AE903CL,0x78E86908L,0x61AE903CL,0x11844D11L,0x83157D82L}},{{0xA20DE8B9L,0xACF224A6L,0xB73831FEL,1L,9L,1L,0L},{0x78E86908L,0x83157D82L,0x4D316D95L,0x4D316D95L,0x83157D82L,0x78E86908L,1L},{0xA1FF7092L,0x8DF63FA2L,0xB73831FEL,0x0E4AB5A2L,9L,0L,9L},{8L,0xB6688924L,0x61AE903CL,0xB6688924L,8L,0xB0B318D4L,0x11844D11L}},{{0x0DBC332CL,0x8DF63FA2L,9L,0xACF224A6L,(-3L),0x66478050L,(-3L)},{0x445EA5B9L,0x83157D82L,0x83157D82L,0x445EA5B9L,0xB6688924L,0x2596661BL,0xDCAEC6B3L},{0x0DBC332CL,0xACF224A6L,9L,(-5L),0L,(-1L),(-1L)},{8L,0x11844D11L,8L,0x2596661BL,0x78E86908L,0x4D316D95L,0xDCAEC6B3L}},{{0xA1FF7092L,1L,(-3L),8L,9L,8L,(-3L)},{0x78E86908L,0x78E86908L,0xB6688924L,1L,1L,0x4D316D95L,0x11844D11L},{0xA20DE8B9L,0L,0L,0x8DF63FA2L,0L,(-1L),9L},{0x83157D82L,0xB0B318D4L,0x78E86908L,8L,1L,0x2596661BL,1L}},{{0L,0x66478050L,9L,0L,9L,0x66478050L,0L},{1L,0x2596661BL,1L,8L,0x78E86908L,0xB0B318D4L,0x83157D82L},{9L,(-1L),0L,0x8DF63FA2L,0L,0L,0xA20DE8B9L},{0x11844D11L,0x4D316D95L,1L,1L,0xB6688924L,0x78E86908L,0x78E86908L}},{{(-3L),8L,9L,8L,(-3L),1L,0xA1FF7092L},{0xDCAEC6B3L,0x4D316D95L,0x78E86908L,0x2596661BL,8L,0x11844D11L,8L},{9L,(-5L),(-1L),0L,0xA1FF7092L,1L,(-3L)},{8L,0xB0B318D4L,0x11844D11L,0x78E86908L,0x445EA5B9L,0x445EA5B9L,0x78E86908L}},{{0L,0x0E4AB5A2L,0L,1L,9L,(-1L),(-3L)},{1L,1L,0x4D316D95L,0x11844D11L,0xDCAEC6B3L,0x11844D11L,0x4D316D95L},{9L,8L,0xA1FF7092L,0xACF224A6L,9L,(-1L),0xA20DE8B9L},{0x2596661BL,0xB6688924L,0x445EA5B9L,0x83157D82L,0x83157D82L,0x445EA5B9L,0xB6688924L}}}; struct S0 ** const **l_1574 = (void*)0; int8_t l_1604 = 0L; uint32_t l_1620 = 0x0ECF7E56L; int32_t l_1718 = 0xA3F39C4BL; int32_t l_1852 = 0x8237BD48L; uint64_t *l_1861 = &g_93[2]; int32_t *l_1875[8] = {&g_143,&l_1852,&g_143,&l_1852,&g_143,&l_1852,&g_143,&l_1852}; int32_t *l_1876 = (void*)0; union U1 *l_1893 = &g_1894; int8_t *l_1908 = &g_30; int8_t **l_1907 = &l_1908; int8_t ***l_1906 = &l_1907; int8_t ****l_1905 = &l_1906; uint64_t **l_1927 = &g_467[3][1]; uint64_t ***l_1926 = &l_1927; uint64_t *** const l_1928 = &l_1927; uint32_t *l_1939 = &g_686.f7; uint32_t **l_1938 = &l_1939; uint64_t l_1952 = 1UL; int32_t ***l_1979 = &g_981; union U1 *l_2142[2]; int32_t **l_2161 = &l_1875[0]; int i, j, k; for (i = 0; i < 2; i++) l_2142[i] = &g_2143; for (g_209 = 0; (g_209 != 18); g_209 = safe_add_func_uint32_t_u_u(g_209, 9)) { /* block id: 648 */ uint32_t l_1524[3][3][4]; uint16_t *l_1525 = &g_28[5]; int32_t l_1596 = 0x54809942L; int32_t l_1599 = 0x2E3714C8L; int32_t l_1600 = (-9L); int32_t l_1601 = 1L; int32_t l_1603 = (-1L); int32_t l_1606 = 0xFB8FB38FL; int8_t *l_1635[3][6][8] = {{{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]}},{{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]}},{{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]},{&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0],&g_30,&g_1542[6][0]}}}; int8_t l_1637 = 0x56L; struct S0 *l_1748 = &g_1749; int8_t l_1781 = 0xC3L; int16_t l_1850 = 0xF78EL; uint64_t * const l_1860 = &g_557[0]; struct S0 ***l_1872 = (void*)0; uint64_t **l_1882 = &g_467[2][2]; uint64_t ***l_1881 = &l_1882; union U1 *l_1895[5]; uint32_t l_1896 = 0xC3C75FE4L; int16_t l_1897 = 7L; uint32_t **l_1940 = &l_1939; int64_t **l_1970 = (void*)0; struct S0 ****l_1988 = (void*)0; union U1 ***l_2015 = &g_1767[0][0][1]; int16_t l_2038 = 0L; uint8_t **l_2061[5][7][4] = {{{&g_1317,&g_1317,(void*)0,&g_1317},{&g_1317,(void*)0,&g_1317,(void*)0},{(void*)0,&g_1317,(void*)0,&g_1317},{&g_1317,&g_1317,&g_1317,(void*)0},{&g_1317,(void*)0,&g_1317,&g_1317},{&g_1317,&g_1317,&g_1317,(void*)0},{&g_1317,&g_1317,&g_1317,&g_1317}},{{(void*)0,(void*)0,(void*)0,&g_1317},{&g_1317,&g_1317,(void*)0,(void*)0},{(void*)0,&g_1317,&g_1317,&g_1317},{&g_1317,(void*)0,&g_1317,&g_1317},{(void*)0,&g_1317,(void*)0,&g_1317},{&g_1317,&g_1317,(void*)0,(void*)0},{(void*)0,(void*)0,&g_1317,&g_1317}},{{&g_1317,&g_1317,&g_1317,&g_1317},{&g_1317,(void*)0,&g_1317,&g_1317},{&g_1317,&g_1317,&g_1317,&g_1317},{&g_1317,(void*)0,(void*)0,&g_1317},{(void*)0,&g_1317,&g_1317,&g_1317},{&g_1317,(void*)0,(void*)0,&g_1317},{&g_1317,&g_1317,(void*)0,&g_1317}},{{(void*)0,(void*)0,&g_1317,(void*)0},{&g_1317,&g_1317,(void*)0,&g_1317},{(void*)0,&g_1317,&g_1317,&g_1317},{&g_1317,(void*)0,&g_1317,&g_1317},{&g_1317,&g_1317,&g_1317,(void*)0},{(void*)0,&g_1317,(void*)0,&g_1317},{&g_1317,(void*)0,&g_1317,&g_1317}},{{(void*)0,&g_1317,(void*)0,(void*)0},{&g_1317,&g_1317,(void*)0,&g_1317},{&g_1317,(void*)0,&g_1317,(void*)0},{(void*)0,&g_1317,(void*)0,&g_1317},{&g_1317,&g_1317,&g_1317,(void*)0},{&g_1317,(void*)0,&g_1317,&g_1317},{&g_1317,&g_1317,&g_1317,(void*)0}}}; int16_t l_2160[10]; int i, j, k; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 4; k++) l_1524[i][j][k] = 0xA1936095L; } } for (i = 0; i < 5; i++) l_1895[i] = (void*)0; for (i = 0; i < 10; i++) l_2160[i] = 0x3B3BL; if (l_1500) { /* block id: 649 */ uint32_t l_1503 = 0UL; int32_t *l_1594 = &g_143; int32_t l_1602 = 0x7325B77FL; int32_t l_1605 = 1L; int32_t l_1609[6]; uint64_t **l_1717 = &g_467[0][2]; struct S0 *l_1746 = &g_1747; int64_t l_1778 = 0x2DE0ED072BE74709LL; union U1 **l_1833 = &g_1103[3][3][2]; uint32_t *l_1851 = &g_192; int i; for (i = 0; i < 6; i++) l_1609[i] = 0x6BE2570EL; if ((safe_add_func_int16_t_s_s(0x1D30L, l_1503))) { /* block id: 650 */ int64_t l_1511 = 0xBB48A787574995EELL; uint32_t l_1526 = 0x79B9BE14L; uint32_t l_1530 = 1UL; uint32_t ***l_1536 = &g_1462; uint32_t *** const *l_1535 = &l_1536; int32_t l_1538[8][1][7] = {{{0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L}},{{0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L}},{{0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L}},{{0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L}},{{0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L}},{{0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L}},{{0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L,0xEE5DB25EL,0xBC21D722L}},{{0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L,0xFB5DDCE9L}}}; struct S0 ***l_1576[5][1][8]; struct S0 ****l_1575 = &l_1576[2][0][1]; int32_t *l_1719 = (void*)0; int32_t *l_1720 = (void*)0; int32_t *l_1721 = &l_1609[1]; int32_t *l_1722 = (void*)0; int32_t *l_1723 = &l_1538[7][0][6]; int32_t *l_1724 = (void*)0; int32_t *l_1725 = &l_1609[1]; int32_t *l_1726 = &l_1603; int32_t *l_1727 = &l_1596; int32_t *l_1728 = &g_631; int32_t *l_1729 = &l_1609[5]; int32_t *l_1730 = (void*)0; int32_t *l_1731 = &l_1606; int32_t *l_1732 = (void*)0; int32_t *l_1733 = &l_1540[1][3][3]; int32_t *l_1734 = (void*)0; int32_t *l_1735 = &l_1603; int32_t *l_1736 = &l_1540[4][0][1]; int32_t *l_1737[6]; union U1 *l_1744 = (void*)0; union U1 ***l_1768[7][3] = {{&g_1767[0][0][2],&g_1767[0][0][6],&g_1767[0][0][2]},{&g_1767[0][0][0],&g_1767[0][0][0],&g_1767[0][0][0]},{&g_1767[0][0][2],&g_1767[0][0][6],&g_1767[0][0][2]},{&g_1767[0][0][0],&g_1767[0][0][0],&g_1767[0][0][0]},{&g_1767[0][0][2],&g_1767[0][0][6],&g_1767[0][0][2]},{&g_1767[0][0][0],&g_1767[0][0][0],&g_1767[0][0][0]},{&g_1767[0][0][2],&g_1767[0][0][6],&g_1767[0][0][2]}}; int i, j, k; for (i = 0; i < 5; i++) { for (j = 0; j < 1; j++) { for (k = 0; k < 8; k++) l_1576[i][j][k] = &g_826; } } for (i = 0; i < 6; i++) l_1737[i] = &l_1609[1]; if ((g_143 = ((safe_mul_func_uint16_t_u_u((safe_add_func_uint32_t_u_u((safe_add_func_uint16_t_u_u(((l_1510 || ((void*)0 == &g_145)) , l_1511), (l_1510 , g_238))), (safe_div_func_int64_t_s_s((safe_mod_func_int32_t_s_s(((safe_sub_func_uint64_t_u_u((safe_sub_func_uint16_t_u_u((safe_lshift_func_int16_t_s_s((0xBFL ^ (0x89B22F7EL != (((p_43 < l_1524[1][1][1]) , l_1525) != (void*)0))), 8)), g_1207)), 0x247B9411D11980D3LL)) | l_1510), g_532)), p_44)))), l_1526)) && 0x774787234D13828CLL))) { /* block id: 652 */ uint32_t l_1529 = 4294967290UL; int32_t l_1539 = 0x522C0E6BL; uint16_t ***l_1572 = (void*)0; int32_t *l_1597 = &l_1538[3][0][2]; int32_t *l_1598[4][9][7] = {{{(void*)0,&l_1540[2][3][4],&g_143,&g_98,&g_98,&g_143,&l_1540[2][3][4]},{&l_1596,&g_631,&l_1596,&l_1539,&l_1538[1][0][5],&l_1538[3][0][2],&g_98},{&g_631,&l_1539,&l_1538[5][0][2],&l_1596,&g_98,&l_1540[2][3][4],(void*)0},{&l_1538[3][0][2],&l_1596,&g_98,&l_1539,&l_1540[2][3][4],(void*)0,&l_1538[1][0][5]},{&l_1540[2][3][4],(void*)0,&l_1596,&g_98,&l_1596,&g_631,&l_1596},{&l_1538[5][0][2],(void*)0,(void*)0,&l_1538[5][0][2],&l_1538[2][0][6],&l_1596,&l_1596},{&l_1540[2][3][4],&l_1596,&l_1540[2][3][4],&l_1538[3][0][2],&l_1596,(void*)0,&l_1538[0][0][2]},{&l_1538[0][0][2],&l_1539,&l_1538[2][0][6],(void*)0,&l_1540[2][3][4],&l_1539,&l_1596},{(void*)0,&g_631,(void*)0,&g_98,(void*)0,&l_1596,&l_1596}},{{&l_1538[1][0][5],&l_1540[2][3][4],(void*)0,&g_143,(void*)0,&l_1540[2][3][4],&l_1538[1][0][5]},{&l_1596,(void*)0,&g_143,&l_1540[2][3][4],&l_1540[2][3][4],&g_98,(void*)0},{&g_98,&l_1538[2][0][6],&l_1540[5][0][6],&l_1538[1][0][5],&l_1596,(void*)0,&g_98},{&l_1539,&l_1538[3][0][2],&g_143,&g_631,&l_1538[2][0][6],&l_1538[1][0][5],&l_1540[2][3][4]},{(void*)0,&g_98,(void*)0,&l_1596,&l_1596,&l_1596,&l_1596},{(void*)0,&g_98,(void*)0,&l_1538[3][0][2],&l_1540[2][3][4],&l_1596,&l_1539},{&l_1539,&l_1539,&l_1538[2][0][6],&l_1596,&g_98,&l_1538[0][0][2],(void*)0},{&g_98,&l_1538[3][0][2],&l_1540[2][3][4],&l_1538[0][0][2],&l_1538[1][0][5],&l_1596,&l_1596},{&l_1596,&l_1540[2][3][4],(void*)0,&l_1596,&g_98,&l_1596,&g_631}},{{&l_1538[1][0][5],&g_143,&l_1596,&l_1596,&g_143,&l_1538[1][0][5],(void*)0},{(void*)0,&l_1538[1][0][5],&g_98,&l_1538[0][0][2],&l_1596,(void*)0,&l_1540[2][3][4]},{&l_1538[0][0][2],&g_143,&l_1538[5][0][2],&l_1596,&l_1540[2][3][4],&g_98,&l_1538[3][0][2]},{&l_1540[2][3][4],&l_1538[1][0][5],&l_1596,&l_1538[3][0][2],(void*)0,&l_1540[2][3][4],&g_143},{&l_1538[5][0][2],&g_143,&g_143,&l_1596,&l_1540[5][0][6],&l_1596,&g_143},{(void*)0,(void*)0,&l_1540[2][3][4],&l_1540[2][3][4],&g_98,(void*)0,&l_1538[2][0][6]},{&l_1540[2][3][4],&l_1538[3][0][2],&l_1540[5][0][6],&g_98,&l_1538[3][0][2],&l_1540[2][3][4],&l_1538[0][0][2]},{&l_1540[2][3][4],(void*)0,&l_1596,&l_1538[1][0][5],&g_98,&l_1538[3][0][2],&l_1538[3][0][2]},{&l_1596,&l_1538[5][0][2],&l_1540[2][3][4],&g_98,&g_631,&l_1540[2][3][4],&l_1540[2][3][4]}},{{&l_1539,&g_143,&l_1540[2][3][4],&g_143,&l_1539,&l_1538[3][0][2],&l_1538[3][0][2]},{&l_1538[5][0][2],&l_1538[2][0][6],&l_1596,&l_1596,&l_1538[1][0][5],&l_1538[0][0][2],&l_1540[2][3][4]},{&l_1596,&g_98,&l_1540[5][0][6],&l_1540[2][3][4],&l_1596,&l_1538[2][0][6],(void*)0},{&l_1538[5][0][2],&l_1596,&l_1540[2][3][4],(void*)0,&l_1596,&g_98,&l_1596},{&l_1539,&l_1539,&g_98,&l_1540[5][0][6],&l_1540[5][0][6],&g_98,&l_1539},{&l_1596,&l_1540[2][3][4],&l_1596,&g_143,&g_98,&l_1538[2][0][6],&l_1540[5][0][6]},{&l_1540[2][3][4],&g_143,(void*)0,&l_1596,&g_143,&l_1538[0][0][2],&l_1539},{&l_1540[2][3][4],&l_1596,&l_1538[5][0][2],&g_143,&l_1538[0][0][2],&l_1538[3][0][2],&g_98},{(void*)0,&l_1539,(void*)0,&l_1540[5][0][6],&l_1596,&l_1540[2][3][4],&l_1596}}}; int i, j, k; for (p_43 = (-27); (p_43 > 28); p_43 = safe_add_func_uint8_t_u_u(p_43, 9)) { /* block id: 655 */ if (l_1529) break; return &g_30; } if ((l_1530 | (safe_rshift_func_uint8_t_u_s(p_44, (l_1533 != l_1535))))) { /* block id: 659 */ int32_t *l_1537[3]; uint16_t * const * const *l_1573 = (void*)0; int i; for (i = 0; i < 3; i++) l_1537[i] = &g_98; g_1545++; l_1539 |= (safe_mod_func_uint32_t_u_u(((safe_add_func_uint64_t_u_u(18446744073709551615UL, (safe_rshift_func_int8_t_s_u(((safe_mul_func_uint8_t_u_u(((safe_mul_func_uint16_t_u_u(0x4A87L, (safe_sub_func_uint16_t_u_u(0x5977L, ((((safe_rshift_func_uint8_t_u_u((safe_sub_func_uint8_t_u_u((p_43 == (l_1538[6][0][4] = (safe_lshift_func_int16_t_s_u((safe_rshift_func_uint16_t_u_s(0x92A0L, p_44)), (safe_add_func_int64_t_s_s((g_849.f4 || (g_1235.f4 = g_1401.f7)), (((**g_421) = (safe_rshift_func_int8_t_s_u(l_1529, 3))) < g_30))))))), p_44)), p_44)) == 0x3599E524L) , l_1572) != l_1573))))) ^ l_1503), 0L)) & 0xCF77L), p_43)))) ^ 0x5E1B914BL), g_772.f3)); } else { /* block id: 665 */ struct S0 *****l_1577 = &g_1009; uint32_t *l_1593 = &g_1055.f7; int32_t **l_1595 = &g_202; g_143 &= (l_1574 != ((*l_1577) = l_1575)); if (p_44) break; (*l_1595) = l_1594; if (l_1500) break; } (*l_1594) |= 5L; g_1610++; } else { /* block id: 675 */ int64_t l_1613 = 0x070978CB805920E9LL; int32_t *l_1618 = &g_631; int32_t *l_1619[6][9] = {{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1],&l_1603,&l_1603,&l_1609[1]}}; int8_t *l_1636 = &g_208; struct S0 **l_1684 = &g_831; int32_t *l_1690 = &g_1608; uint8_t l_1691 = 251UL; int16_t *l_1709[8][6] = {{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169,&l_1500,&g_169}}; uint64_t **l_1716 = &g_467[3][1]; uint64_t ***l_1715 = &l_1716; int i, j; (*l_1594) = (l_1613 > ((255UL || ((safe_div_func_uint64_t_u_u(((p_44 , ((safe_mod_func_int16_t_s_s(l_1600, ((l_1510 < 4294967289UL) , (((*g_1317) & (0x3C76D8810933E2B0LL == ((*l_1594) ^ (*g_1317)))) ^ g_209)))) , p_44)) == (*l_1594)), l_1538[3][0][2])) , 0x2CL)) , l_1606)); --l_1620; if ((safe_div_func_int32_t_s_s((safe_add_func_uint32_t_u_u(((((0x6FL <= (+(((((void*)0 != &g_737[0]) , ((((safe_lshift_func_uint16_t_u_s((1UL > (((!(safe_lshift_func_int8_t_s_u(l_1540[2][3][4], 4))) , (safe_sub_func_int64_t_s_s((l_1635[0][2][3] != l_1636), p_44))) <= p_43)), l_1604)) , 3UL) != p_44) & (*l_1594))) > p_43) != (*l_1594)))) == p_43) , l_1526) , g_1401.f7), p_44)), l_1637))) { /* block id: 678 */ int64_t *l_1646[3]; int i; for (i = 0; i < 3; i++) l_1646[i] = &g_767; (*l_1594) = ((((safe_add_func_int32_t_s_s(((&l_1604 != (l_1599 , (void*)0)) ^ (safe_div_func_int16_t_s_s((safe_sub_func_uint16_t_u_u(((g_1207 = (safe_rshift_func_int16_t_s_u(1L, 0))) && (l_1530 < p_43)), (safe_mod_func_uint64_t_u_u((p_44 >= ((safe_mul_func_int8_t_s_s(l_1530, l_1606)) == p_43)), p_43)))), g_767))), g_1233.f7)) , (*l_1594)) > p_43) >= p_43); } else { /* block id: 681 */ int16_t *l_1660[1]; int64_t *l_1661 = &g_1544; uint32_t *l_1678 = (void*)0; uint32_t *l_1679 = (void*)0; uint32_t *l_1680 = &g_686.f7; uint32_t *l_1683 = &g_1055.f7; int32_t l_1687[1][3][2] = {{{(-5L),(-5L)},{(-1L),(-5L)},{(-5L),(-1L)}}}; int i, j, k; for (i = 0; i < 1; i++) l_1660[i] = &g_686.f4; l_1600 |= (safe_lshift_func_uint8_t_u_u((safe_sub_func_int64_t_s_s((safe_lshift_func_uint8_t_u_u(((((safe_unary_minus_func_int16_t_s((((*l_1661) = (safe_add_func_uint16_t_u_u(p_44, ((*l_1594) |= 0L)))) && (safe_sub_func_uint8_t_u_u((safe_lshift_func_uint8_t_u_u(((*g_1317) = (safe_mod_func_int8_t_s_s(l_1500, (safe_sub_func_int8_t_s_s((safe_mul_func_uint16_t_u_u(((((safe_add_func_uint8_t_u_u(((*l_1618) &= p_44), (safe_mod_func_uint64_t_u_u((l_1661 != &g_252), (~((((((&g_666[4] != ((safe_unary_minus_func_uint32_t_u(((*l_1683) |= (++(*l_1680))))) , l_1684)) & (safe_lshift_func_int16_t_s_u(g_959, 13))) , g_252) && l_1687[0][2][0]) > p_44) <= p_44)))))) >= l_1687[0][0][1]) >= 247UL) > p_44), l_1687[0][2][0])), l_1524[1][1][1]))))), g_636.f6)), l_1596))))) | 4UL) == g_772.f3) >= l_1510), 5)), p_43)), l_1510)); l_1540[6][0][3] = p_43; return &g_1542[5][1]; } (*l_1594) = ((((*l_1690) = (p_44 , (safe_lshift_func_int16_t_s_u(l_1620, 4)))) , l_1691) <= (safe_mul_func_uint8_t_u_u((((safe_mul_func_int16_t_s_s((l_1718 &= (safe_div_func_int64_t_s_s((l_1620 | (safe_mod_func_int64_t_s_s((safe_lshift_func_int16_t_s_u((0x0ADBL | ((+(((safe_mod_func_int8_t_s_s((safe_mul_func_int16_t_s_s((g_832.f4 = (p_43 = 0x8603L)), (((p_44 && ((safe_add_func_int32_t_s_s((!((safe_mul_func_uint8_t_u_u((((*l_1715) = &g_467[5][0]) != (l_1717 = &g_467[6][0])), (*g_1317))) | p_44)), l_1510)) ^ (*l_1618))) <= l_1599) || l_1599))), 0xA1L)) >= l_1540[2][3][4]) > (-1L))) > (*g_422))), 1)), (*l_1618)))), 18446744073709551607UL))), p_44)) | p_44) == (*l_1594)), p_44))); } g_1739--; for (g_610 = 0; (g_610 > 58); g_610 = safe_add_func_int64_t_s_s(g_610, 1)) { /* block id: 703 */ union U1 **l_1745 = &g_1103[3][3][2]; (*l_1745) = l_1744; l_1748 = l_1746; } for (g_1747.f3 = 5; (g_1747.f3 > 26); g_1747.f3 = safe_add_func_uint8_t_u_u(g_1747.f3, 7)) { /* block id: 709 */ uint16_t l_1758[3]; int32_t *l_1769 = &l_1600; uint32_t * const l_1809[1][8][4] = {{{&g_1233.f7,(void*)0,(void*)0,&g_1233.f7},{&g_1747.f7,(void*)0,(void*)0,(void*)0},{(void*)0,&g_1055.f7,(void*)0,(void*)0},{&g_1747.f7,&g_1747.f7,(void*)0,(void*)0},{&g_1233.f7,&g_1055.f7,&g_1233.f7,(void*)0},{&g_1233.f7,(void*)0,(void*)0,&g_1233.f7},{&g_1747.f7,(void*)0,(void*)0,(void*)0},{(void*)0,&g_1055.f7,(void*)0,(void*)0}}}; uint32_t * const *l_1808 = &l_1809[0][0][0]; uint16_t **l_1830 = &g_422; int16_t *l_1831 = &g_169; int i, j, k; for (i = 0; i < 3; i++) l_1758[i] = 0x021DL; for (g_832.f4 = 0; (g_832.f4 == 28); g_832.f4++) { /* block id: 712 */ union U1 **l_1764[5]; union U1 ***l_1763 = &l_1764[2]; union U1 ****l_1765[5][8] = {{(void*)0,(void*)0,(void*)0,(void*)0,&l_1763,&l_1763,&l_1763,(void*)0},{(void*)0,&l_1763,(void*)0,(void*)0,&l_1763,&l_1763,(void*)0,(void*)0},{&l_1763,&l_1763,&l_1763,&l_1763,&l_1763,&l_1763,&l_1763,&l_1763},{&l_1763,(void*)0,(void*)0,&l_1763,&l_1763,(void*)0,(void*)0,&l_1763},{(void*)0,(void*)0,&l_1763,&l_1763,&l_1763,(void*)0,(void*)0,(void*)0}}; int i, j; for (i = 0; i < 5; i++) l_1764[i] = &l_1744; if (p_43) break; (*l_1727) |= (safe_add_func_uint64_t_u_u((safe_add_func_uint32_t_u_u(l_1758[0], (p_44 && (-7L)))), ((safe_mod_func_uint16_t_u_u(l_1604, 8UL)) && (l_1758[0] < (safe_rshift_func_uint16_t_u_s(1UL, (((g_1766 = l_1763) != (p_44 , l_1768[6][2])) <= 65535UL))))))); } l_1594 = l_1769; for (l_1600 = 0; (l_1600 <= (-24)); --l_1600) { /* block id: 720 */ int64_t *l_1779 = (void*)0; int64_t *l_1780[1]; int32_t l_1785[4]; const int32_t l_1786 = 7L; int16_t *l_1787 = &g_169; int8_t *l_1795 = &l_1604; int8_t **l_1796 = &l_1635[0][2][3]; int8_t *l_1798 = &g_1542[3][0]; int8_t **l_1797 = &l_1798; uint64_t l_1810 = 1UL; int i; for (i = 0; i < 1; i++) l_1780[i] = &l_1511; for (i = 0; i < 4; i++) l_1785[i] = 0x95C50E6BL; (*l_1736) ^= ((((*g_422) , ((safe_sub_func_int32_t_s_s((safe_div_func_uint8_t_u_u((safe_div_func_int64_t_s_s((l_1718 &= l_1778), p_44)), ((*g_1317) = (l_1781 , g_1782)))), p_44)) & ((*l_1787) = (safe_mul_func_int16_t_s_s(0x91F2L, ((((l_1785[2] = 8UL) < (*l_1769)) > (*l_1769)) & l_1786)))))) , p_44) , 1L); if (p_44) continue; (*l_1726) = (safe_rshift_func_int16_t_s_s((l_1810 = (safe_mul_func_int8_t_s_s((((+(safe_mod_func_uint8_t_u_u((((*l_1796) = l_1795) == ((*l_1797) = &l_1637)), (((((*l_1795) = ((safe_add_func_uint64_t_u_u(0x00CFD5B21106CB65LL, (((safe_unary_minus_func_uint8_t_u(p_44)) , ((safe_div_func_int64_t_s_s(((((l_1785[2] && ((((l_1540[6][3][0] ^= (safe_mul_func_int16_t_s_s(p_44, (7L > (p_43 || (p_44 | l_1600)))))) , 0x0BA5BDFD9E9194EELL) || (*l_1594)) != 1L)) , g_1806) == l_1808) == l_1603), p_43)) < (*l_1594))) , 0x1357F7100DCAF822LL))) , p_44)) <= 0xBCL) >= p_44) , p_43)))) > 0x7FL) != l_1510), p_43))), 4)); } (*l_1735) = ((safe_rshift_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_u((((*l_1831) = ((g_1543 ^= ((((*l_1728) = ((safe_div_func_int8_t_s_s((safe_add_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s(((0xFAL && (safe_mod_func_uint32_t_u_u(((((safe_rshift_func_int8_t_s_u((0x8C31L <= (safe_mul_func_uint8_t_u_u((safe_rshift_func_int16_t_s_u(((safe_unary_minus_func_int32_t_s(0x20B482B8L)) >= (l_1830 == l_1830)), 5)), 0xC8L))), 5)) ^ (p_43 == (p_43 | l_1540[2][3][4]))) , g_199) > l_1781), (*l_1769)))) & 1L), 0)), (*l_1594))), (*l_1594))) , (*l_1594))) == p_44) >= p_44)) != 0xB1L)) ^ 8L), l_1620)), 7)) | 0UL); } } else { /* block id: 739 */ int8_t *l_1832 = &g_1542[4][4]; return l_1832; } (*l_1833) = ((p_43 || (p_43 && 5L)) , (void*)0); l_1606 ^= (safe_mul_func_uint8_t_u_u(((((((*g_1317) < 0xCDL) | (safe_add_func_uint64_t_u_u((((safe_rshift_func_int16_t_s_s((((0xD55F4039L || g_1235.f6) , ((*l_1851) = ((((safe_mul_func_uint8_t_u_u(((safe_unary_minus_func_uint64_t_u(p_43)) > (p_44 > ((safe_add_func_uint16_t_u_u(0xEB86L, (!((p_43 >= (safe_mod_func_int8_t_s_s(((l_1599 || (*l_1594)) ^ 0x63B9023AL), l_1781))) & p_43)))) , l_1500))), 1UL)) , l_1850) < (*l_1594)) <= p_44))) < p_43), 8)) , g_834.f4) , p_43), (*l_1594)))) || p_44) != l_1852) > l_1600), p_44)); } else { /* block id: 745 */ int8_t l_1857 = 0L; uint64_t **l_1862 = &g_467[6][1]; int32_t **l_1874 = (void*)0; l_1876 = (l_1875[7] = ((safe_add_func_uint16_t_u_u(((safe_mul_func_int8_t_s_s(l_1857, ((safe_mul_func_int8_t_s_s((l_1860 == ((*l_1862) = l_1861)), (l_1510 >= (safe_div_func_int8_t_s_s((safe_lshift_func_int8_t_s_s((safe_add_func_int8_t_s_s((!0L), ((safe_mod_func_uint32_t_u_u(l_1857, (((void*)0 != l_1872) , p_44))) , (*g_1317)))), g_1873)), p_43))))) < 0x0FL))) ^ (-7L)), g_252)) , &l_1540[2][3][4])); return &g_1542[6][0]; } if (((safe_sub_func_int16_t_s_s(((safe_lshift_func_uint8_t_u_s(((l_1881 != ((safe_rshift_func_int16_t_s_s(((((p_44 != (((l_1601 |= 0L) && ((safe_sub_func_int32_t_s_s((l_1850 && (safe_mul_func_int16_t_s_s((safe_mul_func_int16_t_s_s(p_44, ((((safe_add_func_int16_t_s_s(((((l_1603 , ((l_1893 = (void*)0) == l_1895[3])) , ((l_1896 == 1UL) ^ 0x8DL)) || g_849.f3) , p_43), 0xE417L)) == p_44) & 0xF39167B747B0232BLL) , l_1781))), l_1897))), p_44)) && (-1L))) >= l_1603)) <= p_43) ^ p_44) > (*g_422)), 7)) , &g_975)) , l_1601), 3)) <= 0xF89BL), (*g_422))) , 0x8EBFE0BAL)) { /* block id: 753 */ int32_t l_1898 = 0x227FC9A7L; int8_t ***l_1904 = (void*)0; int8_t **** const l_1903 = &l_1904; int64_t *l_1912 = (void*)0; int64_t *l_1913 = (void*)0; int64_t *l_1914 = &g_1544; l_1600 = l_1898; l_1606 |= ((safe_sub_func_int64_t_s_s(((safe_lshift_func_uint16_t_u_s(p_44, 6)) == (l_1903 == (l_1905 = l_1905))), l_1898)) | ((((*l_1914) = (~((((safe_mul_func_uint8_t_u_u(0x50L, 254UL)) & l_1898) , ((*l_1860) = 18446744073709551615UL)) || p_43))) ^ p_43) != (-1L))); } else { /* block id: 759 */ uint32_t **l_1941 = &l_1939; int32_t **l_1948 = &l_1875[7]; int16_t *l_1949 = &g_530; int32_t l_1950 = 1L; int64_t l_1951 = 1L; uint64_t l_1982 = 18446744073709551610UL; int32_t *l_1983 = &l_1540[2][0][5]; uint32_t *l_2044 = &g_1434; uint32_t *** const l_2069 = &g_1462; int32_t ****l_2087 = &g_980; int16_t l_2088[8][6] = {{0xB628L,0x5B2EL,1L,0x5B2EL,0xB628L,0xD765L},{0xB628L,0x3C00L,0x5B2EL,0x0671L,5L,5L},{0x3C00L,0x6CFAL,0x6CFAL,0x3C00L,1L,5L},{0xFBDCL,5L,0x5B2EL,0xD765L,0x0671L,0xD765L},{1L,0x977DL,1L,(-1L),0x0671L,0xB628L},{0x5B2EL,5L,0xFBDCL,1L,1L,0xFBDCL},{0x6CFAL,0x6CFAL,0x3C00L,1L,5L,(-1L)},{0x5B2EL,0x3C00L,0xB628L,(-1L),0xB628L,0x3C00L}}; const uint8_t l_2105 = 0x65L; union U1 *l_2140 = &g_2141; int16_t *l_2147 = &g_1233.f4; int i, j; if ((safe_lshift_func_uint16_t_u_s(((~l_1601) & (safe_rshift_func_uint16_t_u_u((((safe_div_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s((((*g_1317) |= ((g_1749.f4 = (safe_sub_func_uint32_t_u_u((l_1926 != l_1928), ((safe_rshift_func_uint8_t_u_u(7UL, 2)) <= (safe_mod_func_uint64_t_u_u((safe_mul_func_uint16_t_u_u((+(p_43 | ((((((*l_1949) ^= (safe_add_func_int64_t_s_s(((l_1940 = l_1938) == l_1941), (p_43 && (safe_add_func_uint64_t_u_u((safe_rshift_func_uint16_t_u_s(((safe_rshift_func_int16_t_s_s(((l_1948 = (*g_980)) == (*g_980)), g_667.f7)) > 0x3E52L), 9)), p_43)))))) > l_1950) , (void*)0) == l_1525) < l_1951))), (-1L))), l_1951)))))) ^ 0x8CCBL)) <= p_43), p_44)) > 4L), 0x0AL)) || p_44) , 65535UL), l_1952))), g_28[2]))) { /* block id: 765 */ uint32_t l_1953[9][10] = {{0xBF14E9A6L,0xEC0F0BABL,0x6A5B02BBL,0xEBFBAA6BL,18446744073709551608UL,0x8094575CL,0xBF14E9A6L,0xBF14E9A6L,0x8094575CL,18446744073709551608UL},{0xEC0F0BABL,0xB429B4E6L,0xB429B4E6L,0xEC0F0BABL,0x628D7945L,0x92FB14BDL,18446744073709551608UL,0UL,0xB429B4E6L,0xBF14E9A6L},{0x628D7945L,0xBF14E9A6L,0xA68F1D23L,1UL,0xBD6831DEL,0xA68F1D23L,0xB429B4E6L,18446744073709551608UL,0xB429B4E6L,0xA68F1D23L},{0xEBFBAA6BL,0xEC0F0BABL,0x617ED042L,0xEC0F0BABL,0xEBFBAA6BL,0x1E7D9368L,18446744073709551613UL,0xEBFBAA6BL,0x8094575CL,0xBD6831DEL},{18446744073709551608UL,0x628D7945L,1UL,0xEBFBAA6BL,1UL,0x92FB14BDL,0xBD6831DEL,0x628D7945L,0x628D7945L,0xBD6831DEL},{0UL,0xEBFBAA6BL,0xA68F1D23L,0xA68F1D23L,0xEBFBAA6BL,0UL,1UL,0xEC0F0BABL,0x92FB14BDL,0xA68F1D23L},{0xBF14E9A6L,18446744073709551608UL,0xEBFBAA6BL,1UL,0x628D7945L,18446744073709551608UL,1UL,0x92FB14BDL,0x9A211B9DL,0x92FB14BDL},{0x92FB14BDL,0xB5D71F1DL,18446744073709551615UL,0xA68F1D23L,18446744073709551615UL,0xB5D71F1DL,0x92FB14BDL,0xA3F4F7CCL,0xB5D71F1DL,1UL},{0xB5D71F1DL,0x92FB14BDL,0xA3F4F7CCL,0xB5D71F1DL,1UL,0x1E7D9368L,18446744073709551615UL,0xB429B4E6L,0xA3F4F7CCL,0xA3F4F7CCL}}; struct S0 *l_1962 = &g_1963[0]; int64_t *l_1972[3]; int64_t **l_1971 = &l_1972[2]; int32_t l_1973 = 6L; int32_t l_1974 = 1L; int i, j; for (i = 0; i < 3; i++) l_1972[i] = (void*)0; l_1953[2][9] = l_1524[1][1][1]; g_143 ^= (((((safe_div_func_int8_t_s_s(((l_1974 = (safe_rshift_func_int16_t_s_u((((g_737[0] = (((+0xDEC0AAD7FC00DDDBLL) , p_43) | 0x92L)) || ((**g_421) = ((safe_mul_func_uint16_t_u_u(5UL, (safe_unary_minus_func_int8_t_s(((l_1962 == ((safe_mod_func_int64_t_s_s((l_1973 = (safe_rshift_func_uint16_t_u_s(p_44, ((((safe_sub_func_int32_t_s_s((g_832.f3 < ((((l_1970 == l_1971) & 0x60C55AE0FAC054E6LL) < 246UL) , p_44)), p_43)) , l_1606) > p_43) > p_44)))), p_44)) , (void*)0)) < 8UL))))) >= p_44))) == 4294967293UL), l_1953[2][9]))) > g_567), l_1953[2][9])) || (*g_1317)) > l_1953[6][9]) , g_667.f6) , p_43); } else { /* block id: 772 */ int16_t l_1977 = 0x62EFL; int8_t l_1980 = 1L; uint32_t *l_2006 = &l_1524[1][1][1]; struct S0 *****l_2022[9] = {&l_1988,&l_1988,&l_1988,&l_1988,&l_1988,&l_1988,&l_1988,&l_1988,&l_1988}; uint32_t *l_2043[6][9][4] = {{{&g_610,&g_199,&g_610,&l_1620},{&l_1620,&g_1434,&g_1434,&g_610},{&g_610,&g_610,&g_1434,&g_610},{&g_610,&g_1434,&l_1620,&l_1620},{&g_610,&g_610,(void*)0,&l_1620},{&g_610,&l_1620,&g_610,&g_610},{(void*)0,&l_1620,(void*)0,&g_610},{&g_199,&l_1620,&g_1434,&g_610},{&l_1620,&l_1620,&g_610,&l_1620}},{{(void*)0,&g_610,&g_610,&l_1620},{&g_1434,&g_1434,&l_1620,&g_610},{&l_1620,&g_610,&l_1620,&g_610},{&g_610,&g_1434,&g_610,&l_1620},{(void*)0,&g_199,&g_199,&g_1434},{(void*)0,&g_610,&g_199,&g_610},{(void*)0,&l_1620,&g_610,&g_610},{&g_610,&g_199,&l_1620,(void*)0},{&l_1620,(void*)0,&l_1620,&g_610}},{{&g_1434,&g_610,&g_610,&g_1434},{(void*)0,&g_610,&g_610,&l_1620},{&l_1620,&l_1620,&g_1434,&g_199},{&g_199,&g_1434,(void*)0,&g_199},{(void*)0,&l_1620,&g_610,&l_1620},{&g_610,&g_610,(void*)0,&g_1434},{&g_610,&g_610,&l_1620,&g_610},{&g_610,(void*)0,&g_1434,(void*)0},{&g_610,&g_199,&g_1434,&g_610}},{{&l_1620,&l_1620,&g_610,&g_610},{&g_610,&g_610,&g_199,&g_1434},{&g_610,&g_199,&g_610,&l_1620},{&l_1620,&g_1434,&g_1434,&g_610},{&g_610,&g_610,&g_1434,&g_610},{&g_610,&g_1434,&l_1620,&l_1620},{&g_610,&g_610,(void*)0,&l_1620},{&g_610,&l_1620,&g_610,&g_610},{(void*)0,&l_1620,(void*)0,&g_610}},{{&g_199,&l_1620,&g_1434,&g_610},{&l_1620,&l_1620,&g_610,&l_1620},{(void*)0,&g_610,&g_610,(void*)0},{&l_1620,&g_610,&g_1434,&g_199},{&g_1434,&l_1620,&g_1434,&l_1620},{&g_199,&l_1620,&g_610,&g_610},{(void*)0,&g_1434,&g_1434,&l_1620},{&g_610,&g_610,&g_1434,&g_610},{(void*)0,&g_199,&g_610,&g_199}},{{&g_199,&l_1620,&g_1434,(void*)0},{&g_1434,(void*)0,&g_1434,&l_1620},{&l_1620,&g_610,&g_610,&l_1620},{&l_1620,&g_610,&g_199,&g_610},{(void*)0,&g_1434,&l_1620,&l_1620},{&g_1434,&g_610,(void*)0,&l_1620},{&g_610,&g_1434,&g_1434,&g_610},{&g_610,&g_610,&g_610,&l_1620},{&l_1620,&g_610,(void*)0,&l_1620}}}; int64_t *l_2045 = &l_1951; int32_t l_2051[8][6] = {{(-1L),0x3BB2C0E4L,0x3BB2C0E4L,(-1L),1L,(-1L)},{(-1L),1L,(-1L),0x3BB2C0E4L,0x3BB2C0E4L,(-1L)},{(-1L),(-1L),0x3BB2C0E4L,1L,0x3BB2C0E4L,(-1L)},{0x3BB2C0E4L,1L,1L,1L,1L,0x3BB2C0E4L},{(-1L),0x3BB2C0E4L,1L,0x3BB2C0E4L,(-1L),(-1L)},{(-1L),0x3BB2C0E4L,0x3BB2C0E4L,(-1L),1L,(-1L)},{(-1L),1L,(-1L),0x3BB2C0E4L,0x3BB2C0E4L,(-1L)},{(-1L),(-1L),0x3BB2C0E4L,1L,0x3BB2C0E4L,(-1L)}}; const int32_t *l_2058 = &g_98; uint8_t **l_2063 = &g_1317; uint16_t * const ***l_2138 = (void*)0; int i, j, k; if ((safe_lshift_func_uint8_t_u_u(l_1977, 0))) { /* block id: 773 */ int32_t ***l_1978 = &l_1948; uint16_t *l_1981 = &g_849.f3; if ((l_1978 == l_1979)) { /* block id: 774 */ if (l_1980) break; return &g_208; } else { /* block id: 777 */ int8_t *l_1984 = &g_1268; l_1982 &= ((*g_421) == l_1981); l_1983 = &l_1606; return l_1984; } } else { /* block id: 782 */ struct S0 ****l_1987[4]; uint32_t l_2009 = 4294967295UL; int8_t l_2014 = (-3L); int32_t l_2017 = 1L; int i; for (i = 0; i < 4; i++) l_1987[i] = &l_1872; for (l_1781 = 0; (l_1781 > (-18)); l_1781 = safe_sub_func_int16_t_s_s(l_1781, 8)) { /* block id: 785 */ struct S0 *****l_1989 = &l_1987[1]; (*l_1989) = (l_1988 = l_1987[1]); return &g_959; } for (g_1207 = (-30); (g_1207 <= (-27)); g_1207 = safe_add_func_int64_t_s_s(g_1207, 3)) { /* block id: 792 */ return &g_959; } for (g_238 = 0; (g_238 <= 2); g_238 += 1) { /* block id: 797 */ int64_t *l_2010 = &l_1951; (*l_1983) = ((safe_mod_func_int32_t_s_s((safe_sub_func_uint16_t_u_u(((safe_lshift_func_int16_t_s_u(g_252, 3)) != 5UL), (*g_422))), ((safe_mod_func_uint32_t_u_u((safe_rshift_func_int8_t_s_s((safe_div_func_uint8_t_u_u(((safe_add_func_int32_t_s_s((((l_2006 == (void*)0) , 1UL) , (safe_add_func_uint16_t_u_u(((l_1596 = ((*l_2010) = l_2009)) && 0x115A905A17D7B802LL), ((((safe_mod_func_int32_t_s_s(g_2013, 0x0D560DA3L)) <= p_44) , 1L) ^ l_2014)))), 4294967295UL)) && p_43), (*g_1317))), 2)), p_44)) || p_44))) <= p_43); (*l_1983) = (l_1596 = (l_2015 == l_2015)); l_2017 &= (!g_1544); } } if ((safe_mod_func_int8_t_s_s(((((safe_mul_func_int16_t_s_s((((*g_422) = ((((g_2023 = l_2022[3]) != (void*)0) && p_43) && (safe_sub_func_int32_t_s_s((((safe_mul_func_int16_t_s_s(((safe_sub_func_uint32_t_u_u((p_43 != p_43), (safe_add_func_int16_t_s_s((safe_mod_func_int64_t_s_s(((*l_2045) ^= ((safe_lshift_func_uint16_t_u_u((((((safe_mod_func_uint32_t_u_u((((*l_1983) = ((l_2038 <= (*g_1317)) == ((safe_add_func_uint32_t_u_u((((((safe_sub_func_int8_t_s_s(((((**l_1534) = l_1983) != (l_2044 = l_2043[2][1][2])) , l_1977), p_44)) <= l_1977) , &g_530) == &l_1500) | p_43), p_43)) , (-8L)))) , g_662[1][0].f7), 0xCCD34554L)) , (-1L)) || p_44) , 0x8E48E03F4529E959LL) , 65532UL), p_44)) , g_772.f7)), 18446744073709551615UL)), (-1L))))) | l_1980), l_1977)) , p_43) | 4294967286UL), g_1055.f3)))) && l_1596), 0x1053L)) ^ g_686.f6) , (*g_422)) != p_43), p_44))) { /* block id: 812 */ int32_t *l_2050[6] = {&g_1782,&g_1782,&g_1782,&g_1782,&g_1782,&g_1782}; uint8_t l_2056 = 6UL; int32_t l_2057 = 0x3599097BL; uint8_t ***l_2062[9][1] = {{&g_1316},{&g_1316},{&g_1316},{&g_1316},{&g_1316},{&g_1316},{&g_1316},{&g_1316},{&g_1316}}; int16_t *l_2074 = &g_686.f4; uint16_t l_2090 = 1UL; struct S0 **l_2096 = (void*)0; uint32_t l_2106 = 0x01ECC8D6L; int32_t l_2108 = 2L; int i, j; l_2057 |= ((p_44 && (((safe_lshift_func_int16_t_s_s(0x9DD0L, l_1980)) >= ((*l_2045) = (safe_sub_func_int16_t_s_s(((l_2051[1][1] = p_43) , g_772.f7), (((((*l_1525) = 65526UL) <= (p_44 >= (((safe_mod_func_int32_t_s_s((safe_lshift_func_int8_t_s_s((l_2056 | l_2056), p_43)), p_43)) , p_43) , 0xE0L))) < p_44) > p_44))))) | l_1637)) >= p_43); for (g_686.f3 = 1; (g_686.f3 <= 4); g_686.f3 += 1) { /* block id: 819 */ if (p_43) break; } l_2058 = &l_1718; if (((((*l_2058) || ((((*l_1949) = 0L) , l_2069) == (void*)0)) < (((((0xD3L != (safe_mod_func_uint64_t_u_u((((*l_2074) = (-5L)) >= (((**l_1907) = (safe_rshift_func_uint8_t_u_u(((*l_2058) > ((void*)0 != &g_980)), (*l_1983)))) > p_44)), 9L))) > 0L) > 1UL) , 0x30L) | 0x2CL)) >= p_43)) { /* block id: 828 */ uint64_t *l_2077 = (void*)0; int32_t l_2089 = (-7L); l_2089 = ((*l_1983) = (((((((*l_1882) = &g_1091) != l_2077) < (1L < (safe_rshift_func_int16_t_s_u(((*l_1949) = (((0xADBE5B12L != ((p_44 , (p_43 || (((safe_rshift_func_int8_t_s_u((safe_mod_func_uint8_t_u_u((((+(((*l_1908) |= ((safe_div_func_int8_t_s_s((&l_1979 != l_2087), ((0xD7FF72BD4E46154ALL || (-1L)) , 0x3BL))) != g_667.f4)) , g_1963[0].f6)) || 0x82AC8236AD029E22LL) , l_2088[5][0]), p_43)), p_44)) || g_93[0]) , 0x18DF31D2L))) <= p_43)) && (*l_2058)) >= (*l_2058))), 3)))) > 1L) || g_834.f7) & l_1850)); (*l_1983) = l_2090; } else { /* block id: 835 */ struct S0 **l_2095 = &g_666[4]; int32_t l_2103 = 0xD3132716L; int32_t l_2107 = 6L; (*l_1983) |= (4L || ((+(safe_mod_func_uint64_t_u_u(((((void*)0 == g_2094) & ((l_2096 = l_2095) != ((safe_mod_func_uint8_t_u_u((safe_sub_func_int8_t_s_s(((*l_2087) == &g_981), (l_2057 = ((safe_mul_func_int16_t_s_s(p_43, ((*l_1525) ^= l_2103))) != ((*g_1317) &= (!l_2105)))))), p_43)) , (void*)0))) >= (*l_2058)), p_44))) < l_2106)); g_2109--; if (p_44) break; } } else { /* block id: 844 */ uint16_t * const ** const *l_2113 = (void*)0; uint16_t * const ** const **l_2112[5]; uint16_t * const ****l_2139 = &l_2138; int i; for (i = 0; i < 5; i++) l_2112[i] = &l_2113; (*l_1983) = ((g_2117[0] = (g_2114[0][3][0] = (void*)0)) != ((*l_2139) = l_2138)); } } (**l_2015) = l_2140; (*l_1983) |= (((void*)0 == l_2142[0]) >= (g_2144 | (p_44 & (safe_mul_func_int16_t_s_s(((*l_2147) = (g_530 ^= 0xE51AL)), (safe_mul_func_int16_t_s_s(((safe_lshift_func_int16_t_s_s(p_44, ((p_43 != (safe_add_func_uint32_t_u_u(((*l_1939) |= ((safe_add_func_uint32_t_u_u(0x354D3C9AL, (((safe_mod_func_int8_t_s_s(((safe_lshift_func_uint8_t_u_u(l_1603, (*g_1317))) , p_44), p_44)) != 1UL) >= (**g_421)))) , p_44)), l_2160[8]))) && p_44))) && p_44), p_44))))))); } g_1738 = 0x203668E5L; } (*l_2161) = &g_98; return &g_208; } /* ------------------------------------------ */ /* * reads : g_1103 g_768 g_667.f3 g_171 g_421 g_422 g_28 g_169 g_667.f6 g_202 g_143 g_219 g_631 g_832.f6 g_93 g_849.f4 g_636.f3 g_1098 g_98 g_1207 g_208 g_1009 g_252 g_765 g_146 g_737 g_145 g_530 g_1055.f6 g_1091 g_557 g_686.f4 g_1235.f7 g_256 g_772.f3 g_192 g_1326 g_1317 g_329 g_30 g_667.f7 g_1055.f7 g_662.f4 g_1235.f3 g_766 g_1406 g_636.f7 g_1235.f4 g_1434 g_1090 g_401 g_402 g_1462 g_1233.f7 g_834.f3 g_1493 * writes: g_1103 g_768 g_662.f4 g_28 g_143 g_98 g_202 g_30 g_1098 g_567 g_631 g_662.f7 g_146 g_766 g_849.f4 g_530 g_767 g_765 g_610 g_666 g_192 g_667.f4 g_219 g_1091 g_557 g_772.f3 g_1316 g_1090 g_1326 g_819 g_1055.f7 g_256 g_1235.f3 g_1235.f4 g_1434 g_238 g_772.f7 g_93 g_1233.f7 g_1493 */ static int16_t func_45(uint8_t p_46, int32_t * const p_47, int32_t * p_48, int32_t * p_49, uint32_t p_50) { /* block id: 463 */ union U1 **l_1111 = (void*)0; union U1 **l_1112[10][9][2] = {{{&g_1103[3][3][2],&g_1103[3][1][1]},{(void*)0,(void*)0},{&g_1103[3][3][2],&g_1103[1][1][1]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[3][3][2],(void*)0},{(void*)0,&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[0][5][0],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[1][1][3]}},{{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[0][5][0],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[3][3][2]},{(void*)0,(void*)0},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[1][1][1]},{&g_1103[3][3][2],(void*)0},{(void*)0,&g_1103[3][1][1]},{&g_1103[3][3][2],&g_1103[3][3][2]}},{{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[2][4][0],&g_1103[1][3][3]},{&g_1103[3][3][2],(void*)0},{&g_1103[3][3][2],&g_1103[3][3][2]},{(void*)0,&g_1103[3][1][1]},{(void*)0,&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[1][1][1],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[3][3][2]}},{{(void*)0,&g_1103[3][1][1]},{(void*)0,&g_1103[3][3][2]},{&g_1103[3][3][2],(void*)0},{&g_1103[3][3][2],&g_1103[1][3][3]},{&g_1103[2][4][0],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[1][1][3],&g_1103[0][5][0]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[1][1][1],(void*)0}},{{(void*)0,(void*)0},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[2][4][0],&g_1103[3][3][2]},{&g_1103[1][1][3],&g_1103[1][1][1]},{&g_1103[3][5][3],&g_1103[1][1][3]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[1][1][3]},{&g_1103[3][5][3],&g_1103[1][1][1]},{&g_1103[1][1][3],&g_1103[3][3][2]}},{{&g_1103[2][4][0],&g_1103[3][3][2]},{&g_1103[3][3][2],(void*)0},{(void*)0,(void*)0},{&g_1103[1][1][1],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[0][5][0]},{&g_1103[1][1][3],&g_1103[3][3][2]},{(void*)0,&g_1103[1][1][3]},{(void*)0,&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[0][0][3]}},{{(void*)0,&g_1103[1][1][1]},{&g_1103[0][0][3],&g_1103[0][5][0]},{&g_1103[2][4][0],(void*)0},{&g_1103[1][1][1],(void*)0},{(void*)0,(void*)0},{&g_1103[1][1][1],(void*)0},{&g_1103[2][4][0],&g_1103[0][5][0]},{&g_1103[0][0][3],&g_1103[1][1][1]},{(void*)0,&g_1103[0][0][3]}},{{&g_1103[3][3][2],&g_1103[3][3][2]},{(void*)0,&g_1103[1][1][3]},{(void*)0,&g_1103[3][3][2]},{&g_1103[1][1][3],&g_1103[0][5][0]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[1][1][1],(void*)0},{(void*)0,(void*)0},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[2][4][0],&g_1103[3][3][2]}},{{&g_1103[1][1][3],&g_1103[1][1][1]},{&g_1103[3][5][3],&g_1103[1][1][3]},{&g_1103[3][3][2],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[1][1][3]},{&g_1103[3][5][3],&g_1103[1][1][1]},{&g_1103[1][1][3],&g_1103[3][3][2]},{&g_1103[2][4][0],&g_1103[3][3][2]},{&g_1103[3][3][2],(void*)0},{(void*)0,(void*)0}},{{&g_1103[1][1][1],&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[0][5][0]},{&g_1103[1][1][3],&g_1103[3][3][2]},{(void*)0,&g_1103[1][1][3]},{(void*)0,&g_1103[3][3][2]},{&g_1103[3][3][2],&g_1103[0][0][3]},{(void*)0,&g_1103[1][1][1]},{&g_1103[0][0][3],&g_1103[0][5][0]},{&g_1103[2][4][0],(void*)0}}}; int16_t l_1115[7] = {0xB905L,0xB905L,0xB905L,0xB905L,0xB905L,0xB905L,0xB905L}; uint8_t *l_1120 = &g_768; int16_t *l_1134 = &g_662[1][0].f4; int8_t *l_1143 = &g_30; uint16_t l_1175 = 0UL; uint64_t *l_1192 = &g_557[1]; uint64_t *l_1193 = &g_557[7]; uint64_t l_1220 = 6UL; struct S0 *l_1232 = &g_1233; int32_t l_1263[3][8][10] = {{{(-4L),(-7L),0x489986E1L,(-1L),0x0B065CA7L,0x91C8B1C8L,3L,(-8L),0xBF005B0EL,4L},{0xE45F306EL,(-7L),(-1L),0x2DC16B18L,0L,0x2DC16B18L,(-1L),(-7L),0xE45F306EL,(-1L)},{0xB2C9C4E0L,(-8L),(-4L),4L,3L,(-7L),0xE190D0CFL,(-8L),0x4E792B9EL,0x137952A1L},{(-5L),0x2DC16B18L,0xE45F306EL,4L,(-2L),0x137952A1L,(-2L),4L,0xE45F306EL,0x2DC16B18L},{0x0B065CA7L,(-8L),0xB2C9C4E0L,0x2DC16B18L,0x329AEDB8L,0xFA7F0743L,(-1L),0xA39F729BL,0xBF005B0EL,0x137952A1L},{(-2L),0xA39F729BL,(-5L),(-1L),(-1L),0xFA7F0743L,0xE45F306EL,0xFA7F0743L,(-1L),(-1L)},{0x0B065CA7L,0x365F53D5L,0x0B065CA7L,0xFA7F0743L,0xE190D0CFL,0x137952A1L,0x489986E1L,0x91C8B1C8L,0xB2C9C4E0L,4L},{(-2L),0xFA7F0743L,0x47224ED6L,0xA39F729BL,0xF2FDBBFEL,0x137952A1L,(-1L),(-1L),(-1L),0x137952A1L}},{{0x489986E1L,0x365F53D5L,0xBF005B0EL,0x365F53D5L,0x489986E1L,(-8L),(-1L),(-8L),(-4L),0xFA7F0743L},{2L,(-8L),(-2L),0xA39F729BL,(-5L),(-1L),(-1L),0xFA7F0743L,0xE45F306EL,0xFA7F0743L},{0x3B5C81A0L,0xA39F729BL,0x489986E1L,(-8L),0x489986E1L,0xA39F729BL,0x3B5C81A0L,(-7L),0xB2C9C4E0L,0x137952A1L},{(-1L),0x137952A1L,2L,0x2DC16B18L,0xF2FDBBFEL,(-1L),(-1L),0x365F53D5L,(-5L),(-7L)},{0x0B065CA7L,0x137952A1L,0x3B5C81A0L,(-8L),3L,(-8L),0x3B5C81A0L,0x137952A1L,0x0B065CA7L,0x2DC16B18L},{0xE45F306EL,0xA39F729BL,(-1L),(-7L),(-1L),0x137952A1L,(-1L),0x365F53D5L,(-2L),0x91C8B1C8L},{0x329AEDB8L,(-8L),0x0B065CA7L,(-7L),(-1L),0x91C8B1C8L,(-1L),(-7L),0x0B065CA7L,(-8L)},{0xF2FDBBFEL,0x365F53D5L,0xE45F306EL,(-8L),0x47224ED6L,(-8L),(-1L),0xFA7F0743L,(-5L),0x91C8B1C8L}},{{(-1L),0xFA7F0743L,0x329AEDB8L,0x2DC16B18L,0xB2C9C4E0L,(-8L),0x0B065CA7L,(-8L),0xB2C9C4E0L,0x2DC16B18L},{0xF2FDBBFEL,4L,0xF2FDBBFEL,(-8L),(-1L),0x91C8B1C8L,2L,(-1L),0xE45F306EL,(-7L)},{0x329AEDB8L,0xFA7F0743L,(-1L),0xA39F729BL,0xBF005B0EL,0x137952A1L,(-4L),(-1L),(-4L),0x137952A1L},{0xE45F306EL,0x365F53D5L,0xF2FDBBFEL,0x365F53D5L,0xE45F306EL,(-8L),0x47224ED6L,(-8L),(-1L),0xFA7F0743L},{0x0B065CA7L,(-8L),0x329AEDB8L,0xA39F729BL,0x4E792B9EL,(-1L),3L,0xFA7F0743L,0x489986E1L,0xFA7F0743L},{(-1L),0xA39F729BL,0xE45F306EL,(-8L),0xE45F306EL,0xA39F729BL,(-1L),(-7L),(-1L),0x137952A1L},{0x3B5C81A0L,0x137952A1L,0x0B065CA7L,0x2DC16B18L,0xBF005B0EL,(-1L),0xB2C9C4E0L,0x365F53D5L,0x4E792B9EL,(-7L)},{2L,0x137952A1L,(-1L),(-8L),(-1L),(-8L),(-1L),0x137952A1L,2L,0x2DC16B18L}}}; uint8_t l_1280 = 0x58L; uint8_t **l_1314 = &l_1120; struct S0 ***l_1405 = (void*)0; struct S0 ****l_1404 = &l_1405; uint16_t ***l_1422 = (void*)0; int64_t l_1429 = (-4L); int32_t l_1430 = 0xBDDB8271L; int64_t l_1490 = 0x16B891F3B1ED0E1FLL; uint16_t ***l_1497 = &g_819; int i, j, k; g_1103[3][3][2] = g_1103[3][3][2]; if (((safe_rshift_func_int8_t_s_s((p_46 < (((5L != p_50) || (l_1115[3] | (safe_lshift_func_uint8_t_u_s(((safe_lshift_func_uint8_t_u_u((++(*l_1120)), 6)) & (safe_div_func_uint64_t_u_u((g_667.f3 , (safe_sub_func_uint32_t_u_u(((safe_mul_func_uint16_t_u_u((((((safe_div_func_int16_t_s_s(0x6FF2L, ((**g_421) |= (+((l_1115[3] , 1L) >= (safe_add_func_int16_t_s_s(((*l_1134) = g_171), 0x34C6L))))))) , (**g_421)) == l_1115[3]) == g_169) != g_667.f6), 0x2065L)) | l_1115[2]), (*g_202)))), p_46))), p_50)))) < p_50)), p_46)) <= 2L)) { /* block id: 468 */ (*g_202) |= 0x3D6B579CL; } else { /* block id: 470 */ int32_t *l_1137 = &g_631; int32_t **l_1138 = &g_202; (*p_47) = ((safe_lshift_func_uint16_t_u_u(l_1115[3], 1)) , (*p_49)); (*l_1138) = l_1137; } if ((!(+(g_219 | ((**g_421) = ((safe_lshift_func_int8_t_s_s(((*l_1143) = 1L), 3)) == l_1115[1])))))) { /* block id: 476 */ int8_t l_1164[1][10][3] = {{{0L,0xAEL,0x61L},{(-3L),0L,0L},{0L,0xAEL,0x61L},{(-3L),0L,0L},{0L,0xAEL,0x61L},{(-3L),0L,0L},{0L,0xAEL,0xE6L},{0L,0x19L,0x19L},{0x61L,0x6CL,0xE6L},{0L,0x19L,0x19L}}}; union U1 ***l_1165[4][4] = {{&l_1112[3][6][0],&l_1112[0][6][1],&l_1112[0][6][1],&l_1112[3][6][0]},{&l_1112[0][6][1],&l_1112[3][6][0],&l_1112[0][6][1],&l_1112[0][6][1]},{&l_1112[3][6][0],&l_1112[3][6][0],&l_1112[0][4][0],&l_1112[3][6][0]},{&l_1112[3][6][0],&l_1112[0][6][1],&l_1112[0][6][1],&l_1112[3][6][0]}}; int32_t l_1166 = 9L; int8_t **l_1240 = &l_1143; int32_t l_1264 = 0xF5570790L; int32_t l_1265 = (-5L); int32_t l_1266 = 0x1AEE6B8CL; int32_t l_1267 = (-1L); int32_t l_1272[8][10][3] = {{{0x1A15789EL,0L,0x1A15789EL},{(-1L),0xDE85898DL,2L},{0xB9B13412L,0x4A2361B0L,(-5L)},{(-2L),0L,(-5L)},{0x20BA6CD3L,0x22C49F3DL,1L},{(-2L),0x8D02A92DL,0xAC18E425L},{0xB9B13412L,6L,(-1L)},{(-1L),0xD4FB73E4L,(-9L)},{0x1A15789EL,(-1L),7L},{0x77BAF2EDL,0x08EAA5D0L,0x4379F22BL}},{{0x673FD64EL,(-4L),0L},{0x8D02A92DL,0x20BA6CD3L,0x55FBAEBEL},{5L,0L,0x24749790L},{0x22C49F3DL,0xCBC7D41AL,0L},{0x6B42232DL,0x76DDD5CDL,9L},{(-4L),(-8L),0x13D45352L},{0L,0L,0x95DF29FEL},{0xBE8B802FL,0x6E6D3772L,0x26EBC274L},{(-10L),1L,0x244B5B8FL},{0x6E6D3772L,0x668B8BDFL,1L}},{{0L,0x1850D85CL,0xA233CE73L},{0x578A854FL,0x1850D85CL,0L},{9L,0x668B8BDFL,0x79F313FCL},{0x27A57435L,1L,0x03941BCFL},{0x78893615L,0x6E6D3772L,1L},{0x4379F22BL,0L,0L},{0x24749790L,(-8L),0x22C49F3DL},{(-1L),0x76DDD5CDL,0x69CF0710L},{1L,0xCBC7D41AL,(-8L)},{6L,0L,(-1L)}},{{0L,0x20BA6CD3L,(-1L)},{0x11A3BF00L,(-4L),0x78893615L},{0xC4482F14L,0x08EAA5D0L,0x73DF98BDL},{0x1E834188L,(-1L),0xC4482F14L},{0xD4FB73E4L,0xD4FB73E4L,0L},{(-9L),6L,0x447AC51FL},{0L,0x8D02A92DL,0L},{0x520B131AL,0x22C49F3DL,1L},{(-1L),0L,0L},{0x668B8BDFL,0x4A2361B0L,0x447AC51FL}},{{0x79F313FCL,0xDE85898DL,0L},{0x1289EBE0L,0L,0xC4482F14L},{0x55FBAEBEL,0xC6EAC89DL,0x73DF98BDL},{(-1L),(-1L),0x78893615L},{9L,0x27A57435L,(-1L)},{0x447AC51FL,(-5L),(-1L)},{0xA233CE73L,0x03941BCFL,(-8L)},{0L,(-1L),0x69CF0710L},{1L,0x69CF0710L,0x22C49F3DL},{(-5L),1L,0L}},{{(-4L),0x71397493L,1L},{0xDE85898DL,(-5L),0x03941BCFL},{1L,7L,0x79F313FCL},{1L,0x26EBC274L,0L},{1L,0x11A3BF00L,0xA233CE73L},{0L,0x69CF0710L,(-9L)},{0xCE5D9EA0L,2L,0xA6CE9928L},{(-9L),0x20BA6CD3L,0L},{0x27A57435L,(-5L),0xBE8B802FL},{(-1L),0x8D02A92DL,0xE6AD8782L}},{{1L,(-1L),0x03941BCFL},{0xDE85898DL,(-5L),(-2L)},{(-2L),0x578A854FL,0x4A2361B0L},{1L,0L,0x20BA6CD3L},{0xB7705717L,0x03941BCFL,0x76DDD5CDL},{0x03941BCFL,0x08EAA5D0L,0x6EE2A1D5L},{0xC4482F14L,0L,5L},{0x20BA6CD3L,0x11A3BF00L,0x11A3BF00L},{(-1L),1L,0L},{0L,0xE6AD8782L,(-1L)}},{{0x79F313FCL,0x6EE2A1D5L,(-1L)},{1L,(-1L),1L},{0x8D02A92DL,0x6EE2A1D5L,2L},{9L,0xE6AD8782L,0L},{0x11A3BF00L,1L,0x578A854FL},{0L,0x11A3BF00L,1L},{0L,0L,0x4379F22BL},{0xA233CE73L,0x08EAA5D0L,1L},{(-9L),0x03941BCFL,(-4L)},{0x13D45352L,0L,1L}}}; int32_t *l_1313 = &g_631; struct S0 * const *l_1376 = &g_831; uint32_t ***l_1381 = (void*)0; int i, j, k; if (((((((safe_lshift_func_uint8_t_u_s((safe_mul_func_int16_t_s_s(0x685AL, ((((safe_div_func_uint16_t_u_u(((**g_421) = ((safe_mod_func_uint64_t_u_u(((l_1166 = (((safe_add_func_uint8_t_u_u((safe_sub_func_int8_t_s_s(((0x199421BF8A430E99LL <= p_50) <= (((safe_rshift_func_uint16_t_u_s((((safe_add_func_int32_t_s_s((safe_add_func_int64_t_s_s(((((*g_202) & ((*p_48) = (*p_48))) || g_832.f6) | ((l_1112[3][6][0] = (((0x723EA659L != ((safe_rshift_func_int8_t_s_u(((0xFE99L | (((-3L) >= l_1164[0][0][1]) && 3UL)) & l_1164[0][1][0]), 1)) , l_1115[5])) > l_1164[0][0][1]) , (void*)0)) == (void*)0)), g_93[2])), 1UL)) | p_46) > p_46), 12)) == l_1164[0][0][1]) && p_46)), p_46)), l_1164[0][0][0])) <= p_46) > 0xD5L)) | p_46), l_1164[0][0][1])) || 0L)), p_50)) , 0x9071L) | g_849.f4) , l_1115[2]))), 4)) < 0UL) & l_1164[0][6][0]) , 9UL) <= l_1164[0][0][1]) <= g_636.f3)) { /* block id: 481 */ int64_t l_1167[2]; int32_t *l_1168 = &g_98; int32_t *l_1169 = &g_98; int32_t *l_1170 = &l_1166; int32_t *l_1171 = (void*)0; int32_t *l_1172 = &g_98; int32_t *l_1173 = &g_98; int32_t *l_1174[3][6]; int i, j; for (i = 0; i < 2; i++) l_1167[i] = 0L; for (i = 0; i < 3; i++) { for (j = 0; j < 6; j++) l_1174[i][j] = &l_1166; } ++l_1175; for (g_1098 = 0; (g_1098 <= 30); g_1098++) { /* block id: 485 */ uint64_t *l_1190 = &g_557[1]; uint64_t **l_1191[7][7] = {{&l_1190,&g_467[5][1],&l_1190,&g_467[5][0],&g_467[5][0],&g_467[5][0],&l_1190},{&l_1190,&l_1190,&l_1190,&l_1190,&l_1190,&l_1190,&l_1190},{&g_467[5][0],&g_467[5][0],&l_1190,&g_467[5][1],&l_1190,&g_467[5][0],&g_467[5][0]},{&g_467[4][1],&l_1190,&g_467[4][1],&g_467[4][1],&l_1190,&g_467[4][1],&g_467[4][1]},{&g_467[5][0],&g_467[5][1],(void*)0,&g_467[5][1],&g_467[5][0],&g_467[4][1],&g_467[5][0]},{&l_1190,&g_467[4][1],&g_467[4][1],&l_1190,&g_467[4][1],&g_467[4][1],&l_1190},{&l_1190,&g_467[5][1],&l_1190,&g_467[5][0],&g_467[5][0],&g_467[5][0],&l_1190}}; int32_t l_1206[7]; int32_t l_1208 = 0xB52AF3E1L; struct S0 * const *l_1213 = (void*)0; int i, j; for (i = 0; i < 7; i++) l_1206[i] = 0xB8AAC2A4L; (*g_202) ^= (((+(*l_1168)) & ((safe_lshift_func_uint16_t_u_s(p_46, p_50)) & (safe_mul_func_uint16_t_u_u(p_50, (0x1AL >= (g_567 = (+((safe_sub_func_uint64_t_u_u((safe_mul_func_uint16_t_u_u(0UL, ((l_1192 = l_1190) != l_1193))), ((((*l_1120) = ((((safe_add_func_int16_t_s_s(((safe_mod_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s((safe_mod_func_uint16_t_u_u((((safe_add_func_int8_t_s_s((l_1206[3] |= (safe_add_func_int32_t_s_s(l_1175, p_46))), 0x66L)) != g_1207) >= p_46), l_1208)), p_46)), g_208)) ^ l_1208), (*l_1168))) , 0x38E3F328L) > (*p_49)) , p_50)) , p_46) , 0xF859B4C8D976DA0ELL))) , p_46)))))))) , (*p_49)); (*p_47) ^= (-7L); (*l_1173) = ((safe_rshift_func_int8_t_s_s(((p_46 < (((void*)0 == g_1009) | ((*g_422) == (safe_lshift_func_uint8_t_u_s(p_50, 5))))) , l_1208), 0)) != ((((((void*)0 == l_1213) | ((*p_48) = (+(!(safe_lshift_func_uint16_t_u_s((0xC66120E8151D99BDLL < 0xA1C9F451E2635F73LL), g_252)))))) ^ g_765) <= p_50) > l_1115[4])); } } else { /* block id: 495 */ int16_t l_1218 = 0xD024L; struct S0 *l_1234 = &g_1235; int32_t l_1257 = 0x6383042EL; int32_t l_1269 = (-9L); int32_t l_1270 = 0x3225A744L; int32_t l_1271[9] = {0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L,0x39BF77C6L}; uint64_t l_1273 = 18446744073709551613UL; uint32_t l_1285[1]; int16_t *l_1302 = &g_849.f4; uint8_t ***l_1315[4] = {&l_1314,&l_1314,&l_1314,&l_1314}; int i; for (i = 0; i < 1; i++) l_1285[i] = 4294967295UL; if (l_1218) { /* block id: 496 */ union U1 **l_1219 = &g_1103[3][3][2]; int8_t l_1230 = (-1L); uint32_t *l_1231 = &g_662[1][0].f7; (*p_48) &= ((&g_1103[3][3][2] == l_1219) && (0xD104C3C9B2FF9021LL > (l_1220 , ((safe_mod_func_int8_t_s_s(((safe_rshift_func_int16_t_s_s((-1L), (l_1115[2] ^ (((*l_1231) = ((+(safe_mod_func_int16_t_s_s(1L, (safe_add_func_uint8_t_u_u(l_1230, ((*l_1120) = 0xC0L)))))) , p_50)) , p_46)))) , l_1166), 0xBCL)) >= 0xEE88D2A527741443LL)))); l_1234 = l_1232; } else { /* block id: 501 */ const int64_t *l_1247 = &g_256; int32_t l_1254 = 0xF9BB1B68L; int32_t l_1258[1]; uint16_t l_1303 = 1UL; int32_t **l_1311 = (void*)0; int32_t **l_1312[6][6][5] = {{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}},{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}},{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}},{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}},{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}},{{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202},{&g_202,&g_202,&g_202,&g_202,&g_202}}}; int i, j, k; for (i = 0; i < 1; i++) l_1258[i] = 0xCA22A3F9L; for (g_146 = 28; (g_146 >= 20); --g_146) { /* block id: 504 */ int32_t *l_1260 = (void*)0; int32_t *l_1261 = &l_1166; int32_t *l_1262[6] = {&l_1258[0],&l_1258[0],&l_1258[0],&l_1258[0],&l_1258[0],&l_1258[0]}; int i; if ((safe_sub_func_uint8_t_u_u(((void*)0 == l_1240), g_169))) { /* block id: 505 */ uint32_t *l_1244[5][7][6] = {{{&g_238,&g_849.f7,&g_192,&g_662[1][0].f7,(void*)0,(void*)0},{&g_667.f7,&g_662[1][0].f7,&g_667.f7,&g_696,&g_667.f7,&g_662[1][0].f7},{(void*)0,&g_1055.f7,&g_211,&g_211,&g_832.f7,&g_832.f7},{&g_211,&g_192,(void*)0,&g_211,&g_696,&g_211},{&g_696,&g_192,&g_834.f7,&g_849.f7,&g_832.f7,&g_1235.f7},{&g_1233.f7,&g_1055.f7,(void*)0,&g_238,&g_667.f7,&g_211},{&g_145,&g_662[1][0].f7,&g_238,&g_1235.f7,(void*)0,&g_211}},{{&g_1233.f7,&g_849.f7,&g_832.f7,(void*)0,&g_832.f7,&g_686.f7},{&g_1233.f7,&g_686.f7,(void*)0,&g_1235.f7,&g_192,&g_145},{&g_145,&g_238,&g_696,&g_238,(void*)0,&g_1055.f7},{(void*)0,&g_832.f7,&g_832.f7,&g_1235.f7,(void*)0,&g_192},{&g_772.f7,&g_1055.f7,&g_1233.f7,&g_832.f7,&g_686.f7,&g_192},{&g_696,&g_211,&g_832.f7,&g_686.f7,&g_667.f7,&g_1055.f7},{&g_686.f7,&g_238,&g_772.f7,&g_686.f7,&g_696,&g_662[1][0].f7}},{{&g_834.f7,&g_1235.f7,(void*)0,&g_145,&g_238,&g_849.f7},{&g_145,&g_1055.f7,&g_667.f7,&g_238,&g_238,&g_686.f7},{&g_145,&g_1235.f7,&g_145,&g_238,&g_696,&g_238},{&g_832.f7,&g_238,&g_832.f7,(void*)0,&g_667.f7,&g_211},{&g_238,&g_211,(void*)0,&g_696,&g_686.f7,&g_1235.f7},{(void*)0,&g_1055.f7,&g_145,&g_696,(void*)0,(void*)0},{&g_238,&g_832.f7,&g_696,(void*)0,(void*)0,&g_145}},{{&g_832.f7,&g_849.f7,&g_849.f7,&g_238,&g_1233.f7,&g_211},{&g_145,&g_849.f7,&g_1233.f7,&g_238,&g_211,(void*)0},{&g_145,&g_1235.f7,&g_1233.f7,&g_145,&g_832.f7,&g_211},{&g_834.f7,&g_145,&g_849.f7,&g_686.f7,&g_849.f7,&g_145},{&g_686.f7,(void*)0,&g_696,&g_686.f7,&g_832.f7,(void*)0},{&g_696,&g_211,&g_145,&g_832.f7,&g_772.f7,&g_1235.f7},{&g_772.f7,&g_211,(void*)0,&g_1235.f7,&g_832.f7,&g_211}},{{(void*)0,(void*)0,&g_832.f7,&g_849.f7,&g_849.f7,&g_238},{(void*)0,&g_145,&g_145,&g_211,&g_832.f7,&g_686.f7},{&g_1235.f7,&g_1235.f7,&g_667.f7,&g_211,&g_211,&g_849.f7},{&g_1235.f7,&g_849.f7,(void*)0,&g_211,&g_1233.f7,&g_662[1][0].f7},{(void*)0,&g_849.f7,&g_772.f7,&g_849.f7,(void*)0,&g_1055.f7},{(void*)0,&g_832.f7,&g_832.f7,&g_1235.f7,(void*)0,&g_192},{&g_772.f7,&g_1055.f7,&g_1233.f7,&g_832.f7,&g_686.f7,&g_192}}}; uint32_t **l_1243 = &l_1244[0][3][2]; int32_t l_1245 = (-1L); int32_t **l_1246 = &g_202; int i, j, k; (*l_1246) = func_52(p_49, ((safe_mul_func_int16_t_s_s(0xE104L, (((*l_1243) = &g_696) != (void*)0))) , (g_93[2] != 0x800CL)), l_1245); (*p_48) = (*p_49); } else { /* block id: 509 */ const int64_t **l_1248 = (void*)0; const int64_t **l_1249 = &l_1247; int64_t *l_1255 = &g_767; int8_t *l_1256 = &g_766; int32_t l_1259 = 0xF5186DA9L; (*p_49) = ((*g_202) = (((p_50 < ((l_1257 = ((0x33L != (((*l_1192) &= (((-10L) <= (((*l_1249) = l_1247) != &g_1089)) | ((*l_1256) = (((safe_sub_func_int64_t_s_s(0x7EED0879D7AAC280LL, p_46)) == (safe_div_func_int64_t_s_s(((*l_1255) = ((((**l_1240) = p_50) || 0x4EL) , l_1254)), p_46))) != 0xE79EL)))) < 0UL)) & 0x2AC32224A2281EB2LL)) ^ l_1258[0])) , 2L) & 255UL)); return l_1259; } (*p_49) = l_1218; --l_1273; (*p_47) ^= (((safe_div_func_uint16_t_u_u(l_1258[0], ((((0x55L != (((safe_sub_func_uint8_t_u_u(l_1280, ((safe_sub_func_int32_t_s_s(((safe_mul_func_uint8_t_u_u(l_1285[0], 0x2EL)) | (+(&g_1207 == (void*)0))), ((*p_48) = ((((safe_rshift_func_uint16_t_u_u(p_46, 11)) & ((safe_unary_minus_func_uint32_t_u((safe_div_func_int8_t_s_s(((safe_div_func_int64_t_s_s((safe_add_func_int8_t_s_s((safe_add_func_int8_t_s_s((safe_add_func_uint8_t_u_u((safe_lshift_func_int8_t_s_s(((**l_1240) = (g_1098 && l_1254)), p_50)), 0x1EL)), 0x9DL)), p_50)), l_1258[0])) | p_46), g_686.f4)))) ^ 0xD4A7L)) < l_1164[0][8][0]) == g_1235.f7)))) , p_50))) , l_1302) == &l_1115[3])) , g_256) != 7L) , l_1303))) || 4L) , (*p_49)); } for (g_772.f3 = 0; (g_772.f3 <= 8); g_772.f3 = safe_add_func_uint8_t_u_u(g_772.f3, 8)) { /* block id: 528 */ int32_t *l_1308 = &g_765; (*p_49) = (safe_sub_func_int32_t_s_s(l_1265, (((*l_1308) = p_46) , 1UL))); for (g_192 = 0; (g_192 != 40); ++g_192) { /* block id: 533 */ return l_1271[1]; } (*p_49) = ((*g_202) &= 0xA171E375L); } l_1313 = p_49; } g_1316 = l_1314; for (l_1267 = 0; (l_1267 < 8); l_1267++) { /* block id: 544 */ int16_t l_1325 = 0xBA24L; int32_t ****l_1379 = &g_980; int32_t l_1380 = 5L; if ((*p_47)) { /* block id: 545 */ uint16_t ***l_1351 = &g_819; int8_t **l_1358 = &l_1143; for (g_1090 = 0; (g_1090 < (-21)); g_1090--) { /* block id: 548 */ int8_t l_1322 = 0x53L; int32_t *l_1323 = &l_1263[0][2][6]; int32_t *l_1324[4][6] = {{&l_1271[3],&l_1266,&l_1271[3],&l_1266,&l_1271[3],&l_1266},{&l_1271[2],&l_1266,&l_1271[2],&l_1266,&l_1271[2],&l_1266},{&l_1271[3],&l_1266,&l_1271[3],&l_1266,&l_1271[3],&l_1266},{&l_1271[2],&l_1266,&l_1271[2],&l_1266,&l_1271[2],&l_1266}}; int i, j; if ((*p_49)) break; --g_1326; } (*p_49) = ((((safe_add_func_uint64_t_u_u((p_50 == (safe_add_func_uint64_t_u_u(((((safe_mul_func_uint16_t_u_u(((((safe_sub_func_uint32_t_u_u((safe_rshift_func_uint16_t_u_u((safe_rshift_func_uint8_t_u_u((*g_1317), (safe_add_func_int16_t_s_s(((~(safe_div_func_int16_t_s_s((((safe_div_func_int16_t_s_s(p_46, ((!(safe_lshift_func_uint16_t_u_s(((((((*l_1351) = &g_422) == (void*)0) != ((safe_mod_func_int8_t_s_s((safe_sub_func_int16_t_s_s(((*l_1302) = (safe_mul_func_int8_t_s_s((((*l_1143) &= p_50) && p_46), (((*l_1313) & ((*l_1134) = l_1263[1][1][5])) != p_46)))), 0x1B8CL)), 0xE4L)) & g_329)) , g_143) & 18446744073709551615UL), p_50))) , 0x5F41L))) , l_1358) != (void*)0), 0x026EL))) > p_50), g_667.f7)))), 12)), 4294967294UL)) , 0UL) , 0xE32F8068L) , p_50), (-4L))) || 6L) & 0x99E54AEF6E1BEC4ALL) < p_50), 0x7C8DE11A19E7601ELL))), p_46)) ^ 8UL) > 0xE1ADBA2C55C89707LL) & l_1175); return l_1220; } else { /* block id: 558 */ int64_t l_1362 = 0xA86B96D8C66033EALL; int32_t **l_1363 = (void*)0; int32_t **l_1364 = &g_202; uint32_t ***l_1383 = (void*)0; for (g_98 = 0; (g_98 <= 3); g_98 += 1) { /* block id: 561 */ int32_t l_1361 = 0L; int i; (*p_49) = ((l_1115[g_98] <= p_50) && (((p_46 , l_1115[g_98]) ^ 4L) || ((((4L || (safe_mul_func_int16_t_s_s(p_50, l_1361))) , (((p_50 && l_1362) ^ l_1271[4]) , (void*)0)) != &g_402[0][3]) <= (*l_1313)))); } (*l_1364) = (p_49 = &l_1270); for (g_1055.f7 = (-17); (g_1055.f7 == 48); g_1055.f7++) { /* block id: 568 */ int32_t ****l_1378 = (void*)0; int32_t *****l_1377[7] = {&l_1378,&l_1378,&l_1378,&l_1378,&l_1378,&l_1378,&l_1378}; uint32_t ****l_1382[7][10] = {{(void*)0,&l_1381,&l_1381,(void*)0,&l_1381,&l_1381,&l_1381,&l_1381,(void*)0,&l_1381},{(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,&l_1381,&l_1381,&l_1381,&l_1381,(void*)0},{(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381},{(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0},{(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,&l_1381,&l_1381},{(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0},{(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381,&l_1381,(void*)0,(void*)0,&l_1381}}; int i, j; (*p_48) &= (-6L); (*g_202) = (l_1380 = (safe_mul_func_int8_t_s_s(p_46, ((((safe_unary_minus_func_uint64_t_u(l_1325)) != l_1325) , (g_256 = (safe_sub_func_uint8_t_u_u((safe_rshift_func_uint8_t_u_u(p_50, (g_169 , ((g_530 = ((*l_1134) ^= (((*l_1302) |= (((((**l_1314)--) , &g_666[2]) == l_1376) <= ((l_1379 = &g_980) != (void*)0))) || 1L))) != p_46)))), p_46)))) < p_46)))); l_1383 = l_1381; (*g_202) &= l_1220; } for (g_1235.f3 = 14; (g_1235.f3 == 46); g_1235.f3++) { /* block id: 583 */ return l_1270; } } } } for (g_1235.f3 = 16; (g_1235.f3 < 57); g_1235.f3 = safe_add_func_uint8_t_u_u(g_1235.f3, 5)) { /* block id: 591 */ return g_557[1]; } } else { /* block id: 594 */ uint32_t l_1394 = 5UL; int32_t l_1397 = 0x64DC78DBL; int32_t l_1427 = 0x2F05286FL; int32_t l_1428 = 3L; uint64_t l_1431 = 1UL; for (g_766 = 0; (g_766 > 27); ++g_766) { /* block id: 597 */ uint32_t *l_1392 = (void*)0; uint32_t *l_1393[6][4] = {{&g_199,&g_199,&g_199,&g_199},{&g_199,&g_199,&g_199,&g_199},{&g_199,&g_199,&g_199,&g_199},{&g_199,&g_199,&g_199,&g_199},{&g_199,&g_199,&g_199,&g_199},{&g_199,&g_199,&g_199,&g_199}}; const struct S0 *l_1400 = &g_1401; const struct S0 **l_1399[4][1] = {{&l_1400},{(void*)0},{&l_1400},{(void*)0}}; const struct S0 ***l_1398 = &l_1399[0][0]; int32_t l_1419 = (-4L); uint16_t ***l_1423 = &g_819; int32_t *l_1425 = &g_98; int32_t *l_1426[2][4][5] = {{{&l_1263[2][5][7],&l_1419,&g_98,&g_98,&l_1419},{&l_1263[1][0][5],&g_143,&l_1419,&l_1419,&g_631},{&g_143,&g_98,&l_1419,&l_1263[1][4][3],&l_1419},{&g_631,&g_631,&g_98,&l_1263[1][0][5],(void*)0}},{{&g_143,(void*)0,&l_1263[2][5][7],&l_1263[1][0][5],&l_1263[1][0][5]},{&l_1263[1][0][5],(void*)0,&l_1263[1][0][5],&l_1263[1][4][3],(void*)0},{&l_1263[2][5][7],(void*)0,&g_143,&l_1419,(void*)0},{&g_98,&g_631,&g_631,&g_98,&l_1263[1][0][5]}}}; int i, j, k; if ((255UL || ((safe_sub_func_uint32_t_u_u(((l_1397 |= (l_1394++)) , (l_1398 == (((safe_rshift_func_uint16_t_u_s((l_1404 == (void*)0), ((void*)0 == g_1406))) ^ (safe_sub_func_int32_t_s_s((safe_add_func_int64_t_s_s((safe_div_func_int16_t_s_s((safe_mod_func_int32_t_s_s(l_1397, (safe_lshift_func_uint16_t_u_s((((safe_add_func_int16_t_s_s(((0xEFFFL == 65535UL) == l_1263[1][2][1]), l_1419)) & g_636.f7) , p_46), 9)))), l_1419)), l_1397)), l_1175))) , (void*)0))), 0x24253C17L)) | l_1419))) { /* block id: 600 */ return l_1419; } else { /* block id: 602 */ uint16_t ****l_1424 = &l_1423; (*p_47) = (safe_mul_func_uint16_t_u_u((l_1422 != ((*l_1424) = l_1423)), p_50)); } --l_1431; } for (g_1235.f4 = 0; (g_1235.f4 <= 8); g_1235.f4 += 1) { /* block id: 610 */ --g_1434; } } for (g_1090 = 15; (g_1090 < (-25)); --g_1090) { /* block id: 616 */ uint16_t l_1442 = 65535UL; int32_t l_1486[1][10] = {{4L,0x366ED366L,9L,9L,0x366ED366L,4L,0x366ED366L,9L,9L,0x366ED366L}}; uint16_t ****l_1496[7][6] = {{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422},{&l_1422,&l_1422,&l_1422,&l_1422,&l_1422,&l_1422}}; int i, j; for (g_238 = 21; (g_238 >= 47); g_238 = safe_add_func_int16_t_s_s(g_238, 4)) { /* block id: 619 */ int8_t l_1441 = (-1L); uint16_t l_1483 = 3UL; int32_t l_1491 = 0L; int32_t l_1492 = 4L; l_1442--; for (g_30 = 0; (g_30 != (-18)); --g_30) { /* block id: 623 */ uint32_t *l_1460 = &g_772.f7; int32_t l_1461 = (-1L); uint64_t *l_1470 = &g_93[2]; uint32_t *l_1482 = &g_1233.f7; int32_t l_1484[9] = {5L,5L,5L,5L,5L,5L,5L,5L,5L}; int32_t *l_1485 = &g_631; int32_t *l_1487 = &l_1486[0][7]; int32_t *l_1488 = &g_143; int32_t *l_1489[10] = {&g_98,&l_1430,&g_98,&l_1430,&g_98,&l_1430,&g_98,&l_1430,&g_98,&l_1430}; int i; for (g_1235.f3 = (-18); (g_1235.f3 > 39); ++g_1235.f3) { /* block id: 626 */ int16_t l_1451 = 0x04B6L; l_1451 ^= ((safe_lshift_func_uint8_t_u_u(0xA1L, ((*g_401) != (void*)0))) , 0x4099FF7CL); } if (l_1442) break; (*l_1485) ^= ((safe_mod_func_uint64_t_u_u((l_1263[1][4][3] = (safe_div_func_uint16_t_u_u((l_1484[4] &= (safe_div_func_uint32_t_u_u((safe_rshift_func_uint8_t_u_s(((((*l_1460) = p_46) & g_1207) != (((l_1461 , g_1462) != ((safe_div_func_int16_t_s_s(((safe_sub_func_uint64_t_u_u(((*l_1470) = ((*l_1193)++)), p_50)) ^ ((+(safe_add_func_uint16_t_u_u((**g_421), ((1L > ((safe_div_func_uint32_t_u_u((((((0xB2L <= ((safe_add_func_uint64_t_u_u((safe_mod_func_int32_t_s_s(((*p_48) ^= ((safe_lshift_func_int16_t_s_u(((((*l_1482) ^= ((l_1430 & g_28[2]) , p_50)) == p_46) , 0x2967L), l_1442)) && p_46)), g_1091)), p_46)) && 18446744073709551614UL)) , 0x533275E1L) , 0x0F72E2E6A2CDABB4LL) <= 0x5FFAB54328F17084LL) & 0xE5L), 4294967295UL)) , g_832.f6)) , 3UL)))) ^ p_50)), g_834.f3)) , (void*)0)) >= l_1483)), 2)), (*p_47)))), (-1L)))), p_46)) != l_1442); --g_1493; } if ((*p_48)) continue; } l_1497 = l_1422; } return g_169; } /* ------------------------------------------ */ /* * reads : g_202 g_143 g_1009 g_421 g_422 g_28 g_737 g_631 g_145 g_530 g_192 g_1055.f6 g_667.f4 g_219 g_1091 g_1098 g_98 * writes: g_766 g_849.f4 g_143 g_530 g_767 g_765 g_610 g_666 g_192 g_768 g_667.f4 g_219 g_1091 g_1098 g_631 g_98 */ static int32_t * const func_52(const int32_t * p_53, const uint32_t p_54, int64_t p_55) { /* block id: 401 */ uint32_t l_990 = 4294967295UL; int32_t l_991 = 2L; int8_t *l_1004 = &g_766; struct S0 ***l_1008 = &g_826; struct S0 ****l_1007 = &l_1008; struct S0 ****l_1010 = &l_1008; uint32_t l_1011 = 0x826B8FDEL; int16_t *l_1012 = &g_849.f4; uint16_t l_1013 = 2UL; int32_t l_1014 = 0xC989E92AL; const uint64_t *l_1041 = &g_93[2]; lbl_1023: l_991 ^= (safe_mul_func_uint8_t_u_u(((*g_202) && l_990), p_54)); if ((safe_mul_func_uint8_t_u_u((l_1014 = ((((safe_rshift_func_int16_t_s_u((safe_mod_func_uint16_t_u_u((((*l_1012) = (safe_sub_func_int16_t_s_s((l_991 = ((p_55 , (g_143 & ((l_991 || (safe_sub_func_int8_t_s_s(l_991, p_54))) , ((p_55 | (safe_lshift_func_int8_t_s_s(((*l_1004) = (-3L)), 6))) , (safe_add_func_uint64_t_u_u((l_1007 != (l_1010 = g_1009)), p_54)))))) > l_1011)), p_54))) , (**g_421)), l_1013)), 1)) , p_55) , l_1011) <= 3UL)), g_737[0]))) { /* block id: 408 */ uint32_t l_1020 = 1UL; uint64_t *l_1042 = &g_93[1]; for (l_990 = 29; (l_990 >= 20); l_990 = safe_sub_func_uint16_t_u_u(l_990, 6)) { /* block id: 411 */ int32_t *l_1017 = (void*)0; int32_t *l_1018 = (void*)0; int32_t *l_1019[7][7][3] = {{{&g_143,&g_143,(void*)0},{&g_631,(void*)0,&g_631},{&g_98,&g_143,&l_991},{(void*)0,&l_991,&g_143},{&g_98,&g_631,(void*)0},{&g_631,(void*)0,&g_143},{&g_143,&l_991,(void*)0}},{{&l_991,&l_991,&g_631},{&g_98,(void*)0,&l_991},{&g_143,&g_631,&g_98},{(void*)0,&l_991,&g_143},{(void*)0,&g_143,&g_98},{&g_143,(void*)0,&l_991},{&l_991,&g_143,&g_631}},{{&g_631,(void*)0,(void*)0},{&g_631,&g_631,&g_143},{&l_991,&l_991,(void*)0},{&g_143,&g_98,&g_143},{(void*)0,&g_143,&l_991},{(void*)0,&g_98,&g_631},{&g_143,&l_991,(void*)0}},{{&g_98,&g_631,&l_991},{&l_991,(void*)0,&l_991},{&g_143,&g_143,(void*)0},{&g_631,(void*)0,&g_631},{&g_98,&g_143,&l_991},{(void*)0,&l_991,&g_143},{&g_98,&g_631,(void*)0}},{{&g_631,(void*)0,&g_143},{&g_143,&l_991,(void*)0},{&l_991,&l_991,&g_631},{&g_98,(void*)0,&l_991},{&g_143,&g_631,&g_98},{(void*)0,&l_991,&g_143},{(void*)0,&g_143,&g_98}},{{&g_143,(void*)0,&l_991},{&l_991,&g_143,&g_631},{&g_631,(void*)0,(void*)0},{&g_631,&g_631,&g_143},{&l_991,&l_991,(void*)0},{&g_143,&g_98,&g_143},{(void*)0,&g_143,&l_991}},{{(void*)0,&g_98,&g_631},{&g_143,&l_991,(void*)0},{&g_98,&g_631,&l_991},{&l_991,(void*)0,&l_991},{&g_143,&g_143,(void*)0},{&g_631,(void*)0,&g_631},{&g_98,&g_143,&l_991}}}; int i, j, k; --l_1020; (*g_202) &= l_1020; if (l_991) goto lbl_1023; } (*g_202) = (+(((safe_unary_minus_func_int8_t_s((safe_div_func_uint8_t_u_u(((g_631 && (safe_mod_func_uint64_t_u_u(((6L || (((safe_lshift_func_uint16_t_u_u(l_991, (((1L != l_1020) >= (((((safe_add_func_int16_t_s_s((((+((safe_mod_func_uint8_t_u_u(l_990, p_55)) ^ (252UL >= (safe_mod_func_int32_t_s_s(((safe_div_func_uint8_t_u_u(g_145, 0xC2L)) >= (*g_202)), (*g_202)))))) | 0L) & (*g_422)), (**g_421))) , l_1041) == l_1042) , g_530) != p_55)) == g_631))) , l_990) < l_1020)) & 0xB11B6A573811B427LL), 0xAAF5C3BD6D009464LL))) | 0x28254C99L), l_1020)))) , p_54) , l_1020)); } else { /* block id: 417 */ uint64_t l_1051 = 0UL; int32_t l_1085 = 0x73BA85E8L; int32_t l_1096 = 0xCC9431F7L; int32_t l_1097 = 0xC8AFF589L; for (g_530 = 0; (g_530 > (-29)); --g_530) { /* block id: 420 */ struct S0 *l_1054 = &g_1055; int32_t l_1083 = 0x898E9968L; int32_t l_1088 = 0x14001145L; int32_t l_1095 = 0L; for (g_767 = 0; (g_767 != 7); ++g_767) { /* block id: 423 */ int32_t l_1078[6] = {6L,0xDFE2D3D7L,0xDFE2D3D7L,6L,0xDFE2D3D7L,0xDFE2D3D7L}; int i; for (g_765 = (-6); (g_765 >= (-21)); g_765 = safe_sub_func_uint64_t_u_u(g_765, 1)) { /* block id: 426 */ const uint64_t l_1057[2] = {0xFA738DDDF01AC2CELL,0xFA738DDDF01AC2CELL}; int32_t l_1094 = 0x93D9E08DL; int i; for (g_610 = (-13); (g_610 < 34); g_610++) { /* block id: 429 */ struct S0 **l_1056 = &g_666[0]; ++l_1051; if (l_1014) break; (*l_1056) = l_1054; if (l_1057[0]) break; } for (g_192 = 0; (g_192 <= 2); g_192 += 1) { /* block id: 437 */ uint32_t l_1067 = 4294967292UL; uint8_t *l_1068 = (void*)0; int32_t ****l_1071 = &g_980; (*g_202) = (-10L); if (l_1051) break; (*g_202) = ((~(safe_lshift_func_uint16_t_u_u(l_1011, (l_1051 , ((safe_mul_func_int8_t_s_s((safe_rshift_func_uint8_t_u_u((g_768 = (l_1014 = (safe_lshift_func_int16_t_s_s(l_1067, 2)))), 4)), (safe_sub_func_uint64_t_u_u(((void*)0 != l_1071), (0xF8D1L > 0L))))) , (safe_rshift_func_uint8_t_u_u(g_1055.f6, 2))))))) >= (safe_lshift_func_int8_t_s_s((((safe_rshift_func_int16_t_s_s(0x0CE0L, p_54)) , p_55) , l_1078[1]), l_1057[0]))); } for (g_667.f4 = 19; (g_667.f4 < (-23)); g_667.f4 = safe_sub_func_int32_t_s_s(g_667.f4, 7)) { /* block id: 446 */ l_1078[1] |= l_991; if ((*g_202)) continue; } for (g_219 = 27; (g_219 != 44); g_219++) { /* block id: 452 */ int32_t *l_1084 = (void*)0; int32_t *l_1086 = &l_1083; int32_t *l_1087[7] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; int i; --g_1091; g_1098++; return &g_98; } } } } } return &g_143; } /* ------------------------------------------ */ /* * reads : g_30 g_28 g_93 g_208 g_238 g_98 g_169 g_202 g_143 g_171 g_211 g_192 g_252 g_219 g_146 g_209 g_256 g_329 g_145 g_401 g_365 g_402 g_421 g_422 g_532 g_557 g_567 g_530 g_610 g_632 g_666 g_636.f4 g_696 g_662.f4 g_768 g_686.f7 g_802 g_667.f4 g_631 g_831 g_849.f7 g_766 g_767 g_662.f7 g_832.f7 g_765 g_662.f6 g_832.f6 g_849.f4 g_959 g_980 g_832.f4 * writes: g_30 g_143 g_98 g_256 g_169 g_192 g_219 g_208 g_329 g_171 g_365 g_202 g_401 g_209 g_252 g_467 g_145 g_211 g_28 g_532 g_238 g_557 g_567 g_610 g_632 g_666 g_696 g_768 g_686.f7 g_631 g_767 g_819 g_826 g_766 g_667.f7 g_146 g_834.f4 g_832.f4 g_686.f3 g_975 g_980 */ static const int32_t * func_56(const int32_t p_57, int8_t * p_58, int32_t * p_59, uint32_t p_60) { /* block id: 5 */ int8_t l_65 = 0xCAL; uint16_t l_91[9][9][3] = {{{0xC6B9L,65535UL,0x4032L},{0x1F08L,0x15A4L,0x275DL},{65528UL,1UL,4UL},{65531UL,5UL,65533UL},{0x1D01L,4UL,0x76E6L},{2UL,65535UL,65535UL},{0x5C85L,3UL,65535UL},{65535UL,0x5314L,1UL},{2UL,0x17EDL,0xD856L}},{{0UL,65531UL,8UL},{0UL,0x8118L,8UL},{65535UL,0x8684L,65529UL},{0xD856L,4UL,0x98DFL},{65531UL,0x44A2L,0UL},{0x1A91L,0x75EBL,65532UL},{0x3D52L,9UL,6UL},{65535UL,0x76E6L,65535UL},{0UL,1UL,1UL}},{{0x76E6L,65535UL,65531UL},{65526UL,0x300FL,0x300FL},{0x8118L,65532UL,0xF6CFL},{1UL,7UL,0x20FDL},{65535UL,65535UL,0xDD35L},{0UL,65535UL,65528UL},{65535UL,65535UL,65529UL},{0UL,7UL,2UL},{5UL,65532UL,65527UL}},{{0x6E54L,0x300FL,0x3D52L},{2UL,65535UL,0x0469L},{0xAE9EL,1UL,0x4032L},{0x2D30L,0x76E6L,65535UL},{65532UL,9UL,0x8EE6L},{6UL,0x75EBL,65535UL},{1UL,0x44A2L,0xE54BL},{0x44A2L,4UL,6UL},{0x11E6L,0x8684L,65535UL}},{{1UL,0x8118L,0x050DL},{65529UL,65531UL,65528UL},{9UL,0x17EDL,0x8118L},{8UL,0x5314L,65531UL},{0x1D01L,3UL,0x0E7FL},{0x1D01L,1UL,9UL},{8UL,8UL,0x93F7L},{9UL,65535UL,7UL},{65529UL,65531UL,0x1F08L}},{{1UL,0x8EE6L,0UL},{0x11E6L,0x7DA5L,65526UL},{0x44A2L,0UL,1UL},{1UL,0xC96EL,0UL},{6UL,0x1D01L,1UL},{65532UL,2UL,6UL},{0x2D30L,6UL,0x5314L},{0xAE9EL,0xD1E9L,0x1A91L},{2UL,1UL,0x4E1BL}},{{0x6E54L,0x6E54L,0xE582L},{5UL,0x0E7FL,4UL},{0UL,4UL,1UL},{65535UL,0xE582L,0x7DA5L},{0UL,0UL,1UL},{65535UL,8UL,4UL},{1UL,0x4E1BL,0xE582L},{0x8118L,65528UL,0x4E1BL},{65526UL,0x15A4L,0x1A91L}},{{0x76E6L,0UL,0x5314L},{0UL,0x93F7L,6UL},{65535UL,1UL,1UL},{0x3D52L,5UL,0UL},{0x1A91L,0x98DFL,1UL},{65531UL,2UL,65526UL},{0xD856L,0UL,65527UL},{0x0E7FL,0x1A91L,65529UL},{0x6FFCL,0x0469L,0x44A2L}},{{1UL,65535UL,1UL},{0x4032L,65535UL,0xC6B9L},{65535UL,0x17EDL,0x3D52L},{65526UL,0x17EDL,65535UL},{0xE54BL,65535UL,4UL},{0xF6CFL,65535UL,5UL},{1UL,0x0469L,1UL},{65535UL,0x1A91L,0x15A4L},{0x8118L,0x76E6L,65535UL}}}; uint64_t *l_92[3][9] = {{&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2],&g_93[2]}}; uint32_t l_94[3][9] = {{0UL,0x1C2D9EA4L,0UL,0x1D575427L,0x1D575427L,0UL,0x1C2D9EA4L,0UL,0x1D575427L},{0UL,0x1D575427L,0x1D575427L,0UL,0x1C2D9EA4L,0UL,0x1D575427L,0x1D575427L,0UL},{18446744073709551613UL,0x1D575427L,18446744073709551611UL,0x1D575427L,18446744073709551613UL,18446744073709551613UL,0x1D575427L,18446744073709551611UL,0x1D575427L}}; int32_t *l_97 = &g_98; uint16_t *l_115 = &g_28[3]; int32_t l_144 = 0L; int8_t l_166 = 0x9FL; int8_t l_177 = 0L; int32_t l_188 = (-9L); int32_t l_210 = 1L; const uint32_t l_221 = 0x2941B660L; uint64_t l_225 = 18446744073709551609UL; uint32_t l_352 = 0x978B2285L; uint32_t l_353 = 0x2F22A3EEL; int16_t *l_409[8][8][4] = {{{&g_169,(void*)0,&g_171,(void*)0},{&g_169,&g_169,&g_171,(void*)0},{&g_171,&g_171,&g_169,(void*)0},{&g_171,&g_169,&g_169,&g_169},{(void*)0,&g_169,(void*)0,&g_169},{&g_169,&g_171,&g_171,&g_171},{&g_169,&g_169,&g_169,&g_169},{&g_171,&g_169,&g_169,&g_171}},{{&g_171,&g_169,(void*)0,&g_169},{&g_169,&g_169,&g_171,&g_171},{&g_169,&g_169,(void*)0,&g_169},{&g_169,&g_169,&g_169,&g_171},{(void*)0,&g_171,&g_169,&g_169},{&g_169,&g_169,&g_169,&g_169},{&g_169,&g_169,&g_169,(void*)0},{&g_169,&g_171,&g_171,(void*)0}},{{&g_171,&g_169,&g_171,(void*)0},{&g_169,(void*)0,&g_169,&g_171},{&g_169,(void*)0,(void*)0,(void*)0},{&g_171,&g_171,(void*)0,&g_171},{&g_169,(void*)0,&g_169,&g_169},{&g_169,&g_169,&g_171,&g_171},{&g_171,&g_171,&g_171,(void*)0},{&g_169,&g_169,&g_169,&g_169}},{{&g_169,(void*)0,&g_169,&g_171},{&g_169,&g_169,&g_169,&g_169},{&g_171,(void*)0,(void*)0,&g_171},{&g_171,(void*)0,&g_169,(void*)0},{(void*)0,&g_171,&g_169,&g_169},{(void*)0,&g_169,&g_171,&g_169},{&g_169,&g_171,&g_171,(void*)0},{&g_171,(void*)0,&g_171,&g_171}},{{&g_169,(void*)0,&g_171,&g_169},{&g_171,&g_171,&g_171,&g_169},{&g_171,&g_169,&g_169,&g_171},{&g_171,(void*)0,&g_169,(void*)0},{&g_169,(void*)0,&g_169,(void*)0},{&g_171,&g_171,(void*)0,&g_169},{&g_169,&g_171,&g_169,&g_171},{&g_171,&g_171,(void*)0,(void*)0}},{{&g_171,&g_169,&g_169,&g_169},{&g_169,(void*)0,(void*)0,&g_169},{&g_171,&g_169,&g_169,&g_171},{&g_169,(void*)0,&g_169,&g_169},{&g_171,&g_169,&g_169,&g_171},{&g_171,&g_171,&g_171,&g_169},{&g_171,&g_169,&g_171,&g_171},{&g_169,&g_169,&g_171,&g_171}},{{&g_171,&g_169,&g_171,(void*)0},{&g_169,(void*)0,&g_171,&g_171},{(void*)0,(void*)0,&g_169,(void*)0},{(void*)0,&g_169,&g_169,&g_171},{&g_171,&g_169,(void*)0,&g_171},{&g_171,&g_169,(void*)0,&g_169},{&g_171,&g_171,&g_169,&g_171},{&g_171,&g_169,&g_171,&g_169}},{{&g_171,(void*)0,&g_169,&g_171},{&g_169,&g_169,&g_169,&g_169},{(void*)0,(void*)0,&g_169,&g_169},{&g_169,&g_169,(void*)0,(void*)0},{(void*)0,&g_171,(void*)0,&g_171},{&g_169,&g_171,&g_169,&g_169},{(void*)0,&g_171,&g_169,(void*)0},{&g_169,(void*)0,&g_169,(void*)0}}}; uint8_t *l_423[2]; int8_t *l_545 = &g_208; int8_t ** const l_544 = &l_545; uint16_t l_562 = 7UL; int32_t l_607 = 0xA829C4F0L; int32_t l_608 = (-9L); int32_t l_609 = (-1L); int64_t l_660 = 0L; int32_t l_669 = (-1L); const uint16_t l_692 = 0UL; int32_t l_694 = 0x1D15162CL; int16_t l_695 = 0L; int32_t l_731 = 0x9815DF20L; uint64_t l_736 = 18446744073709551615UL; int64_t l_764[9][3][8] = {{{1L,0x41DD9C14681D63BDLL,0x700DEA33C9281DF6LL,0x41DD9C14681D63BDLL,1L,1L,0x41DD9C14681D63BDLL,0x700DEA33C9281DF6LL},{1L,1L,0x41DD9C14681D63BDLL,0x700DEA33C9281DF6LL,0x41DD9C14681D63BDLL,1L,1L,0x41DD9C14681D63BDLL},{0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL}},{{0x41DD9C14681D63BDLL,(-9L),0x700DEA33C9281DF6LL,0x700DEA33C9281DF6LL,(-9L),0x41DD9C14681D63BDLL,(-9L),0x700DEA33C9281DF6LL},{0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL},{0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L)}},{{0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL},{0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL},{0x35A1F8AED01CF881LL,1L,(-9L),(-9L),1L,0x35A1F8AED01CF881LL,1L,(-9L)}},{{0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL},{0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L)},{0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL}},{{0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL},{0x35A1F8AED01CF881LL,1L,(-9L),(-9L),1L,0x35A1F8AED01CF881LL,1L,(-9L)},{0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL}},{{0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L)},{0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL},{0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL}},{{0x35A1F8AED01CF881LL,1L,(-9L),(-9L),1L,0x35A1F8AED01CF881LL,1L,(-9L)},{0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL},{0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L)}},{{0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL},{0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL},{0x35A1F8AED01CF881LL,1L,(-9L),(-9L),1L,0x35A1F8AED01CF881LL,1L,(-9L)}},{{0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL,0x35A1F8AED01CF881LL,0x35A1F8AED01CF881LL,0x700DEA33C9281DF6LL,1L,0x700DEA33C9281DF6LL},{0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L)},{0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL,(-9L),0x35A1F8AED01CF881LL,0x41DD9C14681D63BDLL,0x41DD9C14681D63BDLL,0x35A1F8AED01CF881LL}}}; int32_t **l_827 = &g_202; int32_t l_942 = 0x48ADC13CL; int32_t l_946 = (-2L); int32_t l_947 = 0xC1A98B06L; int32_t l_948 = 0xBCE3439DL; int32_t l_949[5][3][10] = {{{0x371C9822L,0L,0L,0x371C9822L,1L,0x371C9822L,0L,0L,0x371C9822L,1L},{0x371C9822L,0L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)}},{{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)}},{{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)}},{{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)}},{{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)},{0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L),0x9F11B92EL,0x371C9822L,0x371C9822L,0x9F11B92EL,(-1L)}}}; int32_t l_977 = (-1L); const int32_t *l_987 = (void*)0; int i, j, k; for (i = 0; i < 2; i++) l_423[i] = &g_219; if (((safe_add_func_uint32_t_u_u((((((l_65 != (l_65 , 0xACDD1F6657EEF10DLL)) >= (((((safe_lshift_func_int8_t_s_u(1L, ((1UL <= p_57) > ((safe_div_func_uint64_t_u_u((safe_rshift_func_int16_t_s_s(((l_94[0][7] = ((safe_div_func_uint64_t_u_u((safe_rshift_func_int8_t_s_s(((((safe_mod_func_uint32_t_u_u((((safe_mod_func_int8_t_s_s((safe_mul_func_int16_t_s_s((safe_sub_func_uint16_t_u_u((safe_mod_func_int32_t_s_s(((((safe_add_func_uint64_t_u_u(((safe_lshift_func_int8_t_s_u((~((0x3644CAD706983816LL & (l_65 , (&l_65 == &l_65))) , p_60)), g_30)) >= 0x0DL), l_65)) ^ p_60) == g_30) , l_65), 0x7B92BB77L)), g_28[0])), 0L)), 0xFAL)) == l_91[8][7][2]) & 1L), 0xEFFA9341L)) , 0UL) || g_28[1]) && l_91[8][7][2]), 0)), p_57)) , p_60)) , p_57), 4)), p_57)) != p_57)))) || 0UL) , (*p_58)) || l_91[8][7][2]) == 0xD3D1830FL)) , g_30) , l_91[8][7][2]) & 3UL), g_93[2])) , g_93[2])) { /* block id: 7 */ uint8_t l_180 = 255UL; int32_t l_191 = (-1L); int32_t l_236 = (-1L); uint32_t l_248[1][1]; int8_t l_254 = 0xBAL; int i, j; for (i = 0; i < 1; i++) { for (j = 0; j < 1; j++) l_248[i][j] = 0xFF32E4EAL; } for (g_30 = 0; (g_30 < (-16)); --g_30) { /* block id: 10 */ int32_t **l_99 = (void*)0; int32_t **l_100 = (void*)0; int32_t **l_101 = &l_97; uint16_t *l_110 = &l_91[8][7][2]; uint64_t *l_116 = (void*)0; int8_t *l_121[5][8] = {{&l_65,&g_30,&l_65,&l_65,&l_65,&g_30,&l_65,&l_65},{&g_30,&l_65,&l_65,&l_65,&l_65,&g_30,&g_30,&g_30},{&l_65,&g_30,&g_30,&g_30,&l_65,&l_65,&l_65,&l_65},{&g_30,&l_65,&l_65,&g_30,&l_65,&l_65,&l_65,&g_30},{&l_65,&l_65,&l_65,&l_65,&g_30,&g_30,&l_65,&l_65}}; uint32_t *l_122 = &l_94[0][7]; int32_t l_197 = 1L; int i, j; } return &g_143; } else { /* block id: 84 */ int64_t * const l_263 = &g_256; int32_t l_264[6][10] = {{2L,2L,(-4L),0x8741E03DL,2L,(-1L),0x8741E03DL,0x8741E03DL,(-1L),2L},{2L,0x2CEEA7DDL,(-4L),1L,(-1L),(-4L),0x2CEEA7DDL,(-1L),(-1L),0x2CEEA7DDL},{(-1L),1L,(-4L),(-4L),1L,(-1L),(-4L),0x2CEEA7DDL,(-1L),(-1L)},{1L,0x2CEEA7DDL,0x8741E03DL,1L,1L,0x8741E03DL,0x2CEEA7DDL,1L,2L,0x2CEEA7DDL},{1L,(-1L),(-4L),0x2CEEA7DDL,(-1L),(-1L),0x2CEEA7DDL,(-4L),(-1L),1L},{(-1L),0x2CEEA7DDL,(-4L),(-1L),1L,(-4L),(-4L),1L,(-1L),(-4L)}}; uint32_t *l_274 = &l_94[0][7]; int32_t *l_278 = &l_144; uint32_t l_313 = 18446744073709551614UL; uint64_t **l_357[1]; int i, j; for (i = 0; i < 1; i++) l_357[i] = &l_92[1][2]; (*g_202) |= ((safe_mod_func_uint32_t_u_u(4294967293UL, g_208)) , (g_238 ^ ((*l_97) , ((safe_add_func_int64_t_s_s(((0x4DE6C08DL ^ 0xC3DDF135L) == ((g_169 != (&g_252 != l_263)) & 0xE647D65CL)), l_264[0][5])) != l_264[4][0])))); for (g_98 = 0; (g_98 >= 21); g_98 = safe_add_func_uint32_t_u_u(g_98, 6)) { /* block id: 88 */ int32_t **l_277 = (void*)0; int16_t *l_281 = &g_169; (*g_202) = (((safe_div_func_int64_t_s_s((((*l_281) = ((~(safe_mul_func_uint8_t_u_u((safe_div_func_int8_t_s_s((*p_58), (-7L))), (l_274 != (void*)0)))) <= (safe_mod_func_uint32_t_u_u(((l_278 = &g_143) == (((*l_263) = (safe_sub_func_uint8_t_u_u(((void*)0 == &l_225), 255UL))) , &l_264[4][1])), 7UL)))) > 1UL), g_171)) > g_211) | p_57); } for (g_30 = 2; (g_30 >= 0); g_30 -= 1) { /* block id: 96 */ int32_t **l_282[1][8] = {{&l_97,&l_97,&l_97,&l_97,&l_97,&l_97,&l_97,&l_97}}; int32_t *l_283[8] = {&g_98,(void*)0,&g_98,&g_98,(void*)0,&g_98,&g_98,(void*)0}; volatile int8_t ****l_403 = &g_401; int i, j; l_283[2] = &g_143; for (g_192 = 0; (g_192 <= 2); g_192 += 1) { /* block id: 100 */ uint8_t *l_298 = &g_219; const int32_t * const l_392 = &g_98; int i, j; if ((((safe_div_func_uint8_t_u_u(((&l_278 == &l_97) , ((*l_298) ^= (((safe_mul_func_int16_t_s_s(l_94[g_30][(g_30 + 1)], (safe_add_func_uint8_t_u_u(((g_252 , &g_143) == ((safe_div_func_uint64_t_u_u((safe_div_func_uint64_t_u_u((safe_rshift_func_uint8_t_u_u((*l_97), g_98)), (safe_mul_func_int8_t_s_s(((((((((0x4F5BL == ((*l_278) == 4294967295UL)) != 0x5A82F8B99F19B798LL) == p_57) || g_211) != 18446744073709551615UL) & 0x340A2A62L) & 0xA846L) | 9L), 9L)))), g_171)) , (void*)0)), 0x27L)))) >= p_60) > 0x8EF077623B56AE92LL))), g_28[6])) ^ (-3L)) <= p_60)) { /* block id: 102 */ for (g_208 = 2; (g_208 >= 0); g_208 -= 1) { /* block id: 105 */ int8_t l_303 = 0x61L; uint8_t l_306 = 0xB3L; l_188 &= ((*l_97) = ((safe_sub_func_int16_t_s_s(((g_146 < (safe_add_func_int64_t_s_s((l_303 && (((safe_mod_func_int64_t_s_s(3L, 4L)) & g_146) >= (((l_306 == ((*l_278) = ((p_57 <= ((((safe_div_func_int16_t_s_s(p_57, (safe_mod_func_int8_t_s_s((safe_lshift_func_int8_t_s_u(l_94[g_30][(g_30 + 1)], g_209)), p_57)))) >= (-1L)) <= (*l_97)) , g_256)) & l_94[g_30][(g_30 + 1)]))) > p_60) || g_256))), 0xB42A023E6417FA21LL))) > (-1L)), 0x93D0L)) , (*g_202))); (*l_278) = l_313; if ((*g_202)) continue; } } else { /* block id: 112 */ int32_t l_327 = (-1L); uint8_t *l_328 = &g_329; if (((safe_add_func_int8_t_s_s((((safe_add_func_uint16_t_u_u((p_57 && p_57), ((((g_219 <= 1L) ^ p_57) , l_94[g_30][(g_30 + 1)]) >= ((((~((safe_sub_func_int32_t_s_s((((safe_add_func_uint16_t_u_u(((*l_97) < ((safe_sub_func_uint8_t_u_u((((p_57 != ((safe_sub_func_uint8_t_u_u(((*l_328)--), (0xB5A6B39912CEF29BLL > g_145))) < 0x1AL)) , (*l_97)) > (*g_202)), 251UL)) > g_146)), 0x32CBL)) <= (*p_58)) <= p_60), 0x1E4A7026L)) , (*p_58))) != (*p_58)) <= (*g_202)) >= (-1L))))) == p_57) != 65535UL), p_57)) <= g_145)) { /* block id: 114 */ return p_59; } else { /* block id: 116 */ int32_t *l_332[6][7] = {{&l_264[5][1],&l_264[5][1],&l_264[0][5],&l_264[0][5],&l_264[5][1],&l_264[5][1],&l_264[0][5]},{&l_264[0][5],&g_143,&l_264[0][5],&g_143,&l_264[0][5],&g_143,&l_264[0][5]},{&l_264[5][1],&l_264[0][5],&l_264[0][5],&l_264[5][1],&l_264[5][1],&l_264[0][5],&l_264[0][5]},{&l_210,&g_143,&l_210,&g_143,&l_210,&g_143,&l_210},{&l_264[5][1],&l_264[5][1],&l_264[0][5],&l_264[0][5],&l_264[5][1],&l_264[5][1],&l_264[0][5]},{&l_264[0][5],&g_143,&l_264[0][5],&g_143,&l_264[0][5],&g_143,&l_264[0][5]}}; int i, j; l_332[1][3] = p_59; return &g_143; } } for (g_329 = 0; (g_329 <= 2); g_329 += 1) { /* block id: 123 */ uint64_t **l_337 = &l_92[1][6]; int16_t *l_351 = &g_171; int32_t *l_366[3]; int8_t *l_381[4][4]; int8_t **l_380 = &l_381[1][1]; int32_t l_391 = 1L; const int32_t **l_393 = (void*)0; const int32_t **l_394 = (void*)0; const int32_t *l_396[6] = {&g_143,&g_98,&g_98,&g_143,&g_98,&g_98}; const int32_t **l_395 = &l_396[1]; int i, j; for (i = 0; i < 3; i++) l_366[i] = &g_143; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) l_381[i][j] = &g_30; } if ((((safe_add_func_int64_t_s_s((g_169 < ((((*l_337) = &g_93[2]) != (p_57 , &g_93[1])) > (safe_sub_func_uint64_t_u_u(p_57, ((safe_mod_func_int32_t_s_s(l_94[g_30][(g_30 + 1)], (((*l_263) = (safe_sub_func_int16_t_s_s(g_28[2], (safe_mul_func_int16_t_s_s(((safe_lshift_func_int16_t_s_u((safe_unary_minus_func_uint8_t_u((((safe_rshift_func_int16_t_s_s(((*l_351) = (&p_60 == (void*)0)), 15)) , (void*)0) == (void*)0))), g_252)) , 0xA449L), 0xC2ECL))))) | 0UL))) , l_352))))), l_353)) < p_57) & l_94[g_30][(g_30 + 1)])) { /* block id: 127 */ uint64_t **l_356 = &l_92[2][7]; int8_t l_362[3]; int8_t *l_363 = &l_362[2]; int32_t ***l_364[4][5][3] = {{{&l_282[0][7],&l_282[0][3],(void*)0},{&l_282[0][0],&l_282[0][0],&l_282[0][2]},{&l_282[0][6],&l_282[0][3],&l_282[0][3]},{&l_282[0][2],&l_282[0][7],&l_282[0][7]},{&l_282[0][6],&l_282[0][7],&l_282[0][6]}},{{&l_282[0][0],&l_282[0][2],&l_282[0][7]},{&l_282[0][7],&l_282[0][7],&l_282[0][3]},{&l_282[0][7],&l_282[0][2],&l_282[0][2]},{&l_282[0][3],&l_282[0][7],(void*)0},{&l_282[0][7],&l_282[0][7],&l_282[0][7]}},{{&l_282[0][7],&l_282[0][3],(void*)0},{&l_282[0][0],&l_282[0][0],&l_282[0][2]},{&l_282[0][6],&l_282[0][3],&l_282[0][3]},{&l_282[0][2],&l_282[0][7],&l_282[0][7]},{&l_282[0][6],&l_282[0][7],&l_282[0][6]}},{{&l_282[0][0],&l_282[0][2],&l_282[0][7]},{&l_282[0][7],&l_282[0][7],&l_282[0][3]},{&l_282[0][7],&l_282[0][2],&l_282[0][2]},{&l_282[0][3],&l_282[0][7],(void*)0},{&l_282[0][7],&l_282[0][7],&l_282[0][7]}}}; int i, j, k; for (i = 0; i < 3; i++) l_362[i] = (-1L); g_365 = (((safe_add_func_uint8_t_u_u((l_356 != l_357[0]), g_98)) > l_94[g_30][(g_30 + 1)]) , (((safe_add_func_uint8_t_u_u(g_329, ((*l_363) = ((safe_mul_func_int8_t_s_s(((l_94[g_30][(g_30 + 1)] | (((((*l_278) && (0xF9L & (((l_94[g_30][(g_30 + 1)] , 0x1E7F25D151C892F8LL) < (*l_278)) ^ (*g_202)))) <= 0UL) == p_57) <= (*l_278))) != l_362[0]), g_238)) , (*p_58))))) , l_362[2]) , (void*)0)); } else { /* block id: 130 */ p_59 = (g_202 = l_366[0]); } l_391 |= (safe_add_func_uint32_t_u_u(((safe_mul_func_int16_t_s_s(g_209, (g_238 && (safe_sub_func_uint8_t_u_u((((safe_mul_func_int8_t_s_s((safe_mul_func_uint8_t_u_u(((safe_lshift_func_uint8_t_u_u((!255UL), (((*l_380) = &l_166) != (void*)0))) , ((*l_298)--)), (safe_lshift_func_uint8_t_u_u(((safe_sub_func_int16_t_s_s((safe_sub_func_uint16_t_u_u(g_30, (*l_278))), (safe_unary_minus_func_uint8_t_u((p_57 ^ 0x98962812FE4CCA4BLL))))) < (*l_97)), 3)))), 0xAFL)) != g_93[1]) >= 255UL), (*p_58)))))) == p_57), 0xDC5AAB69L)); (*l_395) = l_392; } return &g_98; } (*g_202) &= ((safe_rshift_func_int8_t_s_s((((safe_mod_func_int64_t_s_s(g_28[2], (-1L))) , (*l_97)) > 0xDB418BB6L), 1)) != g_208); (*l_403) = g_401; for (g_209 = 0; (g_209 <= 2); g_209 += 1) { /* block id: 145 */ const int32_t *l_404 = (void*)0; return l_404; } } (*l_97) = (**g_365); } (*g_202) = (((safe_mul_func_int16_t_s_s((safe_rshift_func_uint8_t_u_u(p_60, 2)), ((*l_97) = p_57))) && ((*g_401) != (void*)0)) || ((safe_add_func_uint8_t_u_u(p_60, (g_219 &= (g_329 |= (((safe_mod_func_int32_t_s_s((safe_add_func_uint32_t_u_u((p_60 , (safe_sub_func_int32_t_s_s((~((safe_mod_func_int32_t_s_s((6L < ((void*)0 != g_421)), (**g_365))) & (-1L))), (*l_97)))), 0L)), (**g_365))) || (*l_97)) == (*l_97)))))) || (*l_97))); lbl_835: for (l_210 = (-18); (l_210 < (-21)); l_210--) { /* block id: 157 */ int32_t l_436 = 0x9A530B49L; uint64_t l_465 = 0x4317A58830908DB7LL; uint16_t l_478 = 0x8A39L; const uint64_t l_509 = 18446744073709551607UL; int32_t l_529 = 1L; int16_t l_531[5][6] = {{0x0585L,(-9L),(-9L),0x0585L,(-9L),(-9L)},{0x0585L,(-9L),(-9L),0x0585L,(-9L),(-9L)},{0x0585L,(-9L),(-9L),0x0585L,(-9L),(-9L)},{0x0585L,(-5L),(-5L),(-9L),(-5L),(-5L)},{(-9L),(-5L),(-5L),(-9L),(-5L),(-5L)}}; const uint8_t *l_577 = &g_578; uint16_t **l_595 = &l_115; uint16_t *l_596 = &l_478; int i, j; for (g_192 = 0; (g_192 <= 15); g_192 = safe_add_func_int16_t_s_s(g_192, 2)) { /* block id: 160 */ uint32_t l_437 = 0xCF06DC2BL; uint64_t *l_468 = (void*)0; int32_t l_477 = 0x1EAA6C85L; int8_t *l_508 = &l_177; int8_t **l_507 = &l_508; const uint16_t **l_527 = (void*)0; uint32_t *l_541 = &g_238; int32_t l_554[8][7] = {{(-2L),0xD0AD5761L,(-9L),(-9L),0xD0AD5761L,(-2L),0x1117D387L},{(-9L),(-9L),1L,0x1117D387L,0L,(-2L),(-2L)},{0x90F7460AL,0L,(-1L),0L,0x90F7460AL,(-1L),(-9L)},{1L,(-9L),(-2L),(-3L),0x90F7460AL,(-9L),0x90F7460AL},{5L,0xD0AD5761L,0xD0AD5761L,5L,0L,(-3L),1L},{1L,(-3L),0L,5L,0xD0AD5761L,0xD0AD5761L,5L},{0x90F7460AL,(-9L),0x90F7460AL,(-3L),(-2L),(-9L),1L},{(-9L),(-1L),0x90F7460AL,0L,(-1L),0L,0x90F7460AL}}; int i, j; for (g_208 = 8; (g_208 < 26); ++g_208) { /* block id: 163 */ if ((**g_365)) break; } for (g_209 = 0; (g_209 != (-17)); g_209 = safe_sub_func_int32_t_s_s(g_209, 1)) { /* block id: 168 */ int32_t *l_432 = &g_98; int32_t *l_433 = (void*)0; int32_t *l_434 = &l_144; int32_t *l_435[3][5][8] = {{{&l_188,&g_143,&l_188,&g_143,&l_188,&l_188,&g_98,&g_98},{&g_98,&g_143,&l_210,&l_210,&g_143,&g_98,&l_144,&g_143},{&g_98,&l_144,&l_210,&g_98,&l_210,&l_144,&g_98,&g_98},{&g_143,&l_188,&l_188,&g_98,&g_98,&l_188,&l_188,&g_143},{&g_98,&g_98,&l_144,&l_210,&g_98,&l_210,&l_144,&g_98}},{{&g_143,&l_144,&g_98,&g_143,&l_210,&l_210,&g_143,&g_98},{&g_98,&g_98,&l_188,&l_188,&g_143,&l_188,&g_143,&l_188},{&g_98,&l_188,&g_98,&l_210,&l_188,&l_144,&l_144,&l_188},{&l_188,&l_144,&l_144,&l_188,&l_210,&g_98,&l_188,&g_98},{&l_188,&g_143,&l_188,&g_143,&l_188,&l_188,&g_98,&g_98}},{{&g_98,&g_143,&l_210,&l_210,&g_143,&g_98,&l_144,&g_143},{&g_98,&l_144,&l_210,&g_98,&l_210,&l_144,&g_98,&g_98},{&g_143,&l_188,&l_188,&g_98,&g_98,&l_188,&l_188,&g_143},{&g_98,&g_98,&l_144,&l_210,&g_98,&l_210,&l_144,&g_98},{&g_143,&l_144,&g_98,&g_143,&l_210,&l_210,&g_143,&g_98}}}; int8_t *l_450 = &l_65; int8_t **l_451 = &l_450; uint16_t l_456 = 1UL; int64_t *l_457 = &g_256; int64_t *l_464 = &g_252; uint64_t **l_466[9][4][7] = {{{(void*)0,(void*)0,&l_92[0][0],&l_92[1][8],&l_92[1][2],(void*)0,&l_92[1][2]},{&l_92[2][1],(void*)0,&l_92[2][5],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[0][0]},{(void*)0,&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2]},{&l_92[0][0],&l_92[0][0],&l_92[1][2],&l_92[0][3],&l_92[2][1],&l_92[0][0],&l_92[2][7]}},{{&l_92[1][1],&l_92[1][2],&l_92[1][6],(void*)0,&l_92[1][2],(void*)0,&l_92[1][2]},{&l_92[1][2],&l_92[0][5],(void*)0,(void*)0,&l_92[2][1],(void*)0,(void*)0},{&l_92[1][3],&l_92[1][2],&l_92[1][8],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][1]},{&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][2]}},{{&l_92[1][6],&l_92[0][6],(void*)0,&l_92[0][7],&l_92[1][2],&l_92[1][7],(void*)0},{&l_92[0][5],&l_92[0][0],&l_92[0][8],&l_92[0][5],&l_92[0][3],(void*)0,&l_92[1][2]},{(void*)0,&l_92[0][0],(void*)0,&l_92[1][3],&l_92[0][7],(void*)0,&l_92[1][2]},{&l_92[2][5],&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[0][0],&l_92[0][1],&l_92[0][1]}},{{&l_92[1][2],(void*)0,&l_92[1][8],(void*)0,&l_92[1][2],&l_92[1][2],&l_92[1][2]},{&l_92[2][7],(void*)0,(void*)0,&l_92[1][2],(void*)0,&l_92[1][2],&l_92[1][2]},{(void*)0,&l_92[1][2],&l_92[1][6],&l_92[0][7],&l_92[1][2],&l_92[1][2],(void*)0},{&l_92[2][7],&l_92[1][2],&l_92[1][2],&l_92[0][5],&l_92[1][2],&l_92[2][1],(void*)0}},{{&l_92[1][2],&l_92[1][6],&l_92[1][2],&l_92[1][2],&l_92[0][0],&l_92[0][0],&l_92[1][2]},{&l_92[2][5],(void*)0,&l_92[2][5],&l_92[0][1],(void*)0,&l_92[1][2],&l_92[0][3]},{(void*)0,(void*)0,&l_92[1][2],&l_92[1][2],&l_92[1][2],&l_92[1][3],(void*)0},{&l_92[0][5],&l_92[1][2],&l_92[0][3],(void*)0,&l_92[1][2],&l_92[1][2],&l_92[0][0]}},{{&l_92[1][6],&l_92[1][2],(void*)0,&l_92[1][6],&l_92[1][3],&l_92[0][0],&l_92[1][2]},{&l_92[1][2],&l_92[2][1],&l_92[2][1],&l_92[0][3],&l_92[0][3],&l_92[2][1],&l_92[2][1]},{&l_92[1][3],&l_92[1][2],&l_92[1][7],&l_92[0][6],(void*)0,&l_92[1][2],&l_92[1][2]},{&l_92[1][2],&l_92[1][2],&l_92[2][5],(void*)0,&l_92[2][1],&l_92[1][2],&l_92[1][2]}},{{&l_92[1][1],&l_92[1][2],(void*)0,&l_92[0][6],&l_92[1][2],&l_92[1][2],(void*)0},{&l_92[0][0],&l_92[1][2],&l_92[1][2],&l_92[0][3],(void*)0,&l_92[0][1],&l_92[2][7]},{(void*)0,&l_92[0][6],&l_92[1][6],&l_92[1][6],&l_92[0][6],(void*)0,&l_92[0][7]},{&l_92[2][1],&l_92[0][5],&l_92[1][2],(void*)0,&l_92[2][1],&l_92[2][1],(void*)0}},{{&l_92[1][2],&l_92[0][4],&l_92[1][2],&l_92[1][2],&l_92[0][8],(void*)0,&l_92[0][7]},{(void*)0,&l_92[1][2],&l_92[2][1],&l_92[1][2],&l_92[0][3],&l_92[0][8],(void*)0},{(void*)0,&l_92[1][6],&l_92[1][3],&l_92[0][0],&l_92[1][2],&l_92[1][1],&l_92[1][2]},{&l_92[1][2],&l_92[0][0],&l_92[0][0],&l_92[1][2],(void*)0,&l_92[0][0],(void*)0}},{{&l_92[1][5],&l_92[1][7],&l_92[1][8],&l_92[1][2],&l_92[1][2],&l_92[1][8],&l_92[1][2]},{&l_92[1][2],&l_92[1][7],&l_92[2][7],&l_92[1][2],&l_92[0][1],&l_92[1][2],(void*)0},{(void*)0,&l_92[1][5],&l_92[1][2],(void*)0,(void*)0,&l_92[1][3],&l_92[1][2]},{&l_92[2][6],&l_92[1][2],(void*)0,&l_92[1][2],(void*)0,&l_92[1][2],(void*)0}}}; int i, j, k; l_437++; (**g_365) = (((l_468 = (g_467[5][0] = (((!(safe_sub_func_uint32_t_u_u(g_28[1], ((*l_97) = ((safe_unary_minus_func_int64_t_s((((safe_lshift_func_int16_t_s_u((safe_mul_func_int16_t_s_s(g_145, ((((((safe_sub_func_int16_t_s_s(((((*l_451) = l_450) != ((p_57 , 0L) , p_58)) || 0x1C4BL), (safe_rshift_func_uint8_t_u_s((safe_mod_func_int64_t_s_s(((*l_457) = l_456), ((*l_464) = ((safe_sub_func_uint8_t_u_u((safe_mul_func_int16_t_s_s((safe_rshift_func_uint16_t_u_s((l_437 != (*g_202)), p_60)), l_437)), l_437)) ^ 0xE1L)))), l_437)))) != l_465) | p_60) || (*l_97)) == 0xECFDBE57431F6FE2LL) >= (*l_97)))), l_437)) & 0x0533493CBFDBCE61LL) >= l_437))) & g_143))))) == 0UL) , (void*)0))) != &g_93[1]) == (-8L)); if ((safe_add_func_uint32_t_u_u((safe_mul_func_uint8_t_u_u((safe_add_func_uint32_t_u_u((((((g_329 = ((g_169 > 0x3485L) , (l_477 |= (p_57 == (safe_lshift_func_uint8_t_u_s(g_143, g_145)))))) == ((g_219 |= l_478) < p_57)) && (!((l_478 >= (safe_mul_func_int16_t_s_s(0xC973L, p_60))) & g_143))) >= (*l_97)) || p_60), (*l_97))), l_437)), (*l_97)))) { /* block id: 180 */ for (g_145 = 13; (g_145 > 20); g_145 = safe_add_func_uint16_t_u_u(g_145, 4)) { /* block id: 183 */ (*l_432) &= 0x487E2AEAL; } if (l_477) break; if ((*l_97)) break; } else { /* block id: 188 */ uint32_t *l_488[7] = {&g_192,&g_192,&g_145,&g_192,&g_192,&g_145,&g_192}; int8_t ***l_506[5][2][10] = {{{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451},{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451}},{{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451},{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451}},{{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451},{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451}},{{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451},{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451}},{{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451},{&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451,&l_451}}}; int32_t l_510[6]; uint16_t **l_528 = &l_115; int i, j, k; for (i = 0; i < 6; i++) l_510[i] = 1L; if ((safe_mod_func_uint64_t_u_u((safe_div_func_int64_t_s_s(((((0x6200000DF9B1FE86LL & ((l_436 ^= ((g_211--) >= (g_145--))) , (safe_mul_func_uint16_t_u_u(((~(safe_mod_func_int64_t_s_s((safe_lshift_func_uint8_t_u_s((safe_sub_func_uint8_t_u_u(254UL, (safe_rshift_func_int16_t_s_s((((safe_mul_func_int8_t_s_s(((((l_507 = &p_58) != (void*)0) , 65527UL) == (((4294967295UL < 1L) & (5L < ((**g_421) = ((*g_202) < l_509)))) < p_57)), 0x0AL)) , 0xF13ABF14L) | (**g_365)), g_145)))), 6)), l_436))) , 0xD29CL), 0x4EE3L)))) == (*l_434)) , 0x34EAB1FBL) && l_510[5]), 0x0AEE66FE87BB707FLL)), 0x06CCE8B42C1FF58ALL))) { /* block id: 194 */ (*l_97) = 1L; } else { /* block id: 196 */ int32_t l_511 = 0L; uint16_t **l_518 = (void*)0; const uint16_t *l_526 = &l_478; const uint16_t **l_525 = &l_526; (*l_434) |= l_511; (**g_365) = ((safe_mul_func_int8_t_s_s((g_211 | (*l_97)), 0x01L)) , ((safe_lshift_func_uint16_t_u_u(((l_477 = ((safe_add_func_uint64_t_u_u((l_518 != (void*)0), (((*p_58) == (safe_rshift_func_uint8_t_u_u(p_57, 1))) >= (safe_mul_func_uint16_t_u_u(0x0DDAL, ((((((*g_422)++) <= ((l_527 = l_525) != l_528)) , p_60) || (-5L)) ^ p_60)))))) & (*l_97))) >= 255UL), p_57)) != p_60)); g_532++; } } } if ((p_57 , (safe_mul_func_int16_t_s_s((((*l_97) = (safe_rshift_func_uint8_t_u_s(g_532, 4))) || (safe_div_func_uint64_t_u_u((((*l_541) = ((p_57 || (&l_436 != &g_143)) | l_478)) | ((*l_97) |= (safe_sub_func_uint32_t_u_u(((g_30 = g_256) , ((void*)0 != l_544)), g_192)))), l_477))), (**g_421))))) { /* block id: 210 */ return p_59; } else { /* block id: 212 */ uint64_t l_551 = 0x11636982659E2B84LL; int32_t l_555 = 0x8AD3A0B1L; int32_t l_565 = 0L; int32_t l_566 = (-9L); for (g_532 = 5; (g_532 <= 25); g_532++) { /* block id: 215 */ int32_t l_556 = 0xB21E9B14L; int32_t l_560 = (-1L); int32_t *l_561[1]; int i; for (i = 0; i < 1; i++) l_561[i] = &l_144; if (((*g_202) ^= (safe_rshift_func_uint8_t_u_s(((!(*l_97)) <= ((l_551 , &g_93[2]) == (void*)0)), 5)))) { /* block id: 217 */ (*l_97) = (*g_202); } else { /* block id: 219 */ int32_t *l_552 = (void*)0; int32_t *l_553[7]; int i; for (i = 0; i < 7; i++) l_553[i] = &l_436; --g_557[1]; } l_562--; g_567++; } (*l_97) = (((**g_365) = (l_531[0][1] >= (p_57 ^ ((safe_div_func_uint16_t_u_u((((g_219 != 0xA7A9E23ADA1F746BLL) & (safe_sub_func_int32_t_s_s(l_531[1][0], (-1L)))) > (((((void*)0 != &p_59) , (g_192 , 0xCB4DB1A413F0ADC2LL)) & l_554[1][5]) > 255UL)), (*g_422))) < (*g_202))))) , 0xA64F29F0L); } } if ((((*l_545) ^= (+(safe_add_func_int32_t_s_s(((l_423[1] != (l_577 = &g_219)) <= (**g_421)), (((safe_add_func_int8_t_s_s(g_169, g_146)) >= ((safe_lshift_func_uint16_t_u_s((safe_rshift_func_uint16_t_u_u(l_509, ((*l_596) ^= (safe_rshift_func_uint16_t_u_s((safe_lshift_func_uint16_t_u_u(((((l_436 = ((((*l_97) ^= ((((safe_lshift_func_uint8_t_u_u((safe_lshift_func_int16_t_s_u((p_57 > (((safe_div_func_int16_t_s_s((l_529 = (4294967295UL == (l_531[1][0] ^ (-2L)))), p_57)) , 0x0A85428DL) <= 0x1C9278EFL)), p_60)), 2)) != p_60) , l_595) == (void*)0)) >= g_28[2]) & l_465)) > p_60) > g_530) >= (-3L)), p_60)), 7))))), 7)) , p_57)) != g_567))))) & 1UL)) { /* block id: 235 */ uint64_t **l_601 = &g_467[6][0]; uint64_t **l_602 = &l_92[1][2]; if (p_60) break; (*g_202) = ((safe_div_func_int16_t_s_s(g_530, (*l_97))) == (safe_add_func_int8_t_s_s(((g_28[3] >= (((*l_601) = &g_557[4]) == ((*l_602) = &l_465))) ^ 0x282461E030EC4BF4LL), ((g_98 | ((void*)0 == &g_402[0][3])) , g_30)))); } else { /* block id: 240 */ int32_t *l_603 = (void*)0; int32_t l_604 = 1L; int32_t *l_605 = &l_436; int32_t *l_606[4][10][2] = {{{&l_144,&l_436},{&l_436,&l_210},{&l_436,&l_436},{&l_144,&l_144},{&l_436,(void*)0},{(void*)0,&l_144},{&l_210,&g_98},{&g_98,(void*)0},{&l_604,&g_143},{&g_98,(void*)0}},{{&l_188,&l_210},{(void*)0,&l_210},{&l_188,(void*)0},{&l_529,&l_210},{(void*)0,&g_98},{&l_436,&l_436},{&l_144,&l_210},{&l_210,(void*)0},{(void*)0,&g_143},{&l_210,(void*)0}},{{&l_188,&l_210},{&l_188,(void*)0},{&l_210,&g_143},{(void*)0,(void*)0},{&l_210,&l_210},{&l_144,&l_436},{&l_436,&g_98},{(void*)0,&l_210},{&l_529,&l_210},{&l_604,&g_98}},{{(void*)0,&g_98},{&l_604,&l_210},{&l_529,&l_210},{(void*)0,&g_98},{&l_436,&l_436},{&l_144,&l_210},{&l_210,(void*)0},{(void*)0,&g_143},{&l_210,(void*)0},{&l_188,&l_210}}}; int i, j, k; --g_610; } for (g_329 = 0; (g_329 <= 2); g_329 += 1) { /* block id: 245 */ int32_t *l_613 = &l_188; int32_t *l_614 = (void*)0; int32_t l_615 = (-2L); int32_t l_616[9][7][4] = {{{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL}},{{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL}},{{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL}},{{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL}},{{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL},{0x4FD58C5EL,0x4FD58C5EL,0x9B0E5F16L,0x4FD58C5EL},{0x4FD58C5EL,0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL},{0xB4AA508CL,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L}},{{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL}},{{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL}},{{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L}},{{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL},{0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L,0xB4AA508CL},{0x9B0E5F16L,0xB4AA508CL,0x9B0E5F16L,0x9B0E5F16L},{0xB4AA508CL,0xB4AA508CL,0x4FD58C5EL,0xB4AA508CL}}}; int32_t *l_617 = &l_188; int32_t *l_618 = &l_144; int32_t *l_619 = &g_98; int32_t *l_620 = &g_98; int32_t *l_621 = &l_616[0][0][1]; int32_t *l_622 = &g_143; int32_t *l_623 = (void*)0; int32_t *l_624 = &l_188; int32_t *l_625 = &l_188; int32_t *l_626 = &l_188; int32_t *l_627 = (void*)0; int32_t *l_628 = &l_188; int32_t *l_629 = &l_609; int32_t *l_630[2][8][2] = {{{&l_616[0][0][1],&l_144},{&l_144,&l_144},{&l_607,&l_144},{&l_144,&l_144},{&l_616[0][0][1],&l_607},{&l_607,&l_616[0][0][1]},{&l_607,&l_144},{&l_607,&l_616[0][0][1]}},{{&l_607,&l_607},{&l_616[0][0][1],&l_144},{&l_144,&l_144},{&l_607,&l_144},{&l_144,&l_144},{&l_616[0][0][1],&l_607},{&l_607,&l_616[0][0][1]},{&l_607,&l_144}}}; struct S0 *l_661 = &g_662[1][0]; int i, j, k; --g_632; for (l_353 = 0; (l_353 <= 2); l_353 += 1) { /* block id: 249 */ const struct S0 *l_635 = &g_636; const struct S0 **l_637 = &l_635; uint16_t l_659 = 0x0190L; (*l_637) = l_635; if (p_57) continue; if (((*l_625) = 2L)) { /* block id: 253 */ return p_59; } else { /* block id: 255 */ int32_t l_652 = 0x16B1E33CL; int64_t *l_663 = (void*)0; int64_t *l_664[7][2][7] = {{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{&l_660,&l_660,&l_660,&l_660,&l_660,&l_660,&l_660},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}}; int32_t **l_665 = &l_629; struct S0 **l_668 = &g_666[0]; int i, j, k; l_529 &= ((((((**g_365) >= (safe_sub_func_int16_t_s_s((safe_mod_func_int16_t_s_s((safe_mod_func_int64_t_s_s((g_93[2] , 0x41766392DA13B4F2LL), g_145)), ((safe_div_func_uint8_t_u_u(((g_252 = (((safe_add_func_int64_t_s_s(((((safe_lshift_func_int8_t_s_u((((((0xDE0123DBB0DF8719LL > 18446744073709551615UL) == (((g_238 = ((safe_add_func_int64_t_s_s((((l_652 != (safe_lshift_func_int8_t_s_s(((safe_lshift_func_int8_t_s_s((18446744073709551608UL & ((safe_lshift_func_int16_t_s_u(((((((*l_626) , 0xF7L) && g_93[2]) && (**g_421)) >= (*l_97)) , l_659), 2)) || p_57)), (*p_58))) == l_652), (*p_58)))) >= 0x70L) | 1UL), p_57)) < (**g_365))) != 4294967288UL) , (-5L))) , &l_92[1][2]) == &g_467[5][0]) , 1L), 2)) > l_660) , l_661) != (void*)0), p_57)) , 0x3F981E0AL) , (*l_621))) ^ 0x4C3EC5194E8390C8LL), 0x6BL)) , p_57))), (**g_421)))) && g_146) <= g_192) < l_659) , (-1L)); (*l_665) = &l_436; if ((*g_202)) break; (*l_624) = (((*l_668) = g_666[4]) != l_661); } } } } if (l_669) { /* block id: 267 */ int32_t l_680 = 0xECB4C70FL; struct S0 *l_685 = &g_686; struct S0 **l_687 = &l_685; struct S0 *l_688[3]; uint64_t l_691 = 18446744073709551609UL; int32_t *l_693[9][1] = {{(void*)0},{&l_669},{(void*)0},{&l_669},{(void*)0},{&l_669},{(void*)0},{&l_669},{(void*)0}}; int i, j; for (i = 0; i < 3; i++) l_688[i] = (void*)0; (*l_97) = (-6L); (*g_202) ^= (safe_sub_func_int8_t_s_s(((safe_mul_func_int8_t_s_s((safe_add_func_uint16_t_u_u((safe_mod_func_uint16_t_u_u((((*l_545) |= ((safe_lshift_func_int16_t_s_u(((&g_202 != &g_202) != l_680), 7)) , ((((safe_rshift_func_uint16_t_u_u(((g_219 = (safe_unary_minus_func_uint8_t_u(((*l_97) = ((safe_unary_minus_func_uint8_t_u(p_57)) > ((*g_422) < (((*l_687) = l_685) == l_688[2]))))))) | (safe_div_func_int8_t_s_s((*p_58), g_636.f4))), (*g_422))) == 0x335A42762CF80E62LL) & 0x9ECF2666L) < p_57))) == g_146), l_691)), l_691)), (*p_58))) | l_692), g_192)); --g_696; for (g_610 = 0; (g_610 <= 27); g_610 = safe_add_func_uint32_t_u_u(g_610, 3)) { /* block id: 277 */ uint64_t l_732[5][3] = {{7UL,0x5848D195A07949D9LL,7UL},{7UL,0x5848D195A07949D9LL,7UL},{7UL,0x5848D195A07949D9LL,7UL},{7UL,0x5848D195A07949D9LL,7UL},{7UL,0x5848D195A07949D9LL,7UL}}; uint32_t *l_735 = (void*)0; int32_t **l_742 = &g_202; int i, j; } } else { /* block id: 291 */ int8_t *l_744 = &l_65; const int32_t l_747[7] = {7L,7L,7L,7L,7L,7L,7L}; int32_t l_793 = 0x74DFB179L; int32_t l_794 = 0xF316F608L; struct S0 *l_833 = &g_834; uint32_t l_857 = 0UL; int64_t *l_864 = &l_764[8][0][2]; int32_t l_896[1]; int64_t l_945 = (-9L); int i; for (i = 0; i < 1; i++) l_896[i] = (-5L); for (l_144 = 0; (l_144 <= 2); l_144 += 1) { /* block id: 294 */ uint16_t **l_745 = &g_422; uint16_t **l_746[10] = {&g_422,&g_422,&g_422,&g_422,&g_422,&g_422,&g_422,&g_422,&g_422,&g_422}; int32_t *l_748 = &g_631; int32_t *l_749 = (void*)0; int32_t *l_750 = &l_607; int32_t *l_751 = (void*)0; int32_t *l_752 = &l_694; int32_t *l_753 = (void*)0; int32_t *l_754 = &g_98; int32_t *l_755 = &g_631; int32_t *l_756 = (void*)0; int32_t *l_757 = &g_631; int32_t *l_758 = &g_143; int32_t *l_759 = &l_669; int32_t *l_760 = &l_188; int32_t *l_761 = &l_608; int32_t *l_762 = &l_607; int32_t *l_763[7][6][5] = {{{&l_144,&l_607,&l_607,&l_144,&l_608},{(void*)0,&l_144,&l_608,&l_669,&l_669},{&l_608,&l_144,&l_608,&l_608,&l_144},{&l_669,&l_607,&l_608,&l_669,&l_608},{&l_669,&l_669,&l_608,&l_144,(void*)0},{&l_608,(void*)0,&l_608,&l_608,(void*)0}},{{(void*)0,&l_607,&l_608,(void*)0,&l_608},{&l_144,(void*)0,&l_608,(void*)0,&l_144},{&l_608,&l_669,&l_607,&l_608,&l_669},{&l_144,&l_607,&l_607,&l_144,&l_608},{(void*)0,&l_144,&l_608,&l_669,&l_669},{&l_608,&l_144,&l_608,&l_608,&l_144}},{{&l_669,&l_607,&l_608,&l_669,&l_608},{&l_669,&l_669,&l_608,&l_144,(void*)0},{&l_608,(void*)0,&l_608,&l_608,(void*)0},{(void*)0,&l_607,&l_608,(void*)0,&l_608},{&l_144,(void*)0,&l_608,(void*)0,&l_144},{&l_608,&l_669,&l_607,&l_608,&l_669}},{{&l_144,&l_607,&l_607,&l_144,&l_608},{&l_608,&l_607,&l_669,&l_608,&l_608},{&l_607,&l_607,&l_607,&g_98,&l_607},{&l_608,&l_608,&g_98,&l_608,&g_98},{&l_608,&l_608,&l_669,&l_607,&l_608},{&l_607,&l_608,&g_98,&g_98,&l_608}},{{&l_608,&l_608,&l_607,&l_608,&g_98},{&l_607,&l_608,&l_669,&l_608,&l_607},{&l_607,&l_608,&l_608,&g_98,&l_608},{&l_607,&l_608,&l_608,&l_607,&g_98},{&l_608,&l_607,&l_669,&l_608,&l_608},{&l_607,&l_607,&l_607,&g_98,&l_607}},{{&l_608,&l_608,&g_98,&l_608,&g_98},{&l_608,&l_608,&l_669,&l_607,&l_608},{&l_607,&l_608,&g_98,&g_98,&l_608},{&l_608,&l_608,&l_607,&l_608,&g_98},{&l_607,&l_608,&l_669,&l_608,&l_607},{&l_607,&l_608,&l_608,&g_98,&l_608}},{{&l_607,&l_608,&l_608,&l_607,&g_98},{&l_608,&l_607,&l_669,&l_608,&l_608},{&l_607,&l_607,&l_607,&g_98,&l_607},{&l_608,&l_608,&g_98,&l_608,&g_98},{&l_608,&l_608,&l_669,&l_607,&l_608},{&l_607,&l_608,&g_98,&g_98,&l_608}}}; struct S0 * const **l_807 = (void*)0; struct S0 **l_825 = (void*)0; struct S0 *l_848 = &g_849; int16_t l_931 = 4L; int32_t **l_960[10] = {(void*)0,(void*)0,&l_761,(void*)0,&l_761,(void*)0,(void*)0,&l_761,(void*)0,&l_761}; int i, j, k; (**g_365) = g_93[l_144]; (*l_97) = ((*g_202) = (((+(((((void*)0 == p_58) != (p_58 == ((*l_544) = l_744))) , l_745) == (l_746[0] = &g_422))) , ((g_93[l_144] , ((**g_421) == (((((g_567 = g_662[1][0].f4) ^ p_60) ^ l_747[1]) >= p_57) , g_143))) && 0x7EA474BFL)) != (*g_202))); g_768++; for (g_686.f7 = 0; (g_686.f7 <= 3); g_686.f7 += 1) { /* block id: 304 */ int8_t *l_795 = &g_766; int32_t l_797 = 0x7330F852L; int16_t l_798 = 0xAA5DL; const volatile int32_t *l_805 = &g_806; uint8_t l_830 = 0x75L; int32_t l_936[4]; int8_t l_954[6][4][2] = {{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}},{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}},{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}},{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}},{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}},{{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L},{0x25L,0x25L}}}; int32_t ** const *l_978 = &l_827; uint64_t **l_983 = &l_92[1][2]; uint32_t l_984 = 5UL; int i, j, k; for (i = 0; i < 4; i++) l_936[i] = (-5L); if ((l_94[l_144][(g_686.f7 + 2)] , (*g_202))) { /* block id: 305 */ struct S0 *l_771 = &g_772; struct S0 **l_773 = (void*)0; struct S0 **l_774 = &l_771; int32_t l_777[9][3][2] = {{{2L,0x28CD720BL},{0xDC5A334FL,0xDC5A334FL},{0xDC5A334FL,0x28CD720BL}},{{2L,0xF894E0E0L},{0x28CD720BL,0xF894E0E0L},{2L,0x28CD720BL}},{{0xDC5A334FL,0xDC5A334FL},{0xDC5A334FL,0x28CD720BL},{2L,0xDC5A334FL}},{{2L,0xDC5A334FL},{0x6BE35E7AL,2L},{0x28CD720BL,0x28CD720BL}},{{0x28CD720BL,2L},{0x6BE35E7AL,0xDC5A334FL},{2L,0xDC5A334FL}},{{0x6BE35E7AL,2L},{0x28CD720BL,0x28CD720BL},{0x28CD720BL,2L}},{{0x6BE35E7AL,0xDC5A334FL},{2L,0xDC5A334FL},{0x6BE35E7AL,2L}},{{0x28CD720BL,0x28CD720BL},{0x28CD720BL,2L},{0x6BE35E7AL,0xDC5A334FL}},{{2L,0xDC5A334FL},{0x6BE35E7AL,2L},{0x28CD720BL,0x28CD720BL}}}; int32_t l_780 = 0xD5B0D86EL; int i, j, k; (*l_774) = l_771; if ((*g_202)) continue; (*l_748) = ((**g_421) , ((*p_58) | (safe_rshift_func_int8_t_s_s(((*l_744) = (l_777[8][0][1] = (-8L))), ((p_57 ^ (safe_mod_func_int32_t_s_s(0x42D2B6BDL, l_780))) >= (((((safe_mul_func_uint16_t_u_u(((((safe_rshift_func_uint8_t_u_s((safe_mul_func_int16_t_s_s(((((*l_97) && ((*l_759) = p_57)) , (l_794 = ((!(((l_793 ^= (((safe_add_func_int64_t_s_s((safe_mul_func_int16_t_s_s((~p_60), p_57)), l_94[l_144][(g_686.f7 + 2)])) && g_662[1][0].f4) , (*g_422))) , &l_115) != (void*)0)) , p_57))) || 1L), (*l_97))), 3)) , 0xAC3EDC5DBA3FAD87LL) > g_28[2]) & 0x05745C2CF7CAA3C7LL), (*g_422))) ^ g_632) , g_238) , p_58) != l_795)))))); (*l_748) = ((*l_760) |= (**g_365)); } else { /* block id: 316 */ int64_t l_796 = 0xA2101925F5A3B9A3LL; int64_t *l_816 = &g_767; union U1 *l_882 = (void*)0; int32_t l_893 = 0L; int8_t ** const **l_897 = (void*)0; for (g_192 = 0; (g_192 <= 2); g_192 += 1) { /* block id: 319 */ uint32_t l_799 = 0x499B8F0FL; const volatile int32_t **l_804 = (void*)0; struct S0 * const ***l_808 = &l_807; ++l_799; l_805 = g_802; (*l_808) = l_807; return &g_143; } if ((safe_lshift_func_uint8_t_u_s((((**g_421)--) || ((*g_422) > ((g_667.f4 & (~((safe_lshift_func_int16_t_s_s((*l_757), 10)) , ((*l_816) = p_60)))) || 0xA1FBBF0F1AF05108LL))), (safe_mul_func_int16_t_s_s((-3L), ((g_819 = &g_422) != (void*)0)))))) { /* block id: 328 */ uint32_t l_823 = 0x534720BBL; struct S0 **l_824[5] = {&g_666[0],&g_666[0],&g_666[0],&g_666[0],&g_666[0]}; int32_t **l_829 = &l_97; int32_t ***l_828 = &l_829; int i; (*l_760) = (safe_mod_func_uint64_t_u_u(l_823, ((l_824[0] == (g_826 = l_825)) ^ (&g_402[0][3] == (void*)0)))); l_830 = ((*g_202) = ((l_827 = &g_202) != ((*l_828) = &p_59))); l_833 = g_831; if (g_567) goto lbl_835; } else { /* block id: 337 */ uint8_t **l_858 = &l_423[1]; uint32_t *l_859 = &g_211; uint32_t *l_860 = (void*)0; uint32_t *l_861 = &g_667.f7; int64_t *l_862[8]; int32_t l_863 = 0x990FE3A6L; int i, j; for (i = 0; i < 8; i++) l_862[i] = (void*)0; (*l_754) = ((((safe_lshift_func_uint8_t_u_s((((l_94[l_144][(g_686.f7 + 3)] ^= 0UL) , &l_660) != (((*l_760) ^= (safe_lshift_func_uint8_t_u_u(g_530, (safe_unary_minus_func_uint32_t_u((safe_rshift_func_uint16_t_u_u(((((safe_unary_minus_func_int64_t_s((l_863 = (safe_lshift_func_int8_t_s_u(((safe_mod_func_int32_t_s_s((l_848 != (((*l_545) = g_849.f7) , (void*)0)), ((safe_mod_func_int16_t_s_s(((safe_mod_func_int64_t_s_s(((((((((safe_sub_func_uint32_t_u_u(((*l_861) = ((*g_202) != (~((*l_816) ^= (((((*l_859) ^= (p_58 != ((*l_858) = (((*l_795) &= l_857) , (void*)0)))) < (*l_748)) || 0x54L) > p_57))))), 0xE89F5546L)) != 18446744073709551615UL) >= 0x7A8B4908072E4C4BLL) , p_60) | g_532) && g_30) | 9UL) == 0x68D32DAADFE0F1F0LL), 0x37F85AC19FFF364ALL)) & p_57), (*g_422))) & (**g_365)))) && g_662[1][0].f7), l_796))))) & 0x9BL) | g_832.f7) >= p_60), 9))))))) , l_864)), 5)) | (**l_827)) == 0x0717DBEDCBD72460LL) <= 0xD8L); } for (g_146 = 0; (g_146 <= 3); g_146 += 1) { /* block id: 351 */ int32_t l_881 = 2L; int i, j, k; (*l_754) |= (safe_lshift_func_uint16_t_u_u(((((((*g_401) != (void*)0) , (g_765 > (safe_rshift_func_uint8_t_u_u(7UL, 0)))) > ((safe_mod_func_int32_t_s_s((((((*l_744) = (safe_lshift_func_uint8_t_u_s((g_567 = (++g_768)), (*p_58)))) < (safe_mul_func_uint16_t_u_u(((((*l_750) == ((safe_add_func_int64_t_s_s((p_60 < (&g_192 == ((safe_rshift_func_int8_t_s_s(((*l_795) &= (((l_794 & p_60) , (**g_365)) || 0x07CF2D6DL)), (*p_58))) , &g_192))), p_60)) , l_796)) , (**l_827)) < 1L), 1L))) , 0x89CBL) < (**g_421)), 0x9E31FE0BL)) == p_57)) & g_832.f7) <= l_881), p_60)); if (l_881) continue; } if ((*g_202)) { /* block id: 359 */ union U1 **l_883 = &l_882; (*l_97) = ((*l_758) |= p_57); (*l_883) = l_882; return &g_98; } else { /* block id: 364 */ int16_t l_892[6][7] = {{(-2L),0x2B14L,0L,(-2L),0x82EEL,0x82EEL,(-2L)},{1L,9L,1L,0L,9L,4L,4L},{1L,(-2L),0xA7E2L,(-2L),1L,0xA7E2L,7L},{0xA60AL,4L,0L,0xA60AL,0L,4L,0xA60AL},{0L,7L,0x2B14L,0x82EEL,7L,0x82EEL,0x2B14L},{0xA60AL,0xA60AL,0x4FF1L,9L,4L,0x4FF1L,4L}}; int i, j; if ((*l_761)) break; l_893 = (((g_832.f4 = (g_219 , ((safe_div_func_int64_t_s_s((0x306BL > l_94[l_144][(g_686.f7 + 2)]), 0x596D2A9B46AEACE8LL)) & (g_834.f4 = ((g_567 <= (safe_div_func_int16_t_s_s(l_797, (safe_mul_func_uint8_t_u_u((p_59 == (void*)0), ((safe_div_func_int16_t_s_s(p_60, g_766)) <= 0L)))))) && l_747[1]))))) > l_892[1][4]) || (*p_58)); if ((**g_365)) continue; (*l_752) = (((safe_rshift_func_uint16_t_u_u(((*l_115) &= ((l_896[0] , (void*)0) != l_897)), 2)) ^ l_796) > ((((safe_div_func_uint64_t_u_u(((safe_lshift_func_int8_t_s_u(0x25L, l_830)) >= (safe_mod_func_int64_t_s_s(((~((**l_827) = p_57)) == ((safe_lshift_func_uint8_t_u_s(7UL, ((*l_744) = ((*l_795) = (safe_mul_func_int16_t_s_s(((safe_lshift_func_int8_t_s_s(l_798, 0)) && 0x4FA1L), l_892[1][4])))))) == l_798)), g_662[1][0].f6))), l_793)) != l_94[l_144][(g_686.f7 + 2)]) , &g_202) == (void*)0)); } } for (g_686.f3 = 0; (g_686.f3 >= 44); g_686.f3 = safe_add_func_int32_t_s_s(g_686.f3, 3)) { /* block id: 379 */ int32_t l_932 = 3L; int32_t l_933 = (-1L); int32_t l_934 = (-1L); int32_t l_935 = (-1L); int32_t l_937 = 0xC29953B9L; int32_t l_938 = (-1L); int32_t l_939 = 0xFA61FDC0L; int32_t l_940 = 0xCA404A3FL; int32_t l_941 = 0x16E3EFA7L; int32_t l_943 = (-1L); int32_t l_944[7][10] = {{0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL,0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L)},{0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL,0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL},{0x7A9579F1L,(-2L),0L,(-2L),0x7A9579F1L,0x80FC431DL,0x7A9579F1L,(-2L),0L,(-2L)},{0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL,0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L)},{0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL,0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL},{0x7A9579F1L,(-2L),0L,(-2L),0x7A9579F1L,0x80FC431DL,0x7A9579F1L,(-2L),0L,(-2L)},{0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L),0x80A16E2EL,0x623F58FDL,0x7A9579F1L,0x623F58FDL,0x80A16E2EL,(-2L)}}; uint32_t l_950 = 0xC5037916L; int64_t *l_953 = &g_252; int32_t ** const **l_979 = &l_978; int32_t ****l_982 = &g_980; int8_t **l_986 = &l_795; int8_t ***l_985 = &l_986; int i, j; for (l_352 = (-4); (l_352 > 59); ++l_352) { /* block id: 382 */ uint16_t * const l_919 = &g_28[7]; int32_t l_930[7]; uint32_t *l_956[7][9][3] = {{{&g_610,&l_94[1][3],(void*)0},{&g_199,&l_94[2][1],&g_610},{&g_199,(void*)0,&g_199},{&g_610,&l_94[2][1],&g_199},{(void*)0,&l_94[1][3],&g_610},{&l_94[0][7],&l_352,&g_199},{&g_199,&g_199,&g_610},{&l_94[0][7],&g_610,&l_352},{(void*)0,&g_610,&l_353}},{{&g_610,&l_94[0][7],&l_94[0][7]},{&g_199,(void*)0,&l_353},{&g_199,&g_610,&l_352},{&g_610,&g_610,&g_199},{&l_94[2][1],&g_199,&l_94[2][1]},{&g_199,&g_610,&g_199},{(void*)0,&l_94[0][7],&g_199},{&g_610,(void*)0,(void*)0},{(void*)0,(void*)0,&l_94[0][7]}},{{&g_610,&g_199,(void*)0},{(void*)0,&l_94[0][7],&g_199},{&g_199,(void*)0,(void*)0},{&l_94[2][1],(void*)0,&g_199},{&g_199,&l_353,(void*)0},{&g_199,&g_610,&l_94[0][7]},{(void*)0,&g_610,(void*)0},{&l_94[0][7],&g_610,&g_199},{(void*)0,&l_353,&g_199}},{{&g_199,(void*)0,&l_94[2][1]},{(void*)0,(void*)0,&g_199},{&g_199,&l_94[0][7],(void*)0},{(void*)0,&g_199,&g_610},{&l_94[0][7],(void*)0,(void*)0},{(void*)0,(void*)0,&g_610},{&g_199,&l_94[0][7],(void*)0},{&g_199,&g_610,&g_199},{&l_94[2][1],&g_199,&l_94[2][1]}},{{&g_199,&g_610,&g_199},{(void*)0,&l_94[0][7],&g_199},{&g_610,(void*)0,(void*)0},{(void*)0,(void*)0,&l_94[0][7]},{&g_610,&g_199,(void*)0},{(void*)0,&l_94[0][7],&g_199},{&g_199,(void*)0,(void*)0},{&l_94[2][1],(void*)0,&g_199},{&g_199,&l_353,(void*)0}},{{&g_199,&g_610,&l_94[0][7]},{(void*)0,&g_610,(void*)0},{&l_94[0][7],&g_610,&g_199},{(void*)0,&l_353,&g_199},{&g_199,(void*)0,&l_94[2][1]},{(void*)0,(void*)0,&g_199},{&g_199,&l_94[0][7],(void*)0},{(void*)0,&g_199,&g_610},{&l_94[0][7],(void*)0,(void*)0}},{{(void*)0,(void*)0,&g_610},{&g_199,&l_94[0][7],(void*)0},{&g_199,&g_610,&g_199},{&l_94[2][1],&g_199,&l_94[2][1]},{&g_199,&g_610,&g_199},{(void*)0,&l_94[0][7],&g_199},{&g_610,(void*)0,(void*)0},{(void*)0,(void*)0,&l_94[0][7]},{&g_610,&g_199,(void*)0}}}; uint32_t **l_955 = &l_956[4][3][2]; int i, j, k; for (i = 0; i < 7; i++) l_930[i] = (-1L); (*l_761) ^= ((*l_762) = (safe_rshift_func_int16_t_s_u(((((((safe_div_func_int8_t_s_s(((*l_97) || 0x959FL), 7UL)) , l_919) != (void*)0) < l_857) != 0xA0EFBEF0B5FBEC16LL) , (((safe_lshift_func_int8_t_s_s((safe_mul_func_uint8_t_u_u((safe_mod_func_uint16_t_u_u((((safe_add_func_uint16_t_u_u((((safe_sub_func_uint64_t_u_u((l_950++), 18446744073709551613UL)) || (&g_767 != l_953)) < g_832.f6), (**g_421))) < (*p_58)) | (*p_58)), g_849.f4)), 0x92L)), 2)) >= l_954[3][0][0]) <= (*p_58))), 7))); (*l_760) = ((&g_199 != ((*l_955) = (void*)0)) , (safe_lshift_func_uint16_t_u_u(g_959, ((0x46L ^ (0xAE56L == p_60)) < ((l_960[1] == ((safe_add_func_uint64_t_u_u((((safe_mod_func_uint16_t_u_u(((safe_mod_func_int16_t_s_s((safe_mul_func_uint8_t_u_u(((0xB556E30C1B29F37BLL < (&p_60 != &l_94[l_144][(g_686.f7 + 2)])) < (*g_202)), 0xB5L)), p_57)) == 0xABL), 1UL)) != l_857) , (*l_97)), l_747[5])) , &p_59)) || l_930[3]))))); } (*l_752) ^= (((((safe_rshift_func_int16_t_s_s((((safe_sub_func_uint8_t_u_u((safe_rshift_func_int16_t_s_u(p_57, 10)), ((g_975 = &g_467[5][0]) == ((((*l_979) = (((l_896[0] = ((*l_864) = (+l_977))) > g_252) , l_978)) == (((void*)0 != &l_92[2][3]) , ((*l_982) = g_980))) , l_983)))) > (*p_58)) , l_984), 14)) < g_832.f4) | p_57) > p_57) , l_794); (**g_365) = (((***l_978) , &g_402[0][3]) != l_985); } } } } return l_987; } /* ---------------------------------------- */ int main (int argc, char* argv[]) { int i, j, k; int print_hash_value = 0; if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; platform_main_begin(); crc32_gentab(); func_1(); transparent_crc(g_7, "g_7", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_28[i], "g_28[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_30, "g_30", print_hash_value); for (i = 0; i < 3; i++) { transparent_crc(g_93[i], "g_93[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_98, "g_98", print_hash_value); transparent_crc(g_143, "g_143", print_hash_value); transparent_crc(g_145, "g_145", print_hash_value); transparent_crc(g_146, "g_146", print_hash_value); transparent_crc(g_169, "g_169", print_hash_value); transparent_crc(g_171, "g_171", print_hash_value); transparent_crc(g_192, "g_192", print_hash_value); transparent_crc(g_199, "g_199", print_hash_value); transparent_crc(g_208, "g_208", print_hash_value); transparent_crc(g_209, "g_209", print_hash_value); transparent_crc(g_211, "g_211", print_hash_value); transparent_crc(g_219, "g_219", print_hash_value); transparent_crc(g_238, "g_238", print_hash_value); transparent_crc(g_252, "g_252", print_hash_value); transparent_crc(g_256, "g_256", print_hash_value); transparent_crc(g_329, "g_329", print_hash_value); transparent_crc(g_530, "g_530", print_hash_value); transparent_crc(g_532, "g_532", print_hash_value); for (i = 0; i < 9; i++) { transparent_crc(g_557[i], "g_557[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_567, "g_567", print_hash_value); transparent_crc(g_578, "g_578", print_hash_value); transparent_crc(g_610, "g_610", print_hash_value); transparent_crc(g_631, "g_631", print_hash_value); transparent_crc(g_632, "g_632", print_hash_value); transparent_crc(g_636.f0, "g_636.f0", print_hash_value); transparent_crc(g_636.f1, "g_636.f1", print_hash_value); transparent_crc(g_636.f2, "g_636.f2", print_hash_value); transparent_crc(g_636.f3, "g_636.f3", print_hash_value); transparent_crc(g_636.f4, "g_636.f4", print_hash_value); transparent_crc(g_636.f5, "g_636.f5", print_hash_value); transparent_crc(g_636.f6, "g_636.f6", print_hash_value); transparent_crc(g_636.f7, "g_636.f7", print_hash_value); transparent_crc(g_636.f8, "g_636.f8", print_hash_value); for (i = 0; i < 5; i++) { for (j = 0; j < 10; j++) { transparent_crc(g_662[i][j].f0, "g_662[i][j].f0", print_hash_value); transparent_crc(g_662[i][j].f1, "g_662[i][j].f1", print_hash_value); transparent_crc(g_662[i][j].f2, "g_662[i][j].f2", print_hash_value); transparent_crc(g_662[i][j].f3, "g_662[i][j].f3", print_hash_value); transparent_crc(g_662[i][j].f4, "g_662[i][j].f4", print_hash_value); transparent_crc(g_662[i][j].f5, "g_662[i][j].f5", print_hash_value); transparent_crc(g_662[i][j].f6, "g_662[i][j].f6", print_hash_value); transparent_crc(g_662[i][j].f7, "g_662[i][j].f7", print_hash_value); transparent_crc(g_662[i][j].f8, "g_662[i][j].f8", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_667.f0, "g_667.f0", print_hash_value); transparent_crc(g_667.f1, "g_667.f1", print_hash_value); transparent_crc(g_667.f2, "g_667.f2", print_hash_value); transparent_crc(g_667.f3, "g_667.f3", print_hash_value); transparent_crc(g_667.f4, "g_667.f4", print_hash_value); transparent_crc(g_667.f5, "g_667.f5", print_hash_value); transparent_crc(g_667.f6, "g_667.f6", print_hash_value); transparent_crc(g_667.f7, "g_667.f7", print_hash_value); transparent_crc(g_667.f8, "g_667.f8", print_hash_value); transparent_crc(g_686.f0, "g_686.f0", print_hash_value); transparent_crc(g_686.f1, "g_686.f1", print_hash_value); transparent_crc(g_686.f2, "g_686.f2", print_hash_value); transparent_crc(g_686.f3, "g_686.f3", print_hash_value); transparent_crc(g_686.f4, "g_686.f4", print_hash_value); transparent_crc(g_686.f5, "g_686.f5", print_hash_value); transparent_crc(g_686.f6, "g_686.f6", print_hash_value); transparent_crc(g_686.f7, "g_686.f7", print_hash_value); transparent_crc(g_686.f8, "g_686.f8", print_hash_value); transparent_crc(g_696, "g_696", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_737[i], "g_737[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_765, "g_765", print_hash_value); transparent_crc(g_766, "g_766", print_hash_value); transparent_crc(g_767, "g_767", print_hash_value); transparent_crc(g_768, "g_768", print_hash_value); transparent_crc(g_772.f0, "g_772.f0", print_hash_value); transparent_crc(g_772.f1, "g_772.f1", print_hash_value); transparent_crc(g_772.f2, "g_772.f2", print_hash_value); transparent_crc(g_772.f3, "g_772.f3", print_hash_value); transparent_crc(g_772.f4, "g_772.f4", print_hash_value); transparent_crc(g_772.f5, "g_772.f5", print_hash_value); transparent_crc(g_772.f6, "g_772.f6", print_hash_value); transparent_crc(g_772.f7, "g_772.f7", print_hash_value); transparent_crc(g_772.f8, "g_772.f8", print_hash_value); transparent_crc(g_803, "g_803", print_hash_value); transparent_crc(g_806, "g_806", print_hash_value); transparent_crc(g_832.f0, "g_832.f0", print_hash_value); transparent_crc(g_832.f1, "g_832.f1", print_hash_value); transparent_crc(g_832.f2, "g_832.f2", print_hash_value); transparent_crc(g_832.f3, "g_832.f3", print_hash_value); transparent_crc(g_832.f4, "g_832.f4", print_hash_value); transparent_crc(g_832.f5, "g_832.f5", print_hash_value); transparent_crc(g_832.f6, "g_832.f6", print_hash_value); transparent_crc(g_832.f7, "g_832.f7", print_hash_value); transparent_crc(g_832.f8, "g_832.f8", print_hash_value); transparent_crc(g_834.f0, "g_834.f0", print_hash_value); transparent_crc(g_834.f1, "g_834.f1", print_hash_value); transparent_crc(g_834.f2, "g_834.f2", print_hash_value); transparent_crc(g_834.f3, "g_834.f3", print_hash_value); transparent_crc(g_834.f4, "g_834.f4", print_hash_value); transparent_crc(g_834.f5, "g_834.f5", print_hash_value); transparent_crc(g_834.f6, "g_834.f6", print_hash_value); transparent_crc(g_834.f7, "g_834.f7", print_hash_value); transparent_crc(g_834.f8, "g_834.f8", print_hash_value); transparent_crc(g_849.f0, "g_849.f0", print_hash_value); transparent_crc(g_849.f1, "g_849.f1", print_hash_value); transparent_crc(g_849.f2, "g_849.f2", print_hash_value); transparent_crc(g_849.f3, "g_849.f3", print_hash_value); transparent_crc(g_849.f4, "g_849.f4", print_hash_value); transparent_crc(g_849.f5, "g_849.f5", print_hash_value); transparent_crc(g_849.f6, "g_849.f6", print_hash_value); transparent_crc(g_849.f7, "g_849.f7", print_hash_value); transparent_crc(g_849.f8, "g_849.f8", print_hash_value); transparent_crc(g_959, "g_959", print_hash_value); transparent_crc(g_1055.f0, "g_1055.f0", print_hash_value); transparent_crc(g_1055.f1, "g_1055.f1", print_hash_value); transparent_crc(g_1055.f2, "g_1055.f2", print_hash_value); transparent_crc(g_1055.f3, "g_1055.f3", print_hash_value); transparent_crc(g_1055.f4, "g_1055.f4", print_hash_value); transparent_crc(g_1055.f5, "g_1055.f5", print_hash_value); transparent_crc(g_1055.f6, "g_1055.f6", print_hash_value); transparent_crc(g_1055.f7, "g_1055.f7", print_hash_value); transparent_crc(g_1055.f8, "g_1055.f8", print_hash_value); transparent_crc(g_1089, "g_1089", print_hash_value); transparent_crc(g_1090, "g_1090", print_hash_value); transparent_crc(g_1091, "g_1091", print_hash_value); transparent_crc(g_1098, "g_1098", print_hash_value); transparent_crc(g_1104.f0, "g_1104.f0", print_hash_value); transparent_crc(g_1105.f0, "g_1105.f0", print_hash_value); transparent_crc(g_1106.f0, "g_1106.f0", print_hash_value); transparent_crc(g_1107.f0, "g_1107.f0", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_1108[i].f0, "g_1108[i].f0", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_1109.f0, "g_1109.f0", print_hash_value); for (i = 0; i < 9; i++) { for (j = 0; j < 6; j++) { transparent_crc(g_1110[i][j].f0, "g_1110[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1207, "g_1207", print_hash_value); transparent_crc(g_1233.f0, "g_1233.f0", print_hash_value); transparent_crc(g_1233.f1, "g_1233.f1", print_hash_value); transparent_crc(g_1233.f2, "g_1233.f2", print_hash_value); transparent_crc(g_1233.f3, "g_1233.f3", print_hash_value); transparent_crc(g_1233.f4, "g_1233.f4", print_hash_value); transparent_crc(g_1233.f5, "g_1233.f5", print_hash_value); transparent_crc(g_1233.f6, "g_1233.f6", print_hash_value); transparent_crc(g_1233.f7, "g_1233.f7", print_hash_value); transparent_crc(g_1233.f8, "g_1233.f8", print_hash_value); transparent_crc(g_1235.f0, "g_1235.f0", print_hash_value); transparent_crc(g_1235.f1, "g_1235.f1", print_hash_value); transparent_crc(g_1235.f2, "g_1235.f2", print_hash_value); transparent_crc(g_1235.f3, "g_1235.f3", print_hash_value); transparent_crc(g_1235.f4, "g_1235.f4", print_hash_value); transparent_crc(g_1235.f5, "g_1235.f5", print_hash_value); transparent_crc(g_1235.f6, "g_1235.f6", print_hash_value); transparent_crc(g_1235.f7, "g_1235.f7", print_hash_value); transparent_crc(g_1235.f8, "g_1235.f8", print_hash_value); transparent_crc(g_1268, "g_1268", print_hash_value); transparent_crc(g_1326, "g_1326", print_hash_value); transparent_crc(g_1401.f0, "g_1401.f0", print_hash_value); transparent_crc(g_1401.f1, "g_1401.f1", print_hash_value); transparent_crc(g_1401.f2, "g_1401.f2", print_hash_value); transparent_crc(g_1401.f3, "g_1401.f3", print_hash_value); transparent_crc(g_1401.f4, "g_1401.f4", print_hash_value); transparent_crc(g_1401.f5, "g_1401.f5", print_hash_value); transparent_crc(g_1401.f6, "g_1401.f6", print_hash_value); transparent_crc(g_1401.f7, "g_1401.f7", print_hash_value); transparent_crc(g_1401.f8, "g_1401.f8", print_hash_value); transparent_crc(g_1434, "g_1434", print_hash_value); transparent_crc(g_1493, "g_1493", print_hash_value); transparent_crc(g_1541, "g_1541", print_hash_value); for (i = 0; i < 7; i++) { for (j = 0; j < 5; j++) { transparent_crc(g_1542[i][j], "g_1542[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_1543, "g_1543", print_hash_value); transparent_crc(g_1544, "g_1544", print_hash_value); transparent_crc(g_1545, "g_1545", print_hash_value); transparent_crc(g_1607, "g_1607", print_hash_value); transparent_crc(g_1608, "g_1608", print_hash_value); transparent_crc(g_1610, "g_1610", print_hash_value); transparent_crc(g_1738, "g_1738", print_hash_value); transparent_crc(g_1739, "g_1739", print_hash_value); transparent_crc(g_1747.f0, "g_1747.f0", print_hash_value); transparent_crc(g_1747.f1, "g_1747.f1", print_hash_value); transparent_crc(g_1747.f2, "g_1747.f2", print_hash_value); transparent_crc(g_1747.f3, "g_1747.f3", print_hash_value); transparent_crc(g_1747.f4, "g_1747.f4", print_hash_value); transparent_crc(g_1747.f5, "g_1747.f5", print_hash_value); transparent_crc(g_1747.f6, "g_1747.f6", print_hash_value); transparent_crc(g_1747.f7, "g_1747.f7", print_hash_value); transparent_crc(g_1747.f8, "g_1747.f8", print_hash_value); transparent_crc(g_1749.f0, "g_1749.f0", print_hash_value); transparent_crc(g_1749.f1, "g_1749.f1", print_hash_value); transparent_crc(g_1749.f2, "g_1749.f2", print_hash_value); transparent_crc(g_1749.f3, "g_1749.f3", print_hash_value); transparent_crc(g_1749.f4, "g_1749.f4", print_hash_value); transparent_crc(g_1749.f5, "g_1749.f5", print_hash_value); transparent_crc(g_1749.f6, "g_1749.f6", print_hash_value); transparent_crc(g_1749.f7, "g_1749.f7", print_hash_value); transparent_crc(g_1749.f8, "g_1749.f8", print_hash_value); transparent_crc(g_1782, "g_1782", print_hash_value); transparent_crc(g_1873, "g_1873", print_hash_value); transparent_crc(g_1894.f0, "g_1894.f0", print_hash_value); for (i = 0; i < 1; i++) { transparent_crc(g_1963[i].f0, "g_1963[i].f0", print_hash_value); transparent_crc(g_1963[i].f1, "g_1963[i].f1", print_hash_value); transparent_crc(g_1963[i].f2, "g_1963[i].f2", print_hash_value); transparent_crc(g_1963[i].f3, "g_1963[i].f3", print_hash_value); transparent_crc(g_1963[i].f4, "g_1963[i].f4", print_hash_value); transparent_crc(g_1963[i].f5, "g_1963[i].f5", print_hash_value); transparent_crc(g_1963[i].f6, "g_1963[i].f6", print_hash_value); transparent_crc(g_1963[i].f7, "g_1963[i].f7", print_hash_value); transparent_crc(g_1963[i].f8, "g_1963[i].f8", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2013, "g_2013", print_hash_value); transparent_crc(g_2109, "g_2109", print_hash_value); transparent_crc(g_2121, "g_2121", print_hash_value); transparent_crc(g_2122, "g_2122", print_hash_value); transparent_crc(g_2123, "g_2123", print_hash_value); transparent_crc(g_2124, "g_2124", print_hash_value); transparent_crc(g_2125, "g_2125", print_hash_value); transparent_crc(g_2126, "g_2126", print_hash_value); transparent_crc(g_2127, "g_2127", print_hash_value); transparent_crc(g_2128, "g_2128", print_hash_value); for (i = 0; i < 1; i++) { transparent_crc(g_2129[i], "g_2129[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2130, "g_2130", print_hash_value); transparent_crc(g_2131, "g_2131", print_hash_value); transparent_crc(g_2132, "g_2132", print_hash_value); transparent_crc(g_2133, "g_2133", print_hash_value); for (i = 0; i < 6; i++) { transparent_crc(g_2134[i], "g_2134[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2135, "g_2135", print_hash_value); transparent_crc(g_2136, "g_2136", print_hash_value); for (i = 0; i < 8; i++) { transparent_crc(g_2137[i], "g_2137[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2141.f0, "g_2141.f0", print_hash_value); transparent_crc(g_2143.f0, "g_2143.f0", print_hash_value); transparent_crc(g_2144, "g_2144", print_hash_value); transparent_crc(g_2182, "g_2182", print_hash_value); for (i = 0; i < 8; i++) { for (j = 0; j < 10; j++) { transparent_crc(g_2183[i][j], "g_2183[i][j]", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_2184, "g_2184", print_hash_value); transparent_crc(g_2185, "g_2185", print_hash_value); transparent_crc(g_2197, "g_2197", print_hash_value); transparent_crc(g_2236, "g_2236", print_hash_value); transparent_crc(g_2354, "g_2354", print_hash_value); transparent_crc(g_2375, "g_2375", print_hash_value); transparent_crc(g_2388.f0, "g_2388.f0", print_hash_value); transparent_crc(g_2388.f1, "g_2388.f1", print_hash_value); transparent_crc(g_2388.f2, "g_2388.f2", print_hash_value); transparent_crc(g_2388.f3, "g_2388.f3", print_hash_value); transparent_crc(g_2388.f4, "g_2388.f4", print_hash_value); transparent_crc(g_2388.f5, "g_2388.f5", print_hash_value); transparent_crc(g_2388.f6, "g_2388.f6", print_hash_value); transparent_crc(g_2388.f7, "g_2388.f7", print_hash_value); transparent_crc(g_2388.f8, "g_2388.f8", print_hash_value); transparent_crc(g_2421, "g_2421", print_hash_value); transparent_crc(g_2449, "g_2449", print_hash_value); transparent_crc(g_2546, "g_2546", print_hash_value); for (i = 0; i < 5; i++) { transparent_crc(g_2548[i].f0, "g_2548[i].f0", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2560.f0, "g_2560.f0", print_hash_value); for (i = 0; i < 2; i++) { transparent_crc(g_2561[i].f0, "g_2561[i].f0", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2567.f0, "g_2567.f0", print_hash_value); transparent_crc(g_2687, "g_2687", print_hash_value); transparent_crc(g_2706, "g_2706", print_hash_value); for (i = 0; i < 7; i++) { transparent_crc(g_2707[i], "g_2707[i]", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2712, "g_2712", print_hash_value); transparent_crc(g_2730, "g_2730", print_hash_value); transparent_crc(g_2734.f0, "g_2734.f0", print_hash_value); transparent_crc(g_2738, "g_2738", print_hash_value); transparent_crc(g_2743, "g_2743", print_hash_value); transparent_crc(g_2768.f0, "g_2768.f0", print_hash_value); transparent_crc(g_2769.f0, "g_2769.f0", print_hash_value); for (i = 0; i < 9; i++) { for (j = 0; j < 10; j++) { transparent_crc(g_2770[i][j].f0, "g_2770[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_2771.f0, "g_2771.f0", print_hash_value); for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) { transparent_crc(g_2772[i][j].f0, "g_2772[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } for (i = 0; i < 5; i++) { for (j = 0; j < 3; j++) { transparent_crc(g_2773[i][j].f0, "g_2773[i][j].f0", print_hash_value); if (print_hash_value) printf("index = [%d][%d]\n", i, j); } } transparent_crc(g_2774.f0, "g_2774.f0", print_hash_value); transparent_crc(g_2775.f0, "g_2775.f0", print_hash_value); for (i = 0; i < 4; i++) { transparent_crc(g_2776[i].f0, "g_2776[i].f0", print_hash_value); if (print_hash_value) printf("index = [%d]\n", i); } transparent_crc(g_2777.f0, "g_2777.f0", print_hash_value); platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); return 0; } /************************ statistics ************************* XXX max struct depth: 0 breakdown: depth: 0, occurrence: 623 XXX total union variables: 0 XXX non-zero bitfields defined in structs: 1 XXX zero bitfields defined in structs: 0 XXX const bitfields defined in structs: 0 XXX volatile bitfields defined in structs: 1 XXX structs with bitfields in the program: 43 breakdown: indirect level: 0, occurrence: 0 indirect level: 1, occurrence: 16 indirect level: 2, occurrence: 10 indirect level: 3, occurrence: 4 indirect level: 4, occurrence: 11 indirect level: 5, occurrence: 2 XXX full-bitfields structs in the program: 0 breakdown: XXX times a bitfields struct's address is taken: 16 XXX times a bitfields struct on LHS: 0 XXX times a bitfields struct on RHS: 0 XXX times a single bitfield on LHS: 0 XXX times a single bitfield on RHS: 0 XXX max expression depth: 45 breakdown: depth: 1, occurrence: 314 depth: 2, occurrence: 73 depth: 3, occurrence: 7 depth: 4, occurrence: 6 depth: 5, occurrence: 3 depth: 6, occurrence: 4 depth: 9, occurrence: 1 depth: 12, occurrence: 3 depth: 13, occurrence: 1 depth: 14, occurrence: 1 depth: 15, occurrence: 1 depth: 16, occurrence: 4 depth: 17, occurrence: 4 depth: 18, occurrence: 6 depth: 19, occurrence: 2 depth: 20, occurrence: 4 depth: 21, occurrence: 6 depth: 22, occurrence: 4 depth: 23, occurrence: 6 depth: 24, occurrence: 2 depth: 25, occurrence: 2 depth: 27, occurrence: 2 depth: 28, occurrence: 3 depth: 29, occurrence: 4 depth: 30, occurrence: 1 depth: 31, occurrence: 2 depth: 32, occurrence: 4 depth: 33, occurrence: 2 depth: 34, occurrence: 2 depth: 35, occurrence: 2 depth: 40, occurrence: 1 depth: 42, occurrence: 1 depth: 44, occurrence: 2 depth: 45, occurrence: 3 XXX total number of pointers: 620 XXX times a variable address is taken: 1560 XXX times a pointer is dereferenced on RHS: 259 breakdown: depth: 1, occurrence: 221 depth: 2, occurrence: 37 depth: 3, occurrence: 1 XXX times a pointer is dereferenced on LHS: 344 breakdown: depth: 1, occurrence: 312 depth: 2, occurrence: 32 XXX times a pointer is compared with null: 50 XXX times a pointer is compared with address of another variable: 15 XXX times a pointer is compared with another pointer: 18 XXX times a pointer is qualified to be dereferenced: 4647 XXX max dereference level: 4 breakdown: level: 0, occurrence: 0 level: 1, occurrence: 1264 level: 2, occurrence: 252 level: 3, occurrence: 85 level: 4, occurrence: 11 XXX number of pointers point to pointers: 242 XXX number of pointers point to scalars: 349 XXX number of pointers point to structs: 17 XXX percent of pointers has null in alias set: 29 XXX average alias set size: 1.47 XXX times a non-volatile is read: 2091 XXX times a non-volatile is write: 1024 XXX times a volatile is read: 15 XXX times read thru a pointer: 14 XXX times a volatile is write: 11 XXX times written thru a pointer: 11 XXX times a volatile is available for access: 4 XXX percentage of non-volatile access: 99.2 XXX forward jumps: 0 XXX backward jumps: 2 XXX stmts: 320 XXX max block depth: 5 breakdown: depth: 0, occurrence: 34 depth: 1, occurrence: 33 depth: 2, occurrence: 46 depth: 3, occurrence: 43 depth: 4, occurrence: 70 depth: 5, occurrence: 94 XXX percentage a fresh-made variable is used: 19.4 XXX percentage an existing variable is used: 80.6 FYI: the random generator makes assumptions about the integer size. See platform.info for more details. ********************* end of statistics **********************/
60abc1f9f668215a941efdadc67c7501acc73e18
5397bca05bd734ee3ae24e1850fa66fcc5e2d3be
/cpp_ffi/rust_result4232mut3232c_voidCRustString.h
59696b298ef757935c4a2866ab11827bce6972fc
[]
no_license
jolocom/wallet-rs-cpp
4c56f407fb8a7a052e6be27bafda098c44f44934
944d3b88efdb34a6e52542cdb0c9bd70a194a347
refs/heads/master
2023-03-03T01:12:17.071492
2021-02-12T10:27:48
2021-02-12T10:27:48
338,000,459
0
0
null
null
null
null
UTF-8
C
false
false
686
h
rust_result4232mut3232c_voidCRustString.h
// Automatically generated by flapigen #pragma once //for (u)intX_t types #include <stdint.h> #ifdef __cplusplus static_assert(sizeof(uintptr_t) == sizeof(uint8_t) * 8, "our conversation usize <-> uintptr_t is wrong"); #endif #include "rust_str.h" #ifdef __cplusplus extern "C" { #endif union CRustResultUnion4232mut3232c_voidCRustString { void * ok; struct CRustString err; }; #ifdef __cplusplus } // extern "C" { #endif #include <stdint.h> #ifdef __cplusplus extern "C" { #endif struct CRustResult4232mut3232c_voidCRustString { union CRustResultUnion4232mut3232c_voidCRustString data; uint8_t is_ok; }; #ifdef __cplusplus } // extern "C" { #endif
bda559edd3f6a3a724b1cb362aa810348c452a54
3257164bb560e3641341d5c1ef4bb672154c1da9
/src/user/user_list.c
d1934218dd0e047dbf25dd22785a06e685437fb3
[]
no_license
jamilettel/myftp
d84b2d15ab18461164827070b7f6a35713389c27
1c3b71c7c0d7ae0d4098cb4c7ad205277c46e66e
refs/heads/master
2022-04-14T13:49:31.005456
2020-04-19T09:47:37
2020-04-19T09:47:37
253,870,899
0
0
null
null
null
null
UTF-8
C
false
false
1,338
c
user_list.c
/* ** EPITECH PROJECT, 2020 ** myftp ** File description: ** list */ #include "myftp.h" static char *list_get_command(const char *arg) { char *cmd = NULL; int size = 0; if (!arg) return (strdup("ls -l")); if (access(arg, F_OK)) return (NULL); snprintf(NULL, 0, "ls -l %s%n", arg, &size); cmd = malloc(sizeof(char) * size + 1); if (cmd) sprintf(cmd, "ls -l %s", arg); return (cmd); } static void write_result_on_socket(int fd, FILE *file) { char buffer[512]; while (fgets(buffer, sizeof(buffer), file)) write_on_fd(fd, buffer); } void user_list_in_child(user_t *user, const char *arg) { char *cmd = list_get_command(arg); FILE *file = NULL; write_on_fd(user->cfd, "150 Here comes the directory listing.\r\n"); if (cmd) { file = popen(cmd, "r"); if (file) { write_result_on_socket(user->dt_cfd, file); pclose(file); } free(cmd); } write_on_fd(user->cfd, "226 Directory send OK.\r\n"); } bool user_list(user_t *user, const char *arg) { if (!user->dt_socket) return (user_add_reply( user, REPLY(REPLY_CANT_OPEN_DATA_CON, "Use PORT or PASV first."))); return (user_manage_process(user, arg, user_list_in_child)); }
fecc570b515b6dd2a7910e070d58277f2424213e
4a7d2000affa850cbfe70dd189ca5bc799c5b1de
/src/dll.h
56523eb1e0fc63b95aa0da4984e55900b069c820
[]
no_license
ezequieljm/Interface-Double-Linked-List
89d4e530119e88420d7733899a8c761cc942c7d8
23d8aaf41303bccaaeee80c25cef950e38c1b593
refs/heads/master
2023-05-03T08:34:02.520822
2021-05-22T15:41:54
2021-05-22T15:41:54
347,786,979
0
0
null
null
null
null
UTF-8
C
false
false
2,715
h
dll.h
/*doubleList.h * */ #if !defined _DOUBLE_LINKED_LIST #define _DOUBLE_LINKED_LIST typedef struct c { void *data; struct c *next; struct c *prev; }nodeC; typedef struct d { void *data; struct d *next; struct d *prev; } nodeD; typedef struct cl { nodeC *first; int elements; void (*insert)(nodeC *q, struct cl *cl, int first); int (*naturalTravel)(struct cl *cl, void (*fn)(void *)); int (*unnaturalTravel)(struct cl *cl, void (*fn)(void *)); void (*deleteAllDCL)(struct cl *cl); void *(*reserv)(void *x, void *(*fn)(), int (*fn2)(void *, void *)); void (*insertOrdered)(nodeC *q, struct cl *cl, int (*comparator)(void *a, void *b)); }doubleCircularList; typedef struct dl{ nodeD *first; nodeD *last; int elements; void (*pop)(struct dl *ls); void (*push)(nodeD *q, struct dl *ls); void (*unshift)(nodeD *q, struct dl *ls); void (*shift)(struct dl *ls); void (*insertOrdered)(nodeD *q, struct dl *ls, int(*comparator)(void *, void *) ); nodeD *(*getNextNode)(nodeD *q); nodeD *(*getPreviousNode)(nodeD *q); void *(*search)(void *e, struct dl *ls, int(*fn)(void *, void *)); int (*deleteNodeD)(void *e, struct dl *ls, int(*fn)(void *, void *)); void (*deleteAll)(struct dl *ls); void (*travelListNatural)(struct dl *ls, void (*displayDates)(void *) ); void (*travelListUnnatural)(struct dl *ls, void (*displayDates)(void *) ); } doubleList; void error(); void fflishIn(); nodeD *newNodeD(); void pushDN(nodeD *q, doubleList *ls); void popDN(doubleList *ls); void unshiftDN(nodeD *q, doubleList *ls); void insertOrderedDN(nodeD *q, doubleList *ls, int (*fn)(void *a, void *b)); void shiftDN(doubleList *ls); nodeD *getNextNodeD(nodeD *p); nodeD *getPreviousNodeD(nodeD *p); void *searchNodeD(void *e, struct dl *ls, int(*fn)(void *, void *)); int deleteNodeD(void *e, struct dl *ls, int(*fn)(void *, void *)); void deleteALL(doubleList *ls); void travelListNatural(doubleList *dl, void (*fn)(void *e)); void travelListUnnatural(doubleList *dl, void (*fn)(void *e)); doubleList createDoubleList(); //Circular list nodeC *newNodeC(); void insertNodeC(nodeC *q, doubleCircularList *cl, int first); int naturalTravel(doubleCircularList *cl, void(*fn)(void *)); int unnaturalTravel(doubleCircularList *cl, void(*fn)(void *)); void deleteAllDCL(doubleCircularList *cl); void *reserv(void *x, void *(*fn)(), int (*fn2)(void *, void *)); void insertOrdered(nodeC *q, doubleCircularList *cl, int (*fn)(void *a, void *b)); doubleCircularList createDCL(); #endif //_DOUBLE_LINKED_LIST
ba644d033b5ebb9c3d2806f39be5ba5fea8ca67a
dd0c6a097c5d57b15f537b8d13658fb442c01916
/Src/i2c_dcmi_driver.c
3b368bf99ab6c17c933bc27b5665b66ef64dd2c3
[]
no_license
kid1995/camera_project_temp
342d4643de5893d2448ab87e42900f2d0b9a8678
0199ba6634b644c2259055fc5aed2d0868b52768
refs/heads/master
2020-07-21T06:06:17.737607
2019-09-06T13:37:38
2019-09-06T13:37:38
206,767,256
0
0
null
null
null
null
UTF-8
C
false
false
4,074
c
i2c_dcmi_driver.c
#include "i2c_dcmi_driver.h" static I2C_HandleTypeDef *hi2c_dcmi; // TODO: read/write should do multiple try if I2c error happens /******************************* I2C Routines *********************************/ /** * @brief Initializes I2C HAL. */ void I2Cx_Init() { hi2c_dcmi = &hi2c1; HAL_I2C_Init(hi2c_dcmi); } /** * @brief Writes a single data. * @param Addr: I2C address * @param Reg: Register address * @param Value: Data to be written */ void I2Cx_Write(uint8_t Addr, uint8_t Reg, uint8_t Value) { HAL_StatusTypeDef status = HAL_OK; #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_I2C_DEBUG_RTT_DISABLE, "I2c write register 0x%x of device 0x%x with value 0x%x\n", Reg, Addr, Value); #endif status = HAL_I2C_Mem_Write(hi2c_dcmi, Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 100); /* Check the communication status */ if (status != HAL_OK) { /* Execute user timeout callback */ I2Cx_Error(Addr); } } /** * @brief Reads a single data. * @param Addr: I2C address * @param Reg: Register address * @retval Read data */ uint8_t I2Cx_Read(uint8_t Addr, uint8_t Reg) { HAL_StatusTypeDef status = HAL_OK; uint8_t Value = 0; status = HAL_I2C_Mem_Read(hi2c_dcmi, Addr, Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, 1000); #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_I2C_DEBUG_RTT_DISABLE, "I2c read register 0x%x of device 0x%x\n", Reg, Addr); #endif /* Check the communication status */ if (status != HAL_OK) { /* Execute user timeout callback */ I2Cx_Error(Addr); } return Value; } /** * @brief Reads multiple data. * @param Addr: I2C address * @param Reg: Reg address * @param MemAddress: Internal memory address * @param Buffer: Pointer to data buffer * @param Length: Length of the data * @retval Number of read data */ HAL_StatusTypeDef I2Cx_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length) { HAL_StatusTypeDef status = HAL_OK; #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_I2C_DEBUG_RTT_DISABLE, "I2c read multiple: read register 0x%x of device 0x%x - " "sum address: 0x%x\n", Reg, Addr, MemAddress); #endif status = HAL_I2C_Mem_Read(hi2c_dcmi, Addr, (uint16_t) Reg, MemAddress, Buffer, Length, 1000); /* Check the communication status */ if (status != HAL_OK) { /* I2C error occured */ I2Cx_Error(Addr); } return status; } /** * @brief Writes a value in a register of the device through BUS in using DMA * mode. * @param Addr: Device address on BUS Bus. * @param Reg: The target register address to write * @param MemAddress: Internal memory address * @param Buffer: The target register value to be written * @param Length: buffer size to be written * @retval HAL status */ HAL_StatusTypeDef I2Cx_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length) { HAL_StatusTypeDef status = HAL_OK; #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_I2C_DEBUG_RTT_DISABLE, "I2c write multiple: write register 0x%x of device 0x%x - " "sum address: 0x%x\n", Reg, Addr, MemAddress); #endif status = HAL_I2C_Mem_Write(hi2c_dcmi, Addr, (uint16_t) Reg, MemAddress, Buffer, Length, 1000); /* Check the communication status */ if (status != HAL_OK) { /* Re-Initialize the I2C Bus */ I2Cx_Error(Addr); } return status; } /** * @brief Manages error callback by re-initializing I2C. * @param Addr: I2C Address */ void I2Cx_Error(uint8_t Addr) { #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_COMMON_DEBUG_RTT_DISABLE, "Error: I2C HAL Problem \n"); SEGGER_RTT_printf( CAMERA_COMMON_DEBUG_RTT_DISABLE, "--Device at address 0x%x not respond\n", Addr); SEGGER_RTT_printf(CAMERA_COMMON_DEBUG_RTT_DISABLE, "Reinitializing I2c... "); #endif /* De-initialize the I2C communication bus */ HAL_I2C_DeInit(hi2c_dcmi); /* Re-Initialize the I2C communication bus */ I2Cx_Init(); #ifdef CAMERA_DEBUG_RTT SEGGER_RTT_printf(CAMERA_COMMON_DEBUG_RTT_DISABLE, "Done\n"); #endif } /** * @} */ /** * @} */ /** * @} */ /** * @} */
a0c2db6ba3bfd3d159f4bb7b01790d6dd6059422
f9e7b876c5cc4bd8cae56ae06226892de93a4adc
/uofw_courses_code/C_Programs/programs/labs/lab3/telephone2.c
a58d2b5588cadc13f47cc5d9d2fb6e6924169710
[]
no_license
malachig/archive
6e6533ca55e63a48260fddc130d8c88e73e9e638
5e858ef0c13bd205d8b4b664f839184f8b7deeb4
refs/heads/master
2023-02-19T17:26:51.784890
2023-02-17T15:02:22
2023-02-17T15:02:22
16,629,086
1
1
null
null
null
null
UTF-8
C
false
false
1,240
c
telephone2.c
/* Author: Malachi Griffith * Date: Sept. 18 2002 * Purpose: Computes telephone bills based on input from user * The program also illustrates the use of assignment operators such as "+=" * These operators are used as the "=" sign might be but instead of simply * assigning a value directly they increase, decrease, multiply or divide the value. */ #include <stdio.h> main() { double base_charge = 12.95, bill = 0, tax, long_charge, local_charge; int local_calls; printf("\nYour base charge before taxes is %4.2f \n", base_charge); printf("Enter the number of local calls > "); scanf("%d", &local_calls); printf("Enter the charge for long distance calls > \n"); scanf("%lf", &long_charge); printf("the number of local calls was > %d\n", local_calls); local_charge = local_calls * 0.1; printf("The cost of the local calls was > %5.2f\n", local_charge); printf("The cost of long distance calls was > %5.2f\n", long_charge); bill += base_charge; bill += long_charge; bill += local_charge; printf("The total bill before taxes is > %5.2f\n", bill); tax = bill*.0872; printf("The taxes on this bill are > %5.2f\n", tax); bill *= 1.0872; printf("Your final bill including taxes is > %5.2f\n", bill); }
de3c29d1124f5f5e5a3c322c0f4c6a5c05f53d4b
dc83780c14cc5d85b4f63d7e90ad5c2783631128
/headers/pocket.h
22491ed718964d61b78a56a8abebbf8a166735a4
[ "MIT", "Qhull" ]
permissive
Discngine/fpocket
a2476a9e640894c45612f825b25fd73fad535919
61b15247edb52b68d70df610c9f7b53a7ca683de
refs/heads/master
2023-08-16T18:00:12.914431
2023-07-24T07:30:47
2023-07-24T07:30:47
85,796,452
191
57
MIT
2023-07-24T07:30:49
2017-03-22T07:12:22
C
UTF-8
C
false
false
4,996
h
pocket.h
/* * Copyright <2012> <Vincent Le Guilloux,Peter Schmidtke, Pierre Tuffery> * Copyright <2013-2018> <Peter Schmidtke, Vincent Le Guilloux> 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. */ #ifndef DH_POCKET #define DH_POCKET /* Maximal distance between two vertices in order to belong to the same * pocket (single linkage clustering) */ #define MAX_CON_DIST 2.5 #define M_LIG_IN_POCKET_DIST 4.0 /**< maximum distance a ligand atom could have to a pocket barycenter to be considered inside the pocket*/ /* -----------------------------INCLUDES--------------------------------------*/ #include <math.h> #include <stdio.h> #include <stdlib.h> #include "voronoi_lst.h" #include "pscoring.h" #include "fparams.h" #include "aa.h" #include "utils.h" #include "memhandler.h" /* ---------------------- PUBLIC STRUCTURES ----------------------------------*/ /**pocket containing structure*/ typedef struct s_pocket { s_desc *pdesc ; /**< pointer to pocket descriptor structure */ c_lst_vertices *v_lst ; /**< chained list of Voronoi vertices*/ float score, /**< Discretize different parts of the score */ ovlp, /**< Atomic overlap */ ovlp2, /**< second overlap criterion*/ vol_corresp, /**< Volume overlap */ bary[3] ; /**< Barycenter (center of mass) of the pocket */ int rank, /**< Rank of the pocket */ size, nAlphaApol, /**< Number of apolar alpha spheres*/ nAlphaPol ; /**< Number of polar alpha spheres */ } s_pocket ; /** Chained list stuff for pockets */ typedef struct node_pocket { struct node_pocket *next ; /**< pointer to next pocket*/ struct node_pocket *prev ; /**< pointer to previous pocket*/ s_pocket *pocket ; } node_pocket ; /** Chained list stuff for pockets */ typedef struct c_lst_pockets { struct node_pocket *first ; /**< pointer to the first pocket*/ struct node_pocket *last ; /**< pointer to the last pocket*/ struct node_pocket *current ; /**< pointer to the current pocket*/ size_t n_pockets ; /**< number of pockets in the chained list*/ s_lst_vvertice *vertices ; /**< access to vertice list*/ } c_lst_pockets ; /* ------------------------------PROTOTYPES----------------------------------*/ /* CLUSTERING FUNCTIONS */ int updateIds(s_lst_vvertice *lvvert, int i, int *vNb, int resid,int curPocket,c_lst_pockets *pockets, s_fparams *params); void addStats(int resid, int size, int **stats,int *lenStats); c_lst_pockets *assign_pockets(s_lst_vvertice *lvvert); /* DESCRIPTOR FUNCTIONS */ void set_pockets_descriptors(c_lst_pockets *pockets,s_pdb *pdb,s_fparams *params, s_pdb *pdb_w_lig) ; void set_normalized_descriptors(c_lst_pockets *pockets) ; void set_pockets_bary(c_lst_pockets *pockets) ; s_atm** get_pocket_contacted_atms(s_pocket *pocket, int *natoms) ; int count_pocket_contacted_atms(s_pocket *pocket) ; s_vvertice** get_pocket_pvertices(s_pocket *pocket) ; void set_pocket_contacted_lig_name(s_pocket *pocket, s_pdb *pdb_w_lig); float set_pocket_mtvolume(s_pocket *pocket, int niter) ; float set_pocket_volume(s_pocket *pocket, int discret) ; /* ALLOCATION AND CHAINED LIST OPERATIONS FUNCTIONS*/ s_pocket* alloc_pocket(void) ; c_lst_pockets *c_lst_pockets_alloc(void); node_pocket *node_pocket_alloc(s_pocket *pocket); void c_lst_pocket_free(c_lst_pockets *lst); node_pocket *c_lst_pockets_add_first(c_lst_pockets *lst, s_pocket *pocket); node_pocket *c_lst_pockets_add_last(c_lst_pockets *lst,s_pocket *pocket,int cur_n_apol, int cur_n_pol); void swap_pockets(c_lst_pockets *pockets, node_pocket *p1, node_pocket *p2) ; void dropPocket(c_lst_pockets *pockets,node_pocket *pocket); void mergePockets(node_pocket *pocket,node_pocket *pocket2,c_lst_pockets *pockets); node_pocket *searchPocket(int resid,c_lst_pockets *pockets); /* OTHER FUNCTON*/ void reset_pocket(s_pocket *pocket) ; void print_pocket(FILE *f, s_pocket *pocket); void print_pockets(FILE *f, c_lst_pockets *pockets) ; void print_pockets_inv(FILE *f, c_lst_pockets *pockets) ; void free_pocket(s_pocket *p); #endif
08e5080dd2da5a9d98e83c80e9cd82da0db2d982
51ca9ba55d64cdf8ffed257664012ef336e75fe8
/include/mat4/create.h
e38c55507356e4f5acec559755faa95db811e46b
[ "Zlib", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tmpvar/mat4.c
7ee05c79ed6168508dd587c47e879ac589b7a2b2
84554310a5d6456c3f84b8d0a97a9c5719eb3280
refs/heads/master
2023-06-19T14:51:35.996920
2017-12-01T12:22:29
2017-12-01T15:33:59
38,517,266
2
3
null
2017-12-01T15:34:01
2015-07-04T01:39:12
C
UTF-8
C
false
false
519
h
create.h
#ifndef __mat4_create__ #define __mat4_create__ #include "type.h" #include <stdlib.h> /** * Creates a new identity mat4 * * @returns {mat4} a new 4x4 matrix */ mat4 mat4_create() { mat4 out = malloc(sizeof(float) * 16); out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = 1; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 1; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; }; #endif
7010e6657f044844cf592ee30cf424b61b9a5e34
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/reactos/sdk/lib/fslib/vfatlib/check/extr_lfn.c_clear_lfn_slots.c
34ff8d54ba5fc2fb81e2e78210853fc67ebffacd
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
1,221
c
extr_lfn.c_clear_lfn_slots.c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ empty ; struct TYPE_4__ {int /*<<< orphan*/ id; } ; typedef TYPE_1__ LFN_ENT ; /* Variables and functions */ int /*<<< orphan*/ DELETED_FLAG ; int /*<<< orphan*/ fs_write (int /*<<< orphan*/ ,int,TYPE_1__*) ; int /*<<< orphan*/ * lfn_offsets ; int /*<<< orphan*/ memset (TYPE_1__*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void clear_lfn_slots(int start, int end) { int i; LFN_ENT empty; /* New dir entry is zeroed except first byte, which is set to 0xe5. * This is to avoid that some FAT-reading OSes (not Linux! ;) stop reading * a directory at the first zero entry... */ memset(&empty, 0, sizeof(empty)); empty.id = DELETED_FLAG; for (i = start; i <= end; ++i) { fs_write(lfn_offsets[i], sizeof(LFN_ENT), &empty); } }
5f1c70cf908dc62989dc08b70e612ba6ccc5ad11
f84816ba7a3e1d59029226db5d6017d3d10f45eb
/Firmware/RP2040/hal_rp2040/driver.h
09c9349fd177de41f921bd67a7891c115329b969
[]
no_license
terjeio/GRBL_MPG_DRO_BoosterPack
f702e94ce11d510d6b1ff59467c0e5276cf304e3
ce7dbd1e4f0399d4041e7ad280a2164cd95c60d4
refs/heads/master
2023-03-06T01:29:10.483556
2023-02-27T06:00:05
2023-02-27T06:00:05
131,947,133
40
18
null
null
null
null
UTF-8
C
false
false
2,572
h
driver.h
/* * driver.h - HAL driver for Raspberry RP2040 ARM processor * * Part of MPG/DRO for grbl on a secondary processor * * v0.0.2 / 2022-01-04 / (c) Io Engineering / Terje */ /* Copyright (c) 2021-2022, Terje Io All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder 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. */ #ifndef _DRIVER_H_ #define _DRIVER_H_ #define KEYFWD_PIN 11 #define KEYINTR_PIN 5 #define MASTER_I2C_PORT 1 #define MASTER_SDA_PIN 26 #define MASTER_SCL_PIN 27 #define SLAVE_I2C_PORT 0 #define SLAVE_SDA_PIN 8 #define SLAVE_SCL_PIN 9 #define NAVIGATOR_A 14 #define NAVIGATOR_B 15 #define NAVIGATOR_SW_PIN 10 #define MPG_A 20 #define MPG_B 21 // GPIO #define SPINDLEDIR_PIN 4 // GPIO0 / Touch IRQ #define MPG_MODE_PIN 3 // GPIO1 #define GPIO2_PIN 2 // GPIO2 // GRBL SIGNALS #define CYCLESTART_PIN 0 #define FEEDHOLD_PIN 1 #define UART_TX_PIN 12 #define UART_RX_PIN 13 #ifndef UART_PORT #define UART_PORT uart0 #define UART_IRQ UART0_IRQ #endif // MSP430 SWD #define SWD_RESET 22 #define SWD_TEST 28 #endif
40cf361e41fc2f6089e172a103de1292779e23d3
bb108c3ea7d235e6fee0575181b5988e6b6a64ef
/mame/src/mame/audio/micro3d.c
c03ab850f8e42f8763ca674adaa91b6cd679afef
[ "MIT" ]
permissive
clobber/MAME-OS-X
3c5e6058b2814754176f3c6dcf1b2963ca804fc3
ca11d0e946636bda042b6db55c82113e5722fc08
refs/heads/master
2021-01-20T05:31:15.086981
2013-04-17T18:42:40
2013-04-17T18:42:40
3,805,274
15
8
null
2013-04-17T18:42:41
2012-03-23T04:23:01
C
UTF-8
C
false
false
11,088
c
micro3d.c
/*************************************************************************** Microprose sound hardware Bit of a rush job - needs to be implemented properly eventually ***************************************************************************/ #include "emu.h" #include "sound/upd7759.h" #include "includes/micro3d.h" #define MM5837_CLOCK 100000 /************************************* * * Type definitions * *************************************/ typedef struct _biquad_ { double a0, a1, a2; /* Numerator coefficients */ double b0, b1, b2; /* Denominator coefficients */ } biquad; typedef struct _filter_ { float *history; float *coef; double fs; biquad ProtoCoef[2]; } lp_filter; typedef struct _filter_state filter_state; struct _filter_state { double capval; double exponent; }; typedef struct _noise_state { union { struct { UINT8 vcf; UINT8 vcq; UINT8 vca; UINT8 pan; }; UINT8 dac[4]; }; float gain; UINT32 noise_shift; UINT8 noise_state; UINT8 noise_subcount; filter_state noise_filters[4]; lp_filter filter; sound_stream *stream; } noise_state; /************************************* * * Pink noise filtering * *************************************/ /* Borrowed from segasnd.c */ INLINE void configure_filter(filter_state *state, double r, double c) { state->capval = 0; state->exponent = 1.0 - exp(-1.0 / (r * c * 2000000/8)); } INLINE double step_rc_filter(filter_state *state, double input) { state->capval += (input - state->capval) * state->exponent; return state->capval; } INLINE double step_cr_filter(filter_state *state, double input) { double result = (input - state->capval); state->capval += (input - state->capval) * state->exponent; return result; } /************************************* * * SSM2047 simulation * *************************************/ static void filter_init(running_machine &machine, lp_filter *iir, double fs) { /* Section 1 */ iir->ProtoCoef[0].a0 = 1.0; iir->ProtoCoef[0].a1 = 0; iir->ProtoCoef[0].a2 = 0; iir->ProtoCoef[0].b0 = 1.0; iir->ProtoCoef[0].b1 = 0.765367; iir->ProtoCoef[0].b2 = 1.0; /* Section 2 */ iir->ProtoCoef[1].a0 = 1.0; iir->ProtoCoef[1].a1 = 0; iir->ProtoCoef[1].a2 = 0; iir->ProtoCoef[1].b0 = 1.0; iir->ProtoCoef[1].b1 = 1.847759; iir->ProtoCoef[1].b2 = 1.0; iir->coef = (float *)auto_alloc_array_clear(machine, float, 4 * 2 + 1); iir->fs = fs; iir->history = (float *)auto_alloc_array_clear(machine, float, 2 * 2); } static void prewarp(double *a0, double *a1, double *a2,double fc, double fs) { double wp, pi; pi = 4.0 * atan(1.0); wp = 2.0 * fs * tan(pi * fc / fs); *a2 = *a2 / (wp * wp); *a1 = *a1 / wp; } static void bilinear(double a0, double a1, double a2, double b0, double b1, double b2, double *k, double fs, float *coef) { double ad, bd; ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; *k *= ad/bd; *coef++ = (2. * b0 - 8. * b2 * fs * fs) / bd; *coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0) / bd; *coef++ = (2. * a0 - 8. * a2 * fs * fs) / ad; *coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0) / ad; } static void recompute_filter(lp_filter *iir, double k, double q, double fc) { int nInd; double a0, a1, a2, b0, b1, b2; float *coef = iir->coef + 1; for (nInd = 0; nInd < 2; nInd++) { a0 = iir->ProtoCoef[nInd].a0; a1 = iir->ProtoCoef[nInd].a1; a2 = iir->ProtoCoef[nInd].a2; b0 = iir->ProtoCoef[nInd].b0; b1 = iir->ProtoCoef[nInd].b1 / q; b2 = iir->ProtoCoef[nInd].b2; prewarp(&a0, &a1, &a2, fc, iir->fs); prewarp(&b0, &b1, &b2, fc, iir->fs); bilinear(a0, a1, a2, b0, b1, b2, &k, iir->fs, coef); coef += 4; } iir->coef[0] = k; } void micro3d_noise_sh_w(running_machine &machine, UINT8 data) { micro3d_state *state = machine.driver_data<micro3d_state>(); if (~data & 8) { device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1"); noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token(); if (state->m_dac_data != nstate->dac[data & 3]) { double q; double fc; nstate->stream->update(); nstate->dac[data & 3] = state->m_dac_data; if (nstate->vca == 255) nstate->gain = 0; else nstate->gain = exp(-(float)(nstate->vca) / 25.0) * 10.0; q = 0.75/255 * (255 - nstate->vcq) + 0.1; fc = 4500.0/255 * (255 - nstate->vcf) + 100; recompute_filter(&nstate->filter, nstate->gain, q, fc); } } } INLINE noise_state *get_safe_token(device_t *device) { assert(device != NULL); assert(device->type() == MICRO3D); return (noise_state *)downcast<legacy_device_base *>(device)->token(); } static STREAM_UPDATE( micro3d_stream_update ) { noise_state *state = (noise_state *)param; lp_filter *iir = &state->filter; float pan_l, pan_r; stream_sample_t *fl = &outputs[0][0]; stream_sample_t *fr = &outputs[1][0]; /* Clear the buffers */ memset(outputs[0], 0, samples * sizeof(*outputs[0])); memset(outputs[1], 0, samples * sizeof(*outputs[1])); if (state->gain == 0) return; pan_l = (float)(255 - state->pan) / 255.0; pan_r = (float)(state->pan) / 255.0; while (samples--) { unsigned int i; float *hist1_ptr,*hist2_ptr,*coef_ptr; float output,new_hist,history1,history2; float input, white; int step; /* Update the noise source */ for (step = 2000000 / (2000000/8); step >= state->noise_subcount; step -= state->noise_subcount) { state->noise_shift = (state->noise_shift << 1) | (((state->noise_shift >> 13) ^ (state->noise_shift >> 16)) & 1); state->noise_state = (state->noise_shift >> 16) & 1; state->noise_subcount = 2000000 / MM5837_CLOCK; } state->noise_subcount -= step; input = (float)state->noise_state - 0.5; white = input; /* Pink noise filtering */ state->noise_filters[0].capval = 0.99765 * state->noise_filters[0].capval + input * 0.0990460; state->noise_filters[1].capval = 0.96300 * state->noise_filters[1].capval + input * 0.2965164; state->noise_filters[2].capval = 0.57000 * state->noise_filters[2].capval + input * 1.0526913; input = state->noise_filters[0].capval + state->noise_filters[1].capval + state->noise_filters[2].capval + input * 0.1848; input += white; input *= 200.0f; coef_ptr = iir->coef; hist1_ptr = iir->history; hist2_ptr = hist1_ptr + 1; /* 1st number of coefficients array is overall input scale factor, * or filter gain */ output = input * (*coef_ptr++); for (i = 0 ; i < 2; i++) { history1 = *hist1_ptr; history2 = *hist2_ptr; output = output - history1 * (*coef_ptr++); new_hist = output - history2 * (*coef_ptr++); output = new_hist + history1 * (*coef_ptr++); output = output + history2 * (*coef_ptr++); *hist2_ptr++ = *hist1_ptr; *hist1_ptr++ = new_hist; hist1_ptr++; hist2_ptr++; } output *= 3.5; /* Clip */ if (output > 32767) output = 32767; else if (output < -32768) output = -32768; *fl++ = output * pan_l; *fr++ = output * pan_r; } } /************************************* * * Initialisation * *************************************/ static DEVICE_START( micro3d_sound ) { running_machine &machine = device->machine(); noise_state *state = get_safe_token(device); /* Allocate the stream */ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), state, micro3d_stream_update); filter_init(machine, &state->filter, machine.sample_rate()); configure_filter(&state->noise_filters[0], 2.7e3 + 2.7e3, 1.0e-6); configure_filter(&state->noise_filters[1], 2.7e3 + 1e3, 0.30e-6); configure_filter(&state->noise_filters[2], 2.7e3 + 270, 0.15e-6); configure_filter(&state->noise_filters[3], 2.7e3 + 0, 0.082e-6); // configure_filter(&state->noise_filters[4], 33e3, 0.1e-6); } static DEVICE_RESET( micro3d_sound ) { noise_state *state = get_safe_token(device); state->noise_shift = 0x15555; state->dac[0] = 255; state->dac[1] = 255; state->dac[2] = 255; state->dac[3] = 255; } DEVICE_GET_INFO( micro3d_sound ) { switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(noise_state); break; /* --- the following bits of info are returned as pointers to data or functions --- */ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(micro3d_sound); break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(micro3d_sound); break; /* --- the following bits of info are returned as NULL-terminated strings --- */ case DEVINFO_STR_NAME: strcpy(info->s, "Microprose Custom"); break; case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; } } /*************************************************************************** 8031 port mappings: Port 1 Port 2 ======= ====== 0: S/H sel A (O) 0: 1: S/H sel B (O) 1: 2: S/H sel C (O) 2: uPD bank select (O) 3: S/H en (O) 3: /uPD busy (I) 4: DS1267 data (O) 4: /uPD reset (O) 5: DS1267 clock (O) 5: Watchdog reset (O) 6: /DS1267 reset (O) 6: 7: Test SW (I) 7: ***************************************************************************/ WRITE8_HANDLER( micro3d_snd_dac_a ) { micro3d_state *state = space->machine().driver_data<micro3d_state>(); state->m_dac_data = data; } WRITE8_HANDLER( micro3d_snd_dac_b ) { /* TODO: This controls upd7759 volume */ } WRITE8_HANDLER( micro3d_sound_io_w ) { micro3d_state *state = space->machine().driver_data<micro3d_state>(); state->m_sound_port_latch[offset] = data; switch (offset) { case 0x01: { micro3d_noise_sh_w(space->machine(), data); break; } case 0x03: { device_t *upd = space->machine().device("upd7759"); upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0); upd7759_reset_w(upd, (data & 0x10) ? 0 : 1); break; } } } READ8_HANDLER( micro3d_sound_io_r ) { micro3d_state *state = space->machine().driver_data<micro3d_state>(); switch (offset) { case 0x01: return (state->m_sound_port_latch[offset] & 0x7f) | input_port_read(space->machine(), "SOUND_SW"); case 0x03: return (state->m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine().device("upd7759")) ? 0x08 : 0); default: return 0; } } WRITE8_DEVICE_HANDLER( micro3d_upd7759_w ) { upd7759_port_w(device, 0, data); upd7759_start_w(device, 0); upd7759_start_w(device, 1); } DEFINE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound);
9bcc7ef761e7be5b0e9c9d2257efc29798fced65
27ff0fd723fef1a94492a7724a3874aaff77bc83
/stop.c
cd39f380f5c4c04793a02ce2373bb9be634633e7
[]
no_license
bingjinyeah/prjt
f54b909360b4f1c29de246d881a85bff5fbdec1a
d25ee17022ac8baeaa000b57b7c6e97cd01fa3ac
refs/heads/master
2016-08-11T21:05:55.146739
2016-03-17T08:19:17
2016-03-17T08:19:17
52,786,134
0
0
null
null
null
null
UTF-8
C
false
false
682
c
stop.c
#include "includes.h" //extern Uint16 _EEDATA(2) _ESD_ExceedSp; extern void ident_thread(); extern void flow_thread(); Uint8 button_stop_process(){ Uint16 res; if(_Rush_PlaceCount>=40){ _Rush_PlaceCount = 0; lcd_dis_stop(); } _DP_IDATA1 &= ~BIT5; _DP_IDATA1 &= ~BIT6; _DP_IDATA2 &= ~BIT6; _strAlarmFlag &= ~_ButtonFlag; _Thread_Flag = 0; _ucharOpenKey = 0; _ucharCloseKey = 0; eedata_read(_ESD_ExceedSp,res); if(res!=ufalse){ if(com_esd()){ esd_thread(); } } flow_thread(); ident_thread(); if(_ucharMenuKey){ menu_thread(); } return E_ERR; }
36a0403ad04868cdb000981a8ed90b0e3f555817
1bdc6e0a9af3966046ac05535ee972231f9fd37b
/tsk/gauprof.c
f08d4feb49088418bc57568b2e54287158d793b8
[]
no_license
mfkiwl/gipsy-1
8e17e50f30ceb10f2f62b65170be41257bed6efc
d8af6a106b8d9d1ae605d4105afca75ebf62bf0a
refs/heads/master
2021-06-18T13:30:32.700074
2017-07-05T12:20:32
2017-07-05T12:20:32
null
0
0
null
null
null
null
UTF-8
C
false
false
82,124
c
gauprof.c
/* COPYRIGHT (c) 1995 Kapteyn Astronomical Institute University of Groningen, The Netherlands All Rights Reserved. #> gauprof.dc1 Warning: This program is not maintained anymore. In the near future, it will be removed from the set of GIPSY tasks. An improved version with graphical user interface is called XGAUPROF. Program: GAUPROF Purpose: GAUPROF examines influence of parameters in GAUFIT by plotting Gaussian estimate and fit of a selected profile. Category: ANALYSIS, PROFILES, PLOTTING File: gauprof.c Author: M.G.R. Vogelaar Keywords: STARTNEW= Start improved version of this program? [Y]/N A new version with graphical user interface is called XGAUPROF. You can start it here. INSET= Give set name and operation axis ( & range ): Maximum number of subsets is 2048. ** SUBDIV= View surface subdivisions x,y: [1,1] It is possible to have more plots on the view surface. The number of plots can vary in both directions x and y. GRDEVICE= Graphics device [list of all graphics devices] ** PAPER= Give width (cm), aspect ratio: [0.0,1.0] Change the size of the (output) view surface. The aspect ratio is defined as height/width. The default is a calculated size and aspect ratio 1. ** LINEWIDTH= Give line width (1-21): [2] Only required if a hardcopy device is selected. ** XMINMAX= Give Xmin, Xmax in plot: [calculated] ** YMINMAX= Give Ymin, Ymax in plot: [calculated] BOX= Enter profile position(s) in ..., ...: [quit] Examples: BOX=3 4 Examine profile at (3,4) BOX=0 0 3 3 Examine profiles from (0,0) to (3,3) or: BOX=D 3 3 CPOS=0 0 Examine profiles from (-1,-1) to (1,1) PROFILE= (Q)uit, (S)ame, (P)revious, (B)ox, [N]ext profile 1) (Q)uit program 2) (S)ame profile (you can change parameters now) 3) (P)revious profile if it exists. 4) (N)ext profile Next keywords become hidden after their first specification. NGAUSS= Give max. number of gaussians in profile: [1] The maximum number is 5. The calculation of the initial estimates. ========================================= The fit routine in GAUFIT needs initial estimates for the parameters. These estimates are calculated by the program using a method described by Schwarz, 1968, Bull.Astr.Inst. Netherlands, Volume 19, 405. The associated routine reads a number of parameters. It uses NGAUSS=, and the hidden keywords: ESTRMS=, ESTCUTAMP= and ESTCUTDISP=. ** ESTRMS= Give rms noise level in profile: [0.0] Rms of noise in profile in units of the data. The value is used in an automatic window method to define the signal region in the routine that calcu- lates initial estimates for each profile. ** ESTCUTAMP= Give cutoff for profile: [0.0] Estimated gaussians below this amplitude will be discarded. The amplitude is in units of the data. ** ESTCUTDISP= Give critical dispersion of gaussian: [0.0] Estimated gaussians with dispersion smaller than the critical dispersion will be discarded. The critical dispersion is given in units of the operation axis. Q= Give smoothing parameter: [2] See description. Calculation of the fitted parameters. ==================================== The actual fitting is a least-squares fit of a function to a set of data points. The method used is described in: Marquardt, J.Soc.Ind.Appl.Math. 11, 431 (1963). This method is a mixture of the steepest descent method and the Taylor method. The weights for the data points are all equal to 1.0. TOLERANCE= Fractional tolerance for the chi square: [0.01] Fitting is stopped when successive iterations fail to produce a decrement in reduced chi-squared less than TOLERANCE= The value cannot be less than a certain minimum as set by the system. This means that maximum accuracy can be obtained with TOLERANCE=0.0 ** MAXITS= Maximum number of iterations in fit: [50] If this number is exceeded, no parameters could be fitted. ** LAB= Value for mixing parameter: [0.001] Mixing parameter in the least squares fit function. LAB= determines the initial weight of steepest descent method relative to the Taylor method. LAB= should be a small value (i.e. 0.001). Edge fitting ============ ** CENTVAL= Central value for edge fit in physical coordinates: [Central value on profile axis] The position in physical units, needed to determine in which direction data along profile is stored to be used in a least squares fit, now called 'edge' fit. ** EDGEFIT= Do you want an 'edge' fit? Y/[N] Default: skip the 'edge 'fitting'. Description: The decomposition of profiles into Gaussian components can be a powerful method in the study of the kinematics of neutral hydrogen. The program GAUFIT can make initial estimates of Gaussian parameters that can be stored or used as initial values for a least-squares fit. This program (GAUPROF) helps you to examine the influence of different variables like the ones specified with the keywords NGAUSS=, ESTCUTAMP=, ESTCUTDISP=, Q= and TOLERANCE=. There is a loop facility that enables you to change keywords for the same profile. In the observed profile the second derivative of a fitted second order polynomial is used to estimate the parameters of the Gaussian components. The polynomial is fitted at each pixel using q points distributed symmetrically around any pixel. The number q equals 2*Q+1 where Q is given by the smoothing parameter (Q=). The threshold values given by ESTRMS= (rms noise of the profile), and Q=, are used to discriminate against spurious components. Other criteria to select valid Gaussians are a critical amplitude (ESTCUTAMP=) and a critical dispersion (ESTCUTDISP=) in units selected by the program. Gaussians with amplitude smaller than ESTCUTAMP= or with dispersion smaller than ESTCUTDISP= will be discarded. It is assumed that the observed profile can be approxi- mated by the sum of a few Gaussian functions. The number of Gaussians you allow in the calculations is set by NGAUSS=. The maximum number is 5. (For more details: Schwarz, 1968, Bull.Astr.Inst. Netherlands, Volume 19, 405-413.) The fit of the estimated set of components could be improved by means of a least-squares analysis (Full line in the plot). Fitting of the profile stops when successive iterations fail to produce a decrement in reduced chi-squared less than TOLERANCE=. If its value is less than the minimum tolerance possible, it will be set to this value. This means that maximum accuracy can be obtained by setting TOLERANCE=0.0. The weights for all data points is set to 1.0. In order to fit Gaussians in profiles you first need to specify the input set and the subsets (INSET=). The number of subsets must be greater than 1 and less than 2048 and the subsets are specified by giving the name of the axis in the direction in which you want your profiles. Suppose your set AURORA has the axes: RA-NCP from -7 to 8 DEC-NCP from -7 to 8 FREQ-OHEL from 1 to 59 and you want an estimate and fit of Gaussian components of a profile in frequency direction at RA=2, DEC=4, specify: INSET=AURORA FREQ 1:59 BOX=2 4 The 'edge' fitting routine selects data from the position (in physical coordinates) of the estimated Gaussian with maximum amplitude ('center') to a profile edge and performs a 'lsq' fit. The edge is chosen in the following way: If the value in CENTVAL= is smaller than 'center', all data with axis values (in physical coordinates) greater than center are assembled for the 'lsq' fit etc. Sometimes the amplitude of the edge fit is larger than the maximum value of the used data. To adjust your plot use XMINMAX= and YMINMAX=. These keywords are hidden, so you have to specify them for instance at the same time as PROFILE= in the plot loop. Example: <USER >gauprof <USER >INSET=m8320 f 1:58 Set M8320 has 3 axes RA-NCP from -50 to 40 DEC-NCP from -50 to 20 FREQ-OHEL from 1 to 59 <USER >GRDEVICE=tek <USER >BOX=-3 -3 4 4 BOX range for set M8320 : RA-NCP from -3 to 4 DEC-NCP from -3 to 4 <USER >NGAUSS=2 <USER >ESTRMS=0.3 <USER >ESTCUTAMP=0.6 <USER >ESTCUTDISP=0.4 <USER >Q=2 <USER >CENTVAL= GAUPROF: ESTIMATE FIT =======================================================... gauss ampl. centre disp. ampl. centre ... W.U. KM/S KM/S W.U. KM/S ... =======================================================... 1 2.89 212.01 8.61 3.43 214.34... 2 0.45 192.04 3.56 0.61 192.63... NGAUSS=2 RMS=0.30 CUTAMP=0.60 CUTDISP=0.40 Q=... <USER >PROFILE=n 1 0.88 225.13 3.69 2.54 217.01... 2 0.58 192.50 3.49 0.42 195.15... <USER >PROFILE=q <STATUS> gauprof - +++ FINISHED +++ Updates: Jun 11, 1991: VOG, Document created. Oct 10, 1991: WZ, PGPLOT standard names implemented Mar 25, 1994: VOG, Rearranged keywords. May 30, 1995: VOG, Copied 'func' and 'derv' from GAUFIT. Added MAXITS= and LAB= keywords. Updated documentation #< */ #include "stdio.h" #include "stdlib.h" #include "string.h" #include "math.h" #include "cmain.h" #include "gipsyc.h" #include "ctype.h" #include "init.h" #include "finis.h" #include "float.h" #include "gdsinp.h" #include "gdsbox.h" #include "setfblank.h" #include "myname.h" #include "anyout.h" #include "reject.h" #include "cancel.h" #include "nelc.h" #include "gdsc_range.h" #include "gdsc_grid.h" #include "gdsc_ndims.h" #include "gdsc_fill.h" #include "gdsc_name.h" #include "gdsi_read.h" #include "gdsd_rchar.h" #include "cotrans.h" #include "error.h" #include "stabar.h" #include "axunit.h" #include "userreal.h" #include "userlog.h" #include "userint.h" #include "usertext.h" #include "userfio.h" #include "presetd.h" #include "minmax1.h" #include "gauest.h" #include "lsqfit.h" #include "status.h" #include "pgplot.h" #define AXESMAX 10 /* Max. allowed number of axes in a set */ #define SUBSMAX 2048 /* Max. number of substructures to be specified */ #define MAXBUF 16*4096 /* Buffer size for I/O */ #define MAXGAUSS 8 /* Max. number of gaussians in profile */ #define MAXPAR 3 /* Max. parameters in one gaussian */ #define MAXPARALL MAXPAR*MAXGAUSS /* Max. parameters in all gaussians */ #define PLOTPOINTS 200 /* Max number of points to plot */ #define BIGSTORE 80 /* Length of a string */ #define VERSION "1.0" /* Version number of this program */ #define NONE 0 /* Default values for use in userxxx routines */ #define REQUEST 1 #define HIDDEN 2 #define EXACT 4 #define FULL_LINE 1 #define DASHED 2 #define DOTTED 4 #define false 0 #define true 1 /* Keywords and messages */ #define KEY_INSET tofchar("INSET=") #define MES_INSET tofchar("Give set name and operation axis (& range):") #define KEY_BOX tofchar("BOX=") #define KEY_OPTION tofchar("OPTION=") #define MES_OPTION tofchar("Give option(s): 0/1/2 [list options]") #define KEY_TOLERANCE tofchar("TOLERANCE=") #define MES_TOLERANCE tofchar("Tolerance for least-squares fit: [0.01]") #define KEY_LAB tofchar("LAB=") #define MES_LAB tofchar("Value for mixing parameter: [0.001]") #define KEY_MAXITS tofchar("MAXITS=") #define MES_MAXITS tofchar("Maximum number of iterations in fit: [50]") #define KEY_ESTRMS tofchar("ESTRMS=") #define MES_ESTRMS tofchar("Give rms noise level for estimate routine: [0.0]") #define KEY_FITRMS tofchar("RMS=") #define KEY_CUTAMP tofchar("ESTCUTAMP=") #define MES_CUTAMP tofchar("Give cutoff for profile") #define KEY_CUTDISP tofchar("ESTCUTDISP=") #define KEY_Q tofchar("Q=") #define MES_Q tofchar("Give smoothing parameter: [2]") #define KEY_NGAUSS tofchar("NGAUSS=") #define MES_NGAUSS tofchar("Give max. number of gaussians in profile: [1]") #define KEY_PROFILE tofchar("PROFILE=") #define MES_PROFILE tofchar("(Q)uit, (S)ame, (P)revious, (B)ox, [N]ext profile" ) #define KEY_CENTVAL tofchar("CENTVAL=") #define KEY_SUBDIV tofchar("SUBDIV=") #define MES_SUBDIV tofchar("View surface subdivisions x,y: [1,1]") #define KEY_XMINMAX tofchar("XMINMAX=") #define MES_XMINMAX tofchar("Give Xmin, Xmax in plot: [calculated]" ) #define KEY_YMINMAX tofchar("YMINMAX=") #define MES_YMINMAX tofchar("Give Ymin, Ymax in plot: [calculated]" ) #define KEY_EDGEFIT tofchar("EDGEFIT=") #define MES_EDGEFIT tofchar("Do you want an 'edge' fit? Y/[N]") /* Initialize string with macro */ #define fmake(fchr,size) { \ static char buff[size+1]; \ int i; \ for (i = 0; i < size; buff[i++] = ' '); \ buff[i] = 0; \ fchr.a = buff; \ fchr.l = size; \ } /* Malloc version of 'fmake' */ #define finit( fc , len ) { fc.a = malloc( ( len + 1 ) * sizeof( char ) ) ; \ fc.a[ len ] = '\0' ; \ fc.l = len ; } #define MYMAX(a,b) ((a) > (b) ? (a) : (b)) #define MYMIN(a,b) ((a) > (b) ? (b) : (a)) /* Input of set, subsets: */ static fchar Fsetin; /* Name of the set */ static fint Fsubin[SUBSMAX]; /* Array for the subset coordinate words */ static fint FnsubsI; /* Number of input subsets */ static fint dfault; /* Default option for input etc */ static fint Faxnum[AXESMAX]; /* GDSINP axis numbers array */ static fint Faxcount[AXESMAX]; /* GDSINP axis lengths array */ static fint Fclass = 2; /* Axis is operation axis */ static fint Fsetdim; /* Dimension of the set */ static fint Fsubdim; /* Dimension of the subset */ static fint Fscrnum = 11; /* Destination of log output */ static fint Fmaxaxes = AXESMAX; /* Convert parameters to variables */ static fint Fmaxsubs = SUBSMAX; static int subnr; /* Index of current subset */ static int i,m; /* Counters */ static fint Fsetlevel = 0; /* Indicate set level */ static fint Faxesoutsidesub; /* Allow for one 'profile' axis */ /* Input of area etc.:*/ static fint Fcwlo[SUBSMAX]; /* Coordinate words */ static fint Fcwhi[SUBSMAX]; static fint FgridLO[AXESMAX]; /* Coordinate words for frame */ static fint FgridHI[AXESMAX]; static fint BgridLO[AXESMAX]; /* Coordinate words for box */ static fint BgridHI[AXESMAX]; static fint Fboxopt; /* Input option for 'gdsbox' */ /* Data transfer: */ static fint Ftotpixels; /* Total number of pixels in input */ static fint Fpixelsdone; static fint FtidIN[SUBSMAX]; /* Transfer id. */ static float imageIN[MAXBUF]; /* Multiple buffer for all subsets */ /* Related to update of header etc: */ static fchar Faxunits; /* Units along profile axis */ static fchar Fdataunits; /* Units of data in the set */ /* 'lsqfit' related */ static float tol; /* Tolerance in 'lsq' fit */ static float lab; /* Mixing parameter, see description */ static float xdat[SUBSMAX]; /* Data to be fitted */ static float wdat[SUBSMAX]; /* Weights in fit */ static fint its; /* Max. allowed number of iterations */ static fint mpar[MAXPARALL]; /* Fit parameters free or fixed (0/1)? */ static float estimates[MAXPARALL]; /* 0=Ampl, 1=central offset, 2=sigma */ static float edge_estimates[MAXPAR];/* Same for 'edge' fitting */ static float storeparms[MAXPARALL]; static float epar[MAXPARALL]; /* Errors in fitted parameters */ static fint xdim; /* Dimension of fit data (=1) */ static fint npar; /* Number of parameters in lsqfit: n*MAXPAR */ static fint iters; /* Counter */ /* 'gauest' related */ static float amplitudes[SUBSMAX]; /* Max. # points is 'SUBSMAX' */ static float workdummy[SUBSMAX]; /* Gauest routine needs workspace */ static float critampl; static float critdisp; static float profilerms; static fint Fsmoothpar; static fint Fmaxparameters; static fint Fgaussians; /* # Gaussians found in 'gauest' */ static fint Fgaussians_edge; /* # Gaussians found in 'edge' lsqfit */ static fint Fmaxgaussians; /* Max. # of Gaussians you allow to find */ /* Edge fitting related */ static float vcent_user; /* Miscellaneous: */ static fint Fprofiles; /* Number of profiles */ static int num_blanks; /* # blanks in profile */ static fint Fr1, Fr2; /* Results of userxxx routines */ static float blank; /* Value of system blank */ static char longbuf[2*BIGSTORE]; /* Buffer for long text message */ static char positionstr[BIGSTORE]; /* Text buffer for current position */ static fint Fmaxtoread; /* Max num pixels in 1 read action */ static int offset; /* Offset in input buffer */ static float physcoord[SUBSMAX]; /* Array with converted profile coordinates */ static int sameprof; /* User wants to examine same profile again */ static int nofit; /* No lsq fit possible */ static int edgefit; /* lsq 'edge' fit */ static int newbox; /* User wants other profile(s) */ static int changed; /* One of the keywords changed a value */ static int quitprogram; static float gridspac; /* Average grid spacing for dispersion conversion */ static float Xplot[PLOTPOINTS]; /* Draw Gaussian with 'PLOTPOINTS' points */ static float Yplot[PLOTPOINTS]; static fint Fnpoints; /* Variable with value 'PLOTPOINTS' */ static fint Ferrlev; /* Level for use in 'error' routine */ static fchar Fdummystr; static fint modvec[AXESMAX]; /* Number of pixels in each dim, 1,2,... */ static fint curvec[AXESMAX]; /* subdim dim. equivalent of 1 dim. pos */ static int curpos; /* Current 1-dim position */ static int first; /* First plot */ static fchar Fcontinue; static fint Fcolor; /* 'pgplot' related */ static fint Fstyle; /* Line style attribute, sect. 5.4 PGPLOT */ static float Xmin, Xmax, Ymin, Ymax; static fint Fsymbol; /* Graph Marker, see sect. 4.4 PGPLOT */ /* Conversion float <--> double. */ static float fltmax; /* maximum floating-point number */ static float flteps; /* smallest number x such that 1.0+x != 1.0 */ static double dfltmax; /* 'fltmax' converted to double */ static double maxarg; /* Max. arg for exp function so that */ /* result > -dfltmax. */ static double exparg[MAXGAUSS]; /* Store part of function calculation */ static void errorC( int level, char *str ) /*------------------------------------------------------------------*/ /* The C version of 'error'. */ /*------------------------------------------------------------------*/ { fint flev = (fint) level; error_c( &flev, tofchar( str ) ); } static void initplot( void ) /*------------------------------------------------------------------------------ * Description: Initialize plot software. Set viewport and output dimensions. * If output device is a printer, ask user for linewidth. *------------------------------------------------------------------------------ */ { fint Funit; /* Ignored by 'pgbeg', use 0 */ fchar Ffile; /* Device specification */ fint Fnxysub[2]; /* Number of subdivisions */ float width; /* Width of output on paper */ float aspect; /* Aspect ratio of output on paper */ float uservals[2]; /* Array version of above */ fint nitems; /* Use in userxxx routines */ fint dfault; /* Use in userxxx routines */ fint Fr1; /* Return value or level */ fint len; /* Length of a string */ fint Flinewidth; /* Width of lines on output device */ fchar devtype; /* Device specified in 'pgbeg' */ fint agreed; /* Loop guard */ fint Foff; Funit = 0; /* Ignored by 'pgbeg' */ fmake( Ffile, 10 ); Ffile = tofchar( "?" ); /* 'pgbeg' will prompt the user to supply a string. */ Fnxysub[0] = 1; /* Default no subdivisions in plot */ Fnxysub[1] = 1; nitems = 2; dfault = HIDDEN; Fr1 = userint_c( Fnxysub, &nitems, &dfault, KEY_SUBDIV, MES_SUBDIV ); /* Set window and viewport */ Fr1 = pgbeg_c( &Funit, Ffile, &Fnxysub[0], &Fnxysub[1] ); if (Fr1 != 1) errorC( 4, "Cannot open output device" ); /* No NEXTPAGE= keyword */ Foff = tobool( 0 ); pgask_c( &Foff ); /* Change size of the view surface to a specified width */ /* and aspect ratio (=height/width) */ nitems = 2; dfault = HIDDEN; uservals[0] = 0.0; uservals[1] = 1.0; Fr1 = userreal_c( uservals, &nitems, &dfault, tofchar("PAPER="), tofchar("Give width(cm), aspect ratio: [0.0,1.0]") ); if (Fr1 > 0) { /* If width = 0.0 then the program will select the largest */ /* view surface */ width = uservals[0]; /* Convert from cm to inches */ width /= 2.54; aspect = uservals[1]; pgpap_c( &width, &aspect ); } /* Get device-type code name of the current PGPLOT device */ /* If the destination is a printer (=every destination) */ /* except the Tektronix device), use thick lines in the plot */ len = 20; finit(devtype, len); pgqinf_c( tofchar("TYPE"), devtype, &len ); if (strncmp(devtype.a, "TEK4010", 6) == 0) { /* It is a Tektronix */ } else { nitems = 1; dfault = HIDDEN; do { Flinewidth = 2; Fr1 = userint_c( &Flinewidth, &nitems, &dfault, tofchar("LINEWIDTH="), tofchar("Give line width (1-21): [2]") ); agreed = ((Flinewidth >= 1) && (Flinewidth <= 21)); if (!agreed) { reject_c( tofchar("LINEWIDTH="), tofchar("Invalid number") ); } } while (!agreed); pgslw_c( &Flinewidth ); } { /* Set viewport */ static float Xl, Xr, Yb, Yt; Xl = 0.2; Xr = 0.95; Yb = 0.1; Yt = 0.9; pgsvp_c(&Xl, &Xr, &Yb, &Yt); } } static void drawbox( float Xmin, float Xmax, float Ymin, float Ymax, char *toplabel ) /*------------------------------------------------------------------------------ * Description: Draw box and labels etc. *------------------------------------------------------------------------------ */ { float charsize; float Xtick, Ytick; /* Tick values for plot box */ fint Fnxsub, Fnysub; /* Subintervals of major coordinate interval */ float delta; fchar FXlabel, FYlabel, FTOPlabel; char buf1[BIGSTORE]; /* Text buffers */ char buf2[BIGSTORE]; float Xminmax[2], Yminmax[2]; fint dfault; fint nitems; fint color; fint Ffont; /* Black color */ color = 1; pgsci_c( &color ); charsize = 1.0; pgsch_c( &charsize ); pgpage_c(); delta = fabs( Xmax - Xmin ) / 10.0; Xmin -= delta; Xmax += delta; delta = fabs( Ymax - Ymin ) / 10.0; Ymin -= delta; Ymax += delta; Xminmax[0] = Xmin; Xminmax[1] = Xmax; nitems = 2; dfault = HIDDEN; Fr1 = userreal_c( Xminmax, &nitems, &dfault, KEY_XMINMAX, MES_XMINMAX ); Xmin = Xminmax[0]; Xmax = Xminmax[1]; Yminmax[0] = Ymin; Yminmax[1] = Ymax; Fr1 = userreal_c( Yminmax, &nitems, &dfault, KEY_YMINMAX, MES_YMINMAX ); Ymin = Yminmax[0]; Ymax = Yminmax[1]; pgswin_c( &Xmin, &Xmax, &Ymin, &Ymax ); Xtick = 0.0; Ytick = 0.0; /* nx/nysub = the number of subintervals to divide the major coordinate interval into. If xtick=0.0 or nxsub=0, the number is chosen by PGBOX. */ Ffont = 1; /* Normal font */ pgscf_c( &Ffont ); Fnxsub = 0; Fnysub = 0; pgbox_c( tofchar("BCNST"), &Xtick, &Fnxsub, tofchar("BCNSTV"), &Ytick, &Fnysub ); fmake( FXlabel, BIGSTORE ); fmake( FYlabel, BIGSTORE ); fmake( FTOPlabel, BIGSTORE ); sprintf( buf1, "Amplitude (%.*s)", nelc_c(Fdataunits), Fdataunits.a ); FYlabel = tofchar( buf1 ); sprintf( buf2, "(%.*s)", nelc_c(Faxunits), Faxunits.a ); FXlabel = tofchar( buf2 ); FTOPlabel = tofchar( toplabel ); /* Select roman font for the labels */ Ffont = 2; /* Roman font */ pgscf_c( &Ffont ); pglab_c( FXlabel, FYlabel, FTOPlabel ); } #ifdef ERRORMESS static void errormess( int result ) /* *------------------------------------------------------------------------------ * Error message for 'lsqfit' *------------------------------------------------------------------------------ */ { if (result == -1) anyoutf( 1, "Too many free parameters, maximum is 32." ); if (result == -2) anyoutf( 1, "No free parameters." ); if (result == -3) anyoutf( 1, "Not enough degrees of freedom." ); if (result == -4) { anyoutC( "Maximum number of iterations too small to ..." ); anyoutC( "... obtain a solution which satisfies TOL." ); } if (result == -5) anyoutf( 1, "Diagonal of matrix contains elements which are zero." ); if (result == -6) anyoutf( 1, "Determinant of the coefficient matrix is zero." ); if (result == -7) anyoutf( 1, "Square root of negative number." ); } #endif extern float func_c( float *xdat, float *fpar, fint *npar, fint *fopt ) /*------------------------------------------------------------*/ /* PURPOSE: Fit routine needs evaluation of 1-dim gauss func- */ /* tion on arbitrary position. */ /* Fi(x) = Ai * exp( -1/2 * (Ci - x)^2 / Di^2 ) */ /* (zero level == 0.0) */ /* ==> F(x) = SUM[ Fi(x) ] and fopt determines how */ /* many gaussians there are to sum. */ /* A = fpar[0], C = fpar[1], D = fpar[2]; */ /*------------------------------------------------------------*/ { int i; double amp, cen, dis; double arg; double result = 0.0;; for (i = 0; i < (*fopt); i++) { int offset = i * 3; amp = (double) fpar[ offset]; cen = (double) ( fpar[1+offset] - xdat[0] ); dis = (double) fpar[2+offset]; if (dis < 0.0) fpar[2+offset] = fabs(fpar[2+offset]); arg = 0.5 * cen*cen/dis/dis; if (dis != 0.0 && arg < maxarg) exparg[i] = exp( -arg ); else exparg[i] = 0.0; result += amp * exparg[i]; } if (result < -dfltmax) return( -fltmax ); if (result > dfltmax) return( fltmax ); return( (float) result ); } extern void derv_c( float *xdat, float *fpar, float *epar, fint *npar, fint *fopt ) /*------------------------------------------------------------*/ /* PURPOSE: Fit routine needs evaluation of derivative of */ /* 1-dim gauss function on arbitrary position. */ /* Fi(x) = Ai * exp( -1/2 * (Ci - x)^2 / Di^2 ) */ /* (zero level == 0.0) */ /* A = fpar[0], C = fpar[1], D = fpar[2]; */ /* Note that the function includes an ABS! Negative disper- */ /* sions can enter the expression. */ /*------------------------------------------------------------*/ { double amp, cen, dis; double ep0, ep1, ep2; int i; for (i = 0; i < (*fopt); i++) { int offset = i * 3; amp = fpar[ offset]; cen = fpar[1+offset] - xdat[0]; dis = fpar[2+offset]; /*--------------------------------------------------*/ /* Global variable 'exparg' is storage for the */ /* expression exp(-0.5 * cen*cen/dis/dis) calculated*/ /* in 'func'. It is also a check on dis == 0.0 and */ /* arg < maxarg. */ /*--------------------------------------------------*/ if (exparg[i] != 0.0) { ep0 = exparg[i]; epar[ offset] = (float) ep0; ep1 = -amp * ep0 * cen/dis/dis; if (ep1 > dfltmax) epar[1+offset] = fltmax; else if (ep0 < -dfltmax) epar[1+offset] = -fltmax; else epar[1+offset] = (float) ep1; ep2 = -ep1 * cen/dis; if (ep2 > dfltmax) epar[2+offset] = fltmax; else if (ep0 < -dfltmax) epar[2+offset] = -fltmax; else epar[2+offset] = (float) ep2; } else epar[offset] = epar[1+offset] = epar[2+offset] = 0.0; } } static double getphyscoord( fchar Fsetname, fint cowosubset, int subnr ) /* *------------------------------------------------------------------------------ * This function return the physical coordinate of a grid position on * the operation axis. *------------------------------------------------------------------------------ */ { fint Fdirect = 1; /* grid coord. -> physical coord. */ double coordin[AXESMAX]; /* grids before cotrans */ double coordout[AXESMAX]; /* Phys. coords after cotrans */ fint Fres; int n; double zero = 0.0; /* Preset array to zero */ fint Fsetlevel = 0; fint r1; Fsetdim = gdsc_ndims_c( Fsetin, &Fsetlevel ); presetd_c( &zero, coordin, &Fsetdim ); n = (int) Fsetdim - 1; /* Axnum = 1, 2, ... */ r1 = 0; coordin[(int) Faxnum[n]-1] = (double) gdsc_grid_c( Fsetin, &Faxnum[n], &cowosubset, &r1 ); Fres = cotrans_c( Fsetin, &cowosubset, coordin, coordout, &Fdirect ); if ((int) Fres != 0) { if (subnr == 0) { anyoutf( 1, "Cannot find physical coordinates!" ); anyoutf( 1, "Substituting subset numbers." ); } coordout[(int) Faxnum[n]-1] = (double) subnr + 1; } return ( coordout[(int) Faxnum[n] - 1] ); } static float tophys( float *physcoord, float pixelval ) /* *------------------------------------------------------------------------------ * Pixels along the subset axis are numbered from 0 to n. Given a pixel- * value, we interpolate to get the physical value. *------------------------------------------------------------------------------ */ { int intval; float delt, physdelt; intval = (int) fabs(pixelval); if (intval < 0) intval = 0; if (intval > (int) FnsubsI-1) intval = (int) FnsubsI - 2; delt = pixelval - (float) intval; physdelt = physcoord[intval+1] - physcoord[intval]; return( physcoord[intval] + delt * physdelt ); } static void getparms( fint *AFmaxgaussians, float *Aprofilerms, float *Acritampl, float *Acritdisp, fint *AFsmoothpar, float *Atol, float *Alab, fint *Amaxits, float *Avcent, int first, int *Aedgefit, int *Achanged) /* *------------------------------------------------------------------------------ * Get keywords. If keywords are asked once, they will be hidden later. *'Faxunits' and 'Fdataunits' are global. *------------------------------------------------------------------------------ */ { fint nitems; fint dfault; fint Fr1; fint agreed; char messbuf[2*BIGSTORE]; /* Buffer for text message */ fint Fmaxgaussians; float profilerms; float critampl; float critdisp; fint Fsmoothpar; float tol; float lab; float vcent; int changed; fint maxits; /* Save previous values. Static is essential here */ static fint OFmaxgaussians; static float Oprofilerms; static float Ocritampl; static float Ocritdisp; static fint OFsmoothpar; static float Otol; static float Olab; static float Ovcent; static fint Omaxits; if (first) { changed = true; dfault = REQUEST; } else { changed = false; dfault = HIDDEN; } nitems = 1; Fmaxgaussians = 1; do { Fr1 = userint_c( &Fmaxgaussians, &nitems, &dfault, KEY_NGAUSS, MES_NGAUSS ); agreed = ( (Fmaxgaussians > 0) && (Fmaxgaussians < MAXGAUSS) ); if (!agreed) reject_c( KEY_NGAUSS, tofchar("Not allowed!") ); } while (!agreed); if ( (!first) && (Fmaxgaussians != OFmaxgaussians) ) changed = true; *AFmaxgaussians = Fmaxgaussians; /* *---------------------------------------------------------------------------- * ('gauest') The r.m.s. noise level of the profile. *---------------------------------------------------------------------------- */ if (first) { changed = true; dfault = NONE; } else { changed = false; dfault = HIDDEN; } nitems = 1; (void) sprintf( messbuf, "Give rms noise for estimate routine (in %.*s):", nelc_c(Fdataunits), Fdataunits.a ); Fr1 = userreal_c( &profilerms, &nitems, &dfault, KEY_ESTRMS, tofchar(messbuf) ); if ( (!first) && (profilerms != Oprofilerms) ) changed = true; *Aprofilerms = profilerms; /* *---------------------------------------------------------------------------- * ('gauest') Critical amplitude of gaussian. Gaussians below this * amplitude will be discarded. *---------------------------------------------------------------------------- */ if (first) dfault = REQUEST; else dfault = HIDDEN; nitems = 1; critampl = 0.0; (void) sprintf( messbuf, "Give crit. amplitude in %.*s: [%g]", nelc_c(Fdataunits), Fdataunits.a, critampl ); Fr1 = userreal_c( &critampl, &nitems, &dfault, KEY_CUTAMP, tofchar(messbuf) ); if ( (!first) && (critampl != Ocritampl) ) changed = true; *Acritampl = critampl; /* *---------------------------------------------------------------------------- * ('gauest') Critical dispersion of gaussian. Gaussians with dispersion * below this will be discarded. Use axis units for message. *---------------------------------------------------------------------------- */ if (first) dfault = REQUEST; else dfault = HIDDEN; nitems = 1; critdisp = 0.0; (void) sprintf( messbuf, "Give crit. dispersion in %.*s: [%g]", nelc_c(Faxunits), Faxunits.a, critdisp ); Fr1 = userreal_c( &critdisp, &nitems, &dfault, KEY_CUTDISP, tofchar(messbuf) ); if ( (!first) && (critdisp != Ocritdisp) ) changed = true; /* Convert dispersion from physical value to grids */ *Acritdisp = critdisp / gridspac; /* *---------------------------------------------------------------------------- * ('gauest') Smoothing parameter for calculating initial estimates * Q= determines the number of points (=2*Q+1) used in calculating the * second derivative of the profile. *---------------------------------------------------------------------------- */ if (first) dfault = REQUEST; else dfault = HIDDEN; nitems = 1; Fsmoothpar = 2; do { Fr1 = userint_c( &Fsmoothpar, &nitems, &dfault, KEY_Q, MES_Q ); agreed = ( (Fsmoothpar >= 1) || ((2*Fsmoothpar+1) <= FnsubsI) ); if (!agreed) reject_c( KEY_Q, tofchar("Not allowed!") ); } while (!agreed); if ( (!first) && (Fsmoothpar != OFsmoothpar) ) changed = true; *AFsmoothpar = Fsmoothpar; /* *---------------------------------------------------------------------------- * ('lsqfit') Fitting of the profile stops when successive iterations fail * to produce a decrement in reduced chi-squared less than TOLERANCE. If * its value is less than the minimum tolerance possible, it will be set * to this value. This means that maximum accuracy can be obtained by * setting TOLERANCE=0.0. *---------------------------------------------------------------------------- */ tol = 0.01; dfault = REQUEST; nitems = 1; Fr1 = userreal_c( &tol, &nitems, &dfault, KEY_TOLERANCE, MES_TOLERANCE ); if ( (!first) && (tol != Otol) ) changed = true; tol = fabs( tol ); *Atol = tol; /* *---------------------------------------------------------------------------- * Mixing parameter in 'lsqfit' , 'lab' determines the initial weight of * steepest descent method relative to the Taylor method. 'lab' should be * a small value (i.e. 0.01). 'lab' can only be zero when the partial * derivatives are independent of the parameters. In fact in this case * 'lab' should be exactly equal to zero. *---------------------------------------------------------------------------- */ lab = 0.001; dfault = REQUEST; nitems = 1; Fr1 = userreal_c( &lab, &nitems, &dfault, KEY_LAB, MES_LAB ); if ( (!first) && (lab != Olab) ) changed = true; lab = fabs( lab ); *Alab = lab; maxits = 50; dfault = REQUEST; nitems = 1; Fr1 = userint_c( &maxits, &nitems, &dfault, KEY_MAXITS, MES_MAXITS ); if ( (!first) && (maxits != Omaxits) ) changed = true; maxits = fabs( maxits ); *Amaxits = maxits; /* For the edge fitting we need a central value (usually the central */ /* velocity). If the position of the peak has a value greater than */ /* the initial estimate, all lower values are taken into account in */ /* lsqfit etc. */ vcent = physcoord[ (int) FnsubsI/2 ]; if (first) { (void) sprintf( messbuf, "Central val. for edge fit in %.*s: [%f]", nelc_c(Faxunits), Faxunits.a, vcent ); dfault = REQUEST; } else { dfault = HIDDEN; strcpy( messbuf, " " ); } nitems = 1; Fr1 = userreal_c( &vcent, &nitems, &dfault, KEY_CENTVAL, tofchar(messbuf) ); if ( (!first) && (vcent != Ovcent) ) changed = true; *Avcent = vcent; { bool edge; edge = toflog( false ); dfault = HIDDEN; nitems = 1; Fr1 = userlog_c( &edge, &nitems, &dfault, KEY_EDGEFIT, MES_EDGEFIT ); edge = tobool( edge ); *Aedgefit = edge; } /* Store values */ OFmaxgaussians = Fmaxgaussians; Oprofilerms = profilerms; Ocritampl = critampl; Ocritdisp = critdisp; OFsmoothpar = Fsmoothpar; Otol = tol; Olab = lab; Omaxits = maxits; Ovcent = vcent; *Achanged = changed; } static void findaxnames( char *axnames ) /* *------------------------------------------------------------------------------ * Find names of axes in format (RA,DEC) etc. *------------------------------------------------------------------------------ */ { int n; char axis_b[20+1]; fchar Fctype; fint Ferr = 0; char dummystr[BIGSTORE]; (void) sprintf( axnames, "%c", '(' ); for (n = 0; n < Fsubdim; n++ ) { Fctype.a = axis_b; Fctype.l = 20; axis_b[20] = '\0'; gdsc_name_c( Fctype, Fsetin, &Faxnum[n], &Ferr ); if (( n + 1 ) == Fsubdim) { /* Space and hyphen! */ (void) sprintf( dummystr, "%s", strtok( axis_b, " -" ) ); } else { /* Comma added */ (void) sprintf( dummystr, "%s,", strtok( axis_b, " -" ) ); } (void) sprintf( axnames, "%.*s%s", strlen(axnames), axnames, dummystr ); } (void) sprintf( axnames, "%.*s%c", strlen(axnames), axnames, ')' ); } static void putinlogfile( fint Fgaussians, char *positionstr, float *estparms, float *fitparms, float *edgeparms, int nofit, int edgefit, int first ) /* *------------------------------------------------------------------------------ * 'Faxunits', Fdataunits', 'physcoord' and 'gridspac' are global. *------------------------------------------------------------------------------ */ { int j; char messbuf[200]; char messbuf2[200]; char axnames[40]; /* ESTIMATE FIT gauss ampl. centre disp. ampl. centre disp. position =============================================================================== 12345__-1234.56_-1234.56_-1234.56_____-1234.56_-1234.56_-1234.56___(...,...) ________(w.u) (km/s) (km/s) (w.u) (km/s) (km/s) ________123456___123456___123456_______123456___123456___123456___ */ if (first) /* Create log-file header */ { anyoutf( 3, " " ); anyoutf( 3, "GAUPROF: ESTIMATE FIT EDGE FIT"); anyoutf( 3, "=========================================================================================================================="); anyoutf( 3, "gauss ampl. centre disp. ampl. centre disp. apml. centre disp. position"); findaxnames( axnames ); anyoutf( 3, " %-9.9s%-9.9s%-9.9s %-9.9s%-9.9s%-9.9s %-9.9s%-9.9s%-9.9s %-s", Fdataunits.a, Faxunits.a, Faxunits.a, Fdataunits.a, Faxunits.a, Faxunits.a, Fdataunits.a, Faxunits.a, Faxunits.a, axnames ); anyoutf( 3, "=========================================================================================================================="); } if (Fgaussians == 0) { anyoutf( 3, " * * * * * * * * * * %-s", positionstr ); } for (j = 0; j < (int) Fgaussians; j++) { int offset = j * MAXPAR; if (nofit) { (void) sprintf( messbuf, "%6d %8.2f %8.2f %8.2f * * * ", j+1, estparms[0+offset], tophys( physcoord, estparms[1+offset] ), estparms[2+offset] * gridspac ); } else { (void) sprintf( messbuf, "%6d %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f", j+1, estparms[0+offset], tophys( physcoord, estparms[1+offset] ), estparms[2+offset] * gridspac, fitparms[0+offset], tophys( physcoord, fitparms[1+offset] ), fitparms[2+offset] * gridspac ); } if (!edgefit) { (void) sprintf( messbuf2, "%.67s * * * %-s", messbuf, positionstr ); } else { (void) sprintf( messbuf2, "%.67s %8.2f %8.2f %8.2f %-s", messbuf, edgeparms[0], tophys( physcoord, edgeparms[1] ), edgeparms[2] * gridspac, positionstr ); } anyoutf( 3, messbuf2 ); } } #ifdef GETRMS static float getrms( float *amplitudes, int n ) /*----------------------------------------------*/ /* Get rms of a profile */ /*----------------------------------------------*/ { int i; float sum, sumdev; float average; for (i = 0, sum = 0.0; i < n; i++) { if (amplitudes[i] != blank) sum += amplitudes[i]; } average = sum / n; for (i = 0, sumdev = 0.0; i < n; i++) { if (amplitudes[i] != blank) { float dev; dev = amplitudes[i] - average; dev *= dev; sumdev += dev; } } return( (float) sqrt( sumdev/n ) ); } #endif static void getboxmessage( fchar Setin, fint subset, fint *axnum, char *boxtxt ) /*------------------------------------------------------------*/ /* PURPOSE: Create a text that can be used in the box prompt. */ /* Get axis names of the input subset. Note that the set input*/ /* was a class 2 input. */ /*------------------------------------------------------------*/ { fint subdim; int n; subdim = gdsc_ndims_c( Setin, &subset ); strcpy( boxtxt, "Enter profile position(s) in " ); for (n = 0; n < subdim; n++) { fint r1 = 0; fchar Axisname; fmake( Axisname, 20 ); gdsc_name_c( Axisname, Setin, &axnum[n], &r1 ); strcat( boxtxt, strtok(Axisname.a, " -") ); if (n != subdim - 1) strcat( boxtxt, "," ); } strcat( boxtxt, ": [quit]" ); } MAIN_PROGRAM_ENTRY /*------------------------------------------------------------*/ /* Because Fortran passes all arguments by reference, all C */ /* functions with a Fortran equivalent must do this also */ /* (GIPSY programmers guide, * Chapter 9). */ /*------------------------------------------------------------*/ { char boxmes[80]; init_c(); /* contact Hermes */ /* Task identification */ { static fchar Ftask; /* Name of current task */ fmake( Ftask, 20 ); /* Macro 'fmake' must be available */ myname_c( Ftask ); /* Get task name */ Ftask.a[nelc_c(Ftask)] = '\0'; /* Terminate task name with null char. */ IDENTIFICATION( Ftask.a, VERSION ); /* Show task and version */ } /* Start the new version? */ { fint r; fint dfault = REQUEST; fint nitems = 1; bool new = toflog( 1 ); r = userlog_c( &new, &nitems, &dfault, tofchar("STARTNEW="), tofchar("Start improved version of this program? [Y]/N") ); new = tobool( new ); if (new) { anyoutf( 3, "GAUPROF started XGAUPROF" ); r = 0; deputy_c( tofchar("XGAUPROF") , &r ); /* Start new task */ finis_c(); /* Quit Hermes */ } } setfblank_c( &blank ); fmake(Fsetin, 80); fltmax = FLT_MAX; /* Defines are functions, so initialize */ flteps = FLT_EPSILON; dfltmax = (double) FLT_MAX; /* Cast function result to double */ maxarg = -log( (double) FLT_EPSILON ); /* Limit range in exp function */ dfault = NONE; Faxesoutsidesub = 1; Fscrnum = 0; Fclass = 2; FnsubsI = gdsinp_c( Fsetin, Fsubin, &Fmaxsubs, &dfault, KEY_INSET, MES_INSET, &Fscrnum, Faxnum, Faxcount, &Fmaxaxes, &Fclass, &Faxesoutsidesub ); Fsetdim = gdsc_ndims_c( Fsetin, &Fsetlevel ); Fsubdim = Fsetdim - Faxesoutsidesub; /* *---------------------------------------------------------------------------- * Determine the edges of this its frame (FgridLO/HI) *---------------------------------------------------------------------------- */ Fr1 = 0; gdsc_range_c( Fsetin, &Fsetlevel, &Fcwlo[0], &Fcwhi[0], &Fr1 ); for (m = 0; m < (int) Fsetdim; m++) { Fr1 = Fr2 = 0; FgridLO[m] = gdsc_grid_c( Fsetin, &Faxnum[m], &Fcwlo[0], &Fr1 ); FgridHI[m] = gdsc_grid_c( Fsetin, &Faxnum[m], &Fcwhi[0], &Fr2 ); } /* *---------------------------------------------------------------------------- * Get units of operation axis and data units. The axis units are determined * with the 'cotrans' routine (could be secundary axis units) and the data * units are read from the header. *---------------------------------------------------------------------------- */ { fint Fresult; fint n = Fsetdim - 1; fmake( Faxunits, BIGSTORE ); Fresult = axunit_c( Fsetin, &Faxnum[n], Faxunits ); if (Fresult == 1) errorC( 4, "A cotrans error occured!" ); else if (Fresult == 2) errorC( 4, "Axis not present in set!" ); else if (Fresult == 3) errorC( 4, "Output character string not large enough!" ); fmake( Fdataunits, BIGSTORE ); Fr1 = 0; gdsd_rchar_c( Fsetin, tofchar("BUNIT"), &Fsetlevel, Fdataunits, &Fr1 ); if (Fr1 < 0) { Fdataunits.l = sprintf( Fdataunits.a, "?" ); anyoutf( 1, "Cannot find data units in header" ); } } /* *---------------------------------------------------------------------------- * Other 'lsqfit' parameters *---------------------------------------------------------------------------- */ { int n; for (n = 0; n < (int) FnsubsI; n++) { xdat[n] = (float) n; /* X-coordinates are pixels */ wdat[n] = 1.0; /* No blanks ==> Weights=1 */ } xdim = 1; /* Dimension of fit */ for (n = 0; n < MAXPARALL; n++) mpar[n] = 1.0; /* All parameters are free */ } /* *---------------------------------------------------------------------------- * The input buffer stores data of a certain area sequentially of all * subsets. This data is read in a loop (over the number of input subsets). * If the total size of the buffer is 'MAXBUF', than in each read action a * maximum of MAXBUF/(nsubs) pixels can be stored. *---------------------------------------------------------------------------- */ Fmaxtoread = (fint) (MAXBUF / FnsubsI); /* *---------------------------------------------------------------------------- * Get physical values for operation axis. *---------------------------------------------------------------------------- */ status_c( tofchar("Calculating physical coordinates...") ); for(subnr = 0; subnr < (int) FnsubsI; subnr++) { /* For each grid on the operation axis, get physical value */ physcoord[subnr] = (float) getphyscoord( Fsetin, Fsubin[subnr], subnr ); /* sprintf(messbuf, "%d %f", subnr, physcoord[subnr]); anyoutf( 1, messbuf ); */ } /* Calculate average gridspacing. The dispersion will be converted */ /* from grids to physical values by multiplying with the gridspacing */ gridspac = fabs( physcoord[0] - physcoord[FnsubsI-1] ) / (float) FnsubsI; initplot(); /* Before entering the main loop, calculate min & max of phys. coords. */ minmax1_c( physcoord, &FnsubsI, &Xmin, &Xmax ); fmake( Fdummystr, BIGSTORE ); quitprogram = false; first = true; /* Check whether keywords are asked before */ getboxmessage( Fsetin, Fsubin[0], Faxnum, boxmes ); do { /* *---------------------------------------------------------------------------- * Prepare a box for INSET. Default is a box with length 1 in every * direction. The size default is in BHI, the 'box' option therefore is 4. * Carriage return stops the program. *---------------------------------------------------------------------------- */ dfault = REQUEST; Fr1 = usertext_c( Fdummystr, &dfault, KEY_BOX, tofchar(boxmes) ); if (Fr1 == 0) quitprogram = true; if (!quitprogram) { dfault = HIDDEN; Fboxopt = 4; /* Default lengths in BgridHI */ for (i = 0; i < (int) Fsubdim; i++) BgridHI[i] = 1; Fscrnum = 0; gdsbox_c( BgridLO, BgridHI, Fsetin, Fsubin, &dfault, KEY_BOX, tofchar(" "), &Fscrnum, &Fboxopt ); /* Count number of pixels in this substructure */ Ftotpixels = 1; for(m = 0; m < (int) Fsubdim; m++) { /* Number of pixels in box of one subset!! */ Ftotpixels *= (BgridHI[m] - BgridLO[m] + 1); } /* *---------------------------------------------------------------------------- * Calculate number of pixels of underlying substructures of 1, 2, ... * (subdim - 1) dimensions. Put these numbers in the vector 'modvec'. The * numbers are used in the function 'postovec' to convert a one dimensional * position to a 'subdim' dimensional position. *---------------------------------------------------------------------------- */ modvec[0] = 1; for (i = 1; i < Fsubdim; i++) modvec[i] = modvec[i-1] * (BgridHI[i-1] - BgridLO[i-1] + 1); /* *---------------------------------------------------------------------------- * Initialize coordinate words etc. and start calculating. *---------------------------------------------------------------------------- */ for(subnr = 0; subnr < (int) FnsubsI; subnr++) { /* Create coordinate words for the input subsets */ Fcwlo[subnr] = gdsc_fill_c( Fsetin, &Fsubin[subnr], BgridLO ); Fcwhi[subnr] = gdsc_fill_c( Fsetin, &Fsubin[subnr], BgridHI ); /* Reset tranfer id's */ FtidIN[subnr] = 0; } do { for (subnr = 0; subnr < (int) FnsubsI; subnr++) { offset = subnr * (int) Fmaxtoread; gdsi_read_c( Fsetin, &Fcwlo[subnr], /* Data from box! */ &Fcwhi[subnr], &imageIN[offset], &Fmaxtoread, &Fpixelsdone, &FtidIN[subnr] ); } /*------------------------------------------------------------ * Now we have 'Fpixelsdone' small sub buffers of length * 'FnsubsI'. The data is collected for each profile in the * array 'amplitudes' on which the calculations are done. *------------------------------------------------------------ */ Fprofiles = Fpixelsdone; i = 0; do /* For all profiles */ { do /* Repeat calculations same profile */ { num_blanks = 0; for (subnr = 0; subnr < (int) FnsubsI; subnr++) { /* collect data in new array */ offset = subnr * (int) Fmaxtoread; if (imageIN[offset+i] == blank) { num_blanks++; wdat[subnr] = 0.0; amplitudes[subnr] = imageIN[offset+i]; } else { wdat[subnr] = 1.0; amplitudes[subnr] = imageIN[offset+i]; } } getparms( &Fmaxgaussians, &profilerms, &critampl, &critdisp, &Fsmoothpar, &tol, &lab, &its, &vcent_user, first, &edgefit, &changed); { /* 'i' is the current one dim. position which has to be converted to a n-dim. vector */ int k; int j; curpos = i; for (k = Fsubdim - 1; k >= 0; k--) { j = curpos / modvec[k]; curvec[k] = BgridLO[k] + j; curpos -= j * modvec[k]; } strcpy( positionstr, "(" ); for (k = 0; k < Fsubdim ; k++) { if (k < (int) Fsubdim - 1) (void) sprintf( positionstr, "%s%d,", positionstr, curvec[k] ); else (void) sprintf( positionstr, "%s%d)", positionstr, curvec[k] ); } } Xmin = MYMIN( physcoord[0], physcoord[(int)FnsubsI-1] ); Xmax = MYMAX( physcoord[0], physcoord[(int)FnsubsI-1] ); minmax1_c( amplitudes, &FnsubsI, &Ymin, &Ymax ); { float x, y; char toplabel[256]; if (edgefit) (void) sprintf( toplabel, "Gaussian est. (dashed)," " fit (full line) &" " edge fit (dotted) at %s", positionstr ); else (void) sprintf( toplabel, "Gaussian est. (dashed)," " fit (full line) at %s", positionstr ); drawbox( Xmin, Xmax, Ymin, Ymax, toplabel ); Fcolor = 4; /* Blue */ pgsci_c( &Fcolor ); x = Xmin; y = 0.0; /* Base line */ pgmove_c( &x, &y ); x = Xmax; y = 0.0; pgdraw_c( &x, &y ); x = Xmin; y = critampl; /* Cutoff */ pgmove_c( &x, &y ); x = Xmax; y = critampl; pgdraw_c( &x, &y ); } Fsymbol = 3; Fcolor = 1; /* Default foreground */ pgsci_c( &Fcolor ); pgpt_c( &FnsubsI, physcoord, amplitudes, &Fsymbol ); if (num_blanks < FnsubsI-6) { /* For each gauss 3 parameters */ Fmaxparameters = MAXPAR * Fmaxgaussians; Fgaussians = gauest_c( amplitudes, workdummy, &FnsubsI, estimates, &Fmaxparameters, &profilerms, &critampl, &critdisp, &Fsmoothpar ); } else { Ferrlev = 4; error_c( &Ferrlev, tofchar("Profile contains too many blanks") ); } if (Fgaussians > Fmaxgaussians) Fgaussians = Fmaxgaussians; if (Fgaussians == 0) anyoutf( 1, "No estimates found!" ); npar = Fgaussians * MAXPAR; Fnpoints = PLOTPOINTS; { /* Store estimates: */ int j; for (j = 0; j < (int) Fgaussians; j++) { int offst = j * MAXPAR; storeparms[0+offst] = estimates[0+offst]; storeparms[1+offst] = estimates[1+offst]; storeparms[2+offst] = estimates[2+offst]; } } /* Create array with Gaussian values based on these esitmates */ { int j; float x; float delta; x = 0.0; /* 'x' is a non-integer index, to be converted to an integer */ /* in de function 'physcoord' */ delta = (float) (FnsubsI - 1) / (float) Fnpoints; for (j = 0; j < (int) Fnpoints; j++) { Xplot[j] = tophys( physcoord, x); Yplot[j] = func_c( &x, estimates, &npar, &Fgaussians ); /* sprintf(messbuf, "%d %f %f delta=%f", j, Xplot[j], Yplot[j], x); anyoutf( 1, messbuf ); */ x += delta; } } Fstyle = DASHED; pgsls_c( &Fstyle ); Fcolor = 2; /* Red */ pgsci_c( &Fcolor ); pgline_c( &Fnpoints, Xplot, Yplot ); iters = lsqfit_c( xdat, /* X-coordinates */ &xdim, /* Dimension of fit */ amplitudes, /* Y data */ wdat, /* Weights */ &FnsubsI, /* Number of data points */ estimates, /* Initial values */ epar, /* Error return values */ mpar, /* All parameters free */ &npar, /* Total number of parameters */ &tol, /* Tolerance */ &its, /* Max. num. of iterations */ &lab, /* Mixing parameter */ &Fgaussians ); /* Number of gaussians */ if (iters < 0) { nofit = true; /* errormess(iters); */ Fstyle = FULL_LINE; pgsls_c( &Fstyle );/* Reset line style */ } else { nofit = false; /* Create array with Gaussian values based on the fit */ { int j; float x; float delta; x = 0.0; delta = (float) (FnsubsI - 1) / (float) Fnpoints; for (j = 0; j < Fnpoints; j++) { Xplot[j] = tophys( physcoord, x); Yplot[j] = func_c( &x, estimates, &npar, &Fgaussians ); x += delta; } } Fstyle = FULL_LINE; pgsls_c( &Fstyle ); Fcolor = 3; /* Green */ pgsci_c( &Fcolor ); pgline_c( &Fnpoints, Xplot, Yplot ); } /* *----------------------------------------------------------- * Do the edge fitting. First examine if there is a gaussian * found in the estimates. If there is more than one, * determine which one has the greatest amplitude (estimate * index 0). Compare its central value (velocity) with * the value given in CENTVAL=. Select all data values * from this point to the edge, increasing the distance * to the position in CENTVAL= *----------------------------------------------------------- */ if ( Fgaussians > 0 && edgefit ) { float maxampl = storeparms[0]; float pos_on_profile = storeparms[1]; float dispers = storeparms[2]; int j; float xdat_edge[SUBSMAX]; float amplitudes_edge[SUBSMAX]; float physcoord_edge[SUBSMAX]; fint Fedgecount; /* Determine gauss with greatest amplitude */ for (j = 1; j < (int) Fgaussians; j++) { int offst = j * MAXPAR; if (storeparms[0+offst] > maxampl) { maxampl = storeparms[0+offst]; pos_on_profile = storeparms[1+offst]; dispers = storeparms[2+offst]; } } /* 'vcent_user' is in physical coordinates */ /* Convert position of max. ampl. to phys. coord. */ if (tophys(physcoord, pos_on_profile) > vcent_user) { Fedgecount = 0; for (j = 0; j < (int) FnsubsI; j++) { if (tophys(physcoord, xdat[j]) >= tophys(physcoord, pos_on_profile) ) { xdat_edge[Fedgecount] = xdat[j]; amplitudes_edge[Fedgecount] = amplitudes[j]; physcoord_edge[Fedgecount++] = tophys( physcoord, xdat[j]); } } } if (tophys(physcoord, pos_on_profile) <= vcent_user) { Fedgecount = 0; for (j = 0; j < (int) FnsubsI; j++) { if (tophys(physcoord, xdat[j]) <= tophys(physcoord, pos_on_profile) ) { xdat_edge[Fedgecount] = xdat[j]; amplitudes_edge[Fedgecount] = amplitudes[j]; physcoord_edge[Fedgecount++] = tophys( physcoord, xdat[j]); } } } /* At this point we have two new arrays with fit data */ /* and a set of initial estimates for one(!) Gaussian */ /* First plot these points, and make a lsqfit then. */ Fsymbol = 23; Fcolor = 4; /* Blue */ pgsci_c( &Fcolor ); pgpt_c( &Fedgecount, physcoord_edge, amplitudes_edge, &Fsymbol ); /* Estimates for lsq 'edge' fit */ edge_estimates[0] = maxampl; edge_estimates[1] = pos_on_profile; edge_estimates[2] = dispers; Fgaussians_edge = 1; npar = 3 * Fgaussians_edge; iters = lsqfit_c( xdat_edge, /* X-coordinates */ &xdim, /* Dimension of fit */ amplitudes_edge, /* Y data */ wdat, /* Weights */ &Fedgecount, /* Number of data points */ edge_estimates, /* Initial values */ epar, /* Error return values */ mpar, /* All parameters free */ &npar, /* Total number of parameters */ &tol, /* Tolerance */ &its, /* Max. num. of iterations */ &lab, /* Mixing parameter */ &Fgaussians_edge ); /* Number of gaussians */ if (iters < 0) { edgefit = false; /* errormess(iters); */ Fstyle = FULL_LINE; pgsls_c( &Fstyle ); /* Reset line style */ } else { edgefit = true; /* Create array with Gaussian values based on the fit */ { int j; float x; float delta; Fnpoints = PLOTPOINTS; x = 0.0; delta = (float) (FnsubsI - 1) / (float) Fnpoints; for (j = 0; j < Fnpoints; j++) { Xplot[j] = tophys( physcoord, x); Yplot[j] = func_c( &x, edge_estimates, &npar, &Fgaussians_edge ); x += delta; } } Fstyle = DOTTED; pgsls_c( &Fstyle ); Fcolor = 7; /* Yellow */ pgsci_c( &Fcolor ); pgline_c( &Fnpoints, Xplot, Yplot ); } /* Reset plot style */ Fstyle = FULL_LINE; pgsls_c( &Fstyle ); } putinlogfile( Fgaussians, positionstr, storeparms, estimates, edge_estimates, nofit, edgefit, first ); first = false; /* Keywords are hidden from now on */ /* Put status of keywords in log file if one or more */ /* changed value */ if (changed) { sprintf( longbuf, "ESTRMS=%-7.2f ESTCUTAMP=%-7.2f " "ESTCUTDISP=%-7.2f Q=%d NGAUSS=%d " "TOLERANCE=%-7.2f CENTVAL=%-7.2f", profilerms, critampl, critdisp*gridspac, (int) Fsmoothpar, (int) Fmaxgaussians, tol, vcent_user ); anyoutf( 3, longbuf ); } dfault = REQUEST; fmake( Fcontinue, BIGSTORE ); Fcontinue.a[0] = 'N'; cancel_c( KEY_PROFILE ); Fr1 = usertext_c( Fcontinue, &dfault, KEY_PROFILE, MES_PROFILE ); if ( (toupper(Fcontinue.a[0]) == 'A') || (toupper(Fcontinue.a[0]) == 'Q') ) { pgend_c(); finis_c(); /* Quit Hermes */ } sameprof = (toupper(Fcontinue.a[0]) == 'S'); newbox = (toupper(Fcontinue.a[0]) == 'B'); if (newbox) { sameprof = false; FtidIN[0] = 0; } } while (sameprof); if (toupper(Fcontinue.a[0]) == 'P') { /* user wants previous profile */ i--; if (i < 0) i = 0; } else i++; /* Go to next profile */ if (newbox) i = (int) Fprofiles; /* User wants new box */ } while ( i < (int) Fprofiles ); } while (FtidIN[0] != 0); /* All pixels examined? */ } cancel_c( KEY_BOX ); } while(!quitprogram); pgend_c(); finis_c(); /* Quit Hermes */ return( 0 ); }
4a85e12c8db917242c4cc66b1abeabd4778c0fdb
f815b6e5b8f5a06e007a818a832962104bc8591b
/practica2/ENTREGA/ejercicio6a.c
3971ee2988d2157e401ba0036c79bdc2f33aaba7
[]
no_license
mihaiblidaru/SOPER-17-18
574f88fa388afb15bc6ecdf754f12c9fe4e4962b
f2346de79a8350f54d9f5245499df02d0549811a
refs/heads/master
2021-03-24T14:08:03.322538
2018-04-23T10:41:16
2018-04-23T10:41:16
null
0
0
null
null
null
null
UTF-8
C
false
false
1,874
c
ejercicio6a.c
/** * Ejercicio 6a * Programa que crea un proceso hijo y establece una señal de alarma * mientras alterna el bloqueo y desbloqueo de la señal de alarma * * @file ejercicio6a.c * * @author Lucia Fuentes * @author Mihai Blidaru * @date 09/04/2018 * */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> #include <signal.h> #include <time.h> /** * Sirve como contador para el trabajo del proceso hijo */ #define NUM_PROC 5 /** * Tiempo de alarma */ #define NUM_SEC 40 /** * @brief Mensaje de impresión cuando un proceso recibe la señal de alarma */ void alarma(); /** * @brief Punto de entrada en el programa */ int main (void){ int pid, counter; sigset_t lock; //conjunto de señales a bloquear sigset_t unlock; //conjunto de señales para desbloquear sigset_t oset; //mascara antigua de señales bloqueadas sigemptyset(&lock); sigemptyset(&unlock); sigaddset(&lock, SIGUSR1); sigaddset(&lock, SIGUSR2); sigaddset(&lock, SIGALRM); sigaddset(&unlock, SIGALRM); sigaddset(&unlock, SIGUSR1); pid = fork(); if (pid == 0){ alarm(NUM_SEC+1); signal(SIGALRM, alarma); while(1){ printf ("Lock\n"); sigprocmask(SIG_BLOCK, &lock, &oset); for (counter = 0; counter < NUM_PROC; counter++){ printf("%d\n", counter+1); sleep(1); } printf ("Unblock\n"); sigprocmask(SIG_UNBLOCK, &unlock, &oset); printf("Espera +3\n"); sleep(3); } } while(wait(NULL) > 0); return EXIT_SUCCESS; } /** * @brief Mensaje de impresión cuando un proceso recibe la señal de alarma */ void alarma(){ printf("[%d]Recibo la señal de alarma\n", getpid()); }
db34df75c1d5e4f629c1543e371ae1dc5668c347
592468aac3005aa2fbbcc536e78fa14858a5962c
/central/inc/alarm_controler.h
c92fac3df5d69f54a7c64567b33c97e1f85547ae
[]
no_license
marcosgtavares/p2_FSE
946fa30ab68e57ca81aa319abbec02f19c1ff3de
77470f529eb4f9a07ee08218ec225315a960a983
refs/heads/main
2023-04-14T16:51:49.776237
2021-04-20T19:21:47
2021-04-20T19:21:47
358,351,328
0
0
null
null
null
null
UTF-8
C
false
false
185
h
alarm_controler.h
#ifndef ALARM_CONTROLER_H_ #define ALARM_CONTROLER_H_ void handle_change_s(char *sensor_state); void liga_desliga_alarme(); void *play_audio(); void set_interface(void *inter); #endif
eb929b06faadb489b9adedea42dc0f5a9b04ea6f
e1e87dc45cb7dec7bcc5a1658165a6f30be2dcc7
/fjson_literals.h
6780aa4f64d59ccf90fb2bca3d15783b8056fa6f
[ "MIT" ]
permissive
Finikssky/fjson
43139eb1a6ce583dd841989206ef21a56fd04366
1dc6912581435993ecc188a5746973276597f00d
refs/heads/master
2021-01-04T01:01:57.024605
2020-02-17T03:35:51
2020-02-17T03:35:51
240,314,458
0
0
null
null
null
null
UTF-8
C
false
false
520
h
fjson_literals.h
#ifndef __FJSON_LITERAL_H #define __FJSON_LITERAL_H #include <fjson_value.h> typedef enum { JSON_LITERAL_NULL, JSON_LITERAL_TRUE, JSON_LITERAL_FALSE } fjson_literal_type_t; typedef struct { fjson_value_t header; fjson_literal_type_t literal_type; } fjson_literal_t; fjson_literal_t *fjson_literal_create(fjson_literal_type_t literal_type); void fjson_literal_free(fjson_literal_t *literal); int fjson_literals_stringize(fjson_value_t *value, char *result, int wrap, int start_indent, int indent_step); #endif
e611726ebc3af79feff603a0736161f6b64e68f6
91317c6ce689b1c03dd329e93b23bb50ba6016e7
/src/algorithm/judge_num.c
e02a26953fc9425d2588b4569da24c1d808a8dd7
[]
no_license
loveadmire/Station
1a5ba6969da7fe1c97a0a3c610c051d467a26028
8ed11966201c85122d06bc3f6a055435a378bac8
refs/heads/master
2020-04-28T15:07:35.425596
2019-03-29T08:52:37
2019-03-29T08:52:37
175,352,220
1
0
null
null
null
null
UTF-8
C
false
false
602
c
judge_num.c
// // Created by root on 19-3-23. // #include "../../inc/algorithm/judge_num.h" #include <stdio.h> #include <math.h> int Judge_num_isOdd(int num){ if (num > 0) return num&1; else{ return -1; } } int Judge_num_isPrime(int num){ if (num <= 3){ return num >1; } if (num %6 != 1 && num %6 != 5){ return 0; } float ss = (float)sqrt(num); printf(" ss is %02f ",ss); int temp = (int)sqrtf(num); int i = 0; for(i = 5;i<= temp;i+=6){ if(num%i == 0 || num%(i+2) == 0){ return 0; } } return 1; }
d17c51cc3b75e41376eca787d8f65af27c0195df
410c5ec4d56e224d2937c7e72bba88782c8eb0a6
/RETROBT/BPRINTF.H
72b7b609ff5401fc7f7576d3fdbda9cefca942ff
[]
no_license
froller/RetroBoot
12c907957cee0d37130fd2b59c8123b534ce11ea
4f5ed9fd450e573380ad02ee159866f587dea52d
refs/heads/master
2022-12-24T22:25:53.778344
2022-12-11T15:57:27
2022-12-11T15:57:27
242,005,270
2
0
null
null
null
null
UTF-8
C
false
false
452
h
BPRINTF.H
#ifndef __BPRINTF_H #define __BPRINTF_H #ifndef ___DEFS_H #include <_defs.h> #endif // ___DEFS_H #ifdef __cplusplus extern "C" { #endif // __cplusplus void _Cdecl bprinta(const char *str, const unsigned char attr); void _Cdecl bprint(const char *str); int _Cdecl bprintaf(const char *fmt, const unsigned char attr, ...); int _Cdecl bprintf(const char *fmt, ...); #ifdef __cplusplus } #endif // __cplusplus #endif // __BPRINTF_H
96d4fee3a3f6579e4fc4a3be60e583c9ca6f9358
3713a3df1781c4bbe6560e632b80f05715aa8d4c
/client.c
8100bdc4c1876bd76156c28f2073ffdcc1741429
[]
no_license
rahamannaik/sysprog
e8b9ce074c72c8b9936914f1fd7e2b387b5f6695
50a8f441da538b03533cfe97dbf5d43d120617fa
refs/heads/master
2021-01-22T11:47:25.657558
2014-12-11T09:22:08
2014-12-11T09:22:08
null
0
0
null
null
null
null
UTF-8
C
false
false
7,631
c
client.c
#include "common.h" void *join_group(void *arg) { int *sockfd = (int *) (arg); printf("sock fd in thead is = %d\n", *sockfd); int n; char buffer[256]; message *ptr; int data_len, msg_len; memset(buffer,0,256); while(1) { unsigned int option; unsigned int grp_id; printf("select 1 to join a group\n"); printf("select 2 to send message to a group(Max 255 character long)\n"); printf("select 3 to leave a group\n"); printf("Enter the option: "); if(fgets(buffer,255,stdin)) { if(sscanf(buffer,"%d", &option) != 1) { printf("Please enter valid option : "); continue; } } else { continue; } switch(option) { case 1: case 3: enter_groupid: printf("Please enter the groupid : "); if(fgets(buffer,255,stdin)) { if(sscanf(buffer,"%d", &grp_id) == 1) { ptr = malloc(sizeof(message)); if(ptr == NULL) { perror("Error: not able to allocate memory"); exit(1); } if(option == 1) { ptr->msg_type = JOIN_GROUP; } else { ptr->msg_type = LEAVE_GROUP; } msg_len = sizeof(message); u_short g_id = (u_short)grp_id; ptr->group_id = htons(g_id); } else { printf("\nInvalid groupid\n"); goto enter_groupid; } } else continue; break; case 2: printf("Please enter the message: "); fgets(buffer,255,stdin); data_len = strlen(buffer); msg_len = sizeof(message) + data_len; ptr = malloc(sizeof(msg_len)); if(ptr == NULL) { perror("Error: not able to allocate memory"); exit(1); } ptr->msg_type = BROADCAST_MSG; ptr->data_len = htons(data_len); memcpy(ptr->data, buffer, data_len); break; default: printf("\ninvalid option\n"); continue; } if(sendall(*sockfd, (char *)ptr, msg_len) == -1) { perror("ERROR writing to socket"); exit(1); } free(ptr); } } u_int calculate_digits(u_int num) { u_int count = 0; while(num) { num=num/10; count++; } return count; } u_int find_max_number(int sockfd) { u_short data_len; if(recvall(sockfd, (char *)&data_len, sizeof(data_len)) < 0) { perror("ERROR reading from socket"); printf("%s:%d, Can't read from Socket : %d\n", __func__, __LINE__, sockfd); exit(1); } data_len = ntohs(data_len); printf("%s:%d, Data Len : %d\n", __func__, __LINE__, data_len); u_int data; u_int max = 0; data_len = data_len - sizeof(message); char *data_ptr = malloc(data_len); if(recvall(sockfd, data_ptr, data_len) < 0) { perror("ERROR reading from socket"); exit(1); } //printf("%s\n", data_ptr); u_int digits; u_int total_digit = 0; while(sscanf(data_ptr, "%d", &data)) { digits = calculate_digits(data); digits++; total_digit += digits; if(total_digit >= data_len) { break; } data_ptr = data_ptr + digits; max = (max < data) ? data : max; } return max; } u_int word_count(int sockfd) { u_short data_len; if(recvall(sockfd, (char *)&data_len, sizeof(data_len)) < 0) { perror("ERROR reading from socket"); exit(1); } data_len = ntohs(data_len); data_len = data_len - sizeof(message); u_char *data_ptr = malloc(data_len); u_int count = 0; if(recvall(sockfd, (char *)data_ptr, data_len) < 0) { perror("ERROR reading from socket"); printf("%s:%d, Can't read from Socket : %d\n", __func__, __LINE__, sockfd); exit(1); } printf ("%s:%d, data_ptr = %s\n", __func__, __LINE__, data_ptr); for(int i = 0; i < data_len; i++) { if(data_ptr[i] == ' ') { count++; } } printf("%s:%d, Word Count : %d\b\n", __func__, __LINE__, count); count = htonl(count); return count; } void task_from_server(int sockfd) { u_int max; u_int count_words; u_short data_len; u_int msg_len; message *ptr; char task_id; u_short group_id; if(recvall(sockfd, &task_id, sizeof(task_id)) < 0) { perror("ERROR reading from socket"); printf("%s:%d, Can't read from Socket : %d\n", __func__, __LINE__, sockfd); exit(1); } printf("%s:%d, Task Id : %d\n", __func__, __LINE__, task_id); if(recvall(sockfd, (char *)&group_id, sizeof(group_id)) < 0) { perror("ERROR reading from socket"); printf("%s:%d, Can't read from Socket : %d\n", __func__, __LINE__, sockfd); exit(1); } group_id = ntohs(group_id); printf("%s:%d, Group Id : %d\n", __func__, __LINE__, group_id); if(ptr == NULL) { perror("Error: not able to allocate memory"); exit(1); } printf("%s:%d, Task ID : %d\n", __func__, __LINE__, task_id); if(task_id == 1) // finding max element from given set of numbers. { max = find_max_number(sockfd); data_len = sizeof(max); msg_len = sizeof(message) + data_len; u_int max1 = htonl(max); ptr = malloc(msg_len); memcpy((u_int *)ptr->data, &max1, sizeof(u_int)); } if(task_id == 2) // couting the words in file chunk { count_words = word_count(sockfd); data_len = sizeof(count_words); msg_len = sizeof(message) + data_len; count_words = htonl(count_words); ptr = malloc(msg_len); memcpy((u_int *)ptr->data, &count_words, sizeof(u_int)); } ptr->msg_type = REPLY_FROM_CLIENT; ptr->task_id = task_id; ptr->group_id = htons(group_id); ptr->data_len = htons(data_len); if(sendall(sockfd, (char *)ptr, (msg_len + sizeof(message))) == -1) { perror("ERROR writing to socket"); exit(1); } free(ptr); return; } int main(int argc, char *argv[]) { int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; pthread_t thread_id1, thread_id2; pthread_attr_t attr; if (argc < 3) { fprintf(stderr,"usage %s hostname port\n", argv[0]); exit(0); } portno = atoi(argv[2]); /* Create a socket point */ sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { perror("ERROR opening socket"); exit(1); } server = gethostbyname(argv[1]); if (server == NULL) { fprintf(stderr,"ERROR, no such host\n"); exit(0); } memset((char *) &serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(portno); /* Now connect to the server */ if (connect(sockfd, (struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) { perror("ERROR connecting"); exit(1); } //printf("socked fd = %d\n", sockfd); pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); pthread_create(&thread_id1, &attr, join_group, (void *)&sockfd); while(1) { //printf("message received form server\n"); char msg_type; n = recvall(sockfd, &msg_type, sizeof(msg_type)); if (n < 0) { printf("ERROR reading from socket....................."); printf("%s:%d, Can't read from Socket : %d\n", __func__, __LINE__, sockfd); exit(1); } if(START_OF_TASK == msg_type) { printf("%s:%d, Task From Server Received : Sock Fd : %d\n", __func__, __LINE__, sockfd); task_from_server(sockfd); } } pthread_exit(NULL); return 0; }
5f95f160ca6ca36b37ba0220ef6ccd265b73c1a8
36db2a366737f7a802769337086399640626d1e3
/src/bcm/esw/tucana/mbcm.c
6526d6473db1c4694af108161058582e5b0b552a
[]
no_license
lcyddp/bcm-sdk-5.10.1
8d82266d901023fdf5a76786ee6fb96cd2f21ecc
7443047b308fa846a9a9cd14bf1da6d590a23703
refs/heads/master
2020-03-16T04:54:05.162215
2018-02-27T15:51:13
2018-02-27T15:51:13
null
0
0
null
null
null
null
UTF-8
C
false
false
7,228
c
mbcm.c
/* * $Id: mbcm.c 1.36 Broadcom SDK $ * $Copyright: Copyright 2011 Broadcom Corporation. * This program is the proprietary software of Broadcom Corporation * and/or its licensors, and may only be used, duplicated, modified * or distributed pursuant to the terms and conditions of a separate, * written license agreement executed between you and Broadcom * (an "Authorized License"). Except as set forth in an Authorized * License, Broadcom grants no license (express or implied), right * to use, or waiver of any kind with respect to the Software, and * Broadcom expressly reserves all rights in and to the Software * and all intellectual property rights therein. IF YOU HAVE * NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE * IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE * ALL USE OF THE SOFTWARE. * * Except as expressly set forth in the Authorized License, * * 1. This program, including its structure, sequence and organization, * constitutes the valuable trade secrets of Broadcom, and you shall use * all reasonable efforts to protect the confidentiality thereof, * and to use this information only in connection with your use of * Broadcom integrated circuit products. * * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS * PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING * OUT OF USE OR PERFORMANCE OF THE SOFTWARE. * * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL * BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, * INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER * ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY * TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF * THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00, * WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING * ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$ * * File: mbcm.c */ #include <bcm_int/esw/mbcm.h> #include <bcm_int/esw/draco.h> #include <bcm_int/esw/tucana.h> #include <bcm_int/esw/strata.h> mbcm_functions_t mbcm_tucana_driver = { /* L2 functions */ bcm_draco_l2_init, bcm_draco_l2_term, bcm_draco_l2_addr_get, bcm_draco_l2_addr_add, bcm_draco_l2_addr_delete, bcm_draco_l2_conflict_get, /* Port table related functions */ bcm_draco_port_cfg_init, bcm_draco_port_cfg_get, bcm_draco_port_cfg_set, /* VLAN functions */ bcm_tucana_vlan_init, bcm_draco_vlan_reload, bcm_tucana_vlan_create, bcm_draco_vlan_destroy, bcm_tucana_vlan_port_add, bcm_tucana_vlan_port_remove, bcm_tucana_vlan_port_get, bcm_draco_vlan_stg_get, bcm_draco_vlan_stg_set, /* Draco trunking functions */ bcm_draco_trunk_set, bcm_draco_trunk_get, bcm_draco_trunk_destroy, bcm_draco_trunk_mcast_join, /* Spanning Tree Group functions */ bcm_draco_stg_stp_init, bcm_draco_stg_stp_get, bcm_draco_stg_stp_set, /* Multicasting functions */ bcm_draco_mcast_addr_add, bcm_draco_mcast_addr_remove, bcm_draco_mcast_port_get, bcm_draco_mcast_init, _bcm_draco_mcast_detach, bcm_draco_mcast_addr_add_w_l2mcindex, bcm_draco_mcast_addr_remove_w_l2mcindex, bcm_draco_mcast_port_add, bcm_draco_mcast_port_remove, /* COSQ functions */ bcm_tucana_cosq_init, bcm_tucana_cosq_detach, bcm_tucana_cosq_config_set, bcm_tucana_cosq_config_get, bcm_draco_cosq_mapping_set, bcm_draco_cosq_mapping_get, bcm_tucana_cosq_port_sched_set, bcm_tucana_cosq_port_sched_get, bcm_tucana_cosq_sched_weight_max_get, bcm_tucana_cosq_port_bandwidth_set, bcm_tucana_cosq_port_bandwidth_get, bcm_tucana_cosq_discard_set, bcm_tucana_cosq_discard_get, bcm_tucana_cosq_discard_port_set, bcm_tucana_cosq_discard_port_get, #ifdef BCM_WARM_BOOT_SUPPORT bcm_tucana_cosq_sync, #endif /* BCM_WARM_BOOT_SUPPORT */ #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP bcm_tucana_cosq_sw_dump, #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */ /* Yes, we want the Strata version here */ #ifdef BCM_METER_SUPPORT /* Meter functions */ bcm_strata_meter_init, bcm_strata_meter_create, bcm_strata_meter_delete, bcm_strata_meter_delete_all, bcm_strata_meter_get, bcm_strata_meter_set, bcm_strata_ffppacketcounter_set, bcm_strata_ffppacketcounter_get, bcm_strata_ffpcounter_init, bcm_strata_ffpcounter_create, bcm_strata_ffpcounter_delete, bcm_strata_ffpcounter_delete_all, bcm_strata_ffpcounter_set, bcm_strata_ffpcounter_get, bcm_strata_port_rate_egress_set, bcm_strata_port_rate_egress_get, #endif /* BCM_METER_SUPPORT */ #ifdef INCLUDE_L3 /* L3 functions */ bcm_xgs_l3_tables_init, bcm_xgs_l3_tables_cleanup, bcm_xgs_l3_enable, bcm_xgs_l3_intf_get, bcm_xgs_l3_intf_get_by_vid, bcm_xgs_l3_intf_create, bcm_xgs_l3_intf_id_create, bcm_xgs_l3_intf_lookup, bcm_xgs_l3_intf_del, bcm_xgs_l3_intf_del_all, bcm_xgs_l3_get, bcm_xgs_l3_add, bcm_xgs_l3_del, bcm_xgs_l3_del_prefix, bcm_xgs_l3_del_intf, bcm_xgs_l3_del_all, bcm_xgs_l3_replace, bcm_xgs_l3_age, bcm_xgs_l3_traverse, bcm_xgs_l3_ip6_get, bcm_xgs_l3_ip6_add, bcm_xgs_l3_ip6_del, bcm_xgs_l3_ip6_del_prefix, bcm_xgs_l3_ip6_replace, bcm_xgs_l3_ip6_traverse, bcm_xgs_defip_cfg_get, bcm_xgs_defip_ecmp_get_all, bcm_xgs_defip_add, bcm_xgs_defip_del, bcm_xgs_defip_del_intf, bcm_xgs_defip_del_all, bcm_xgs_lpm_age, bcm_xgs_defip_traverse, bcm_xgs_ip6_defip_cfg_get, bcm_xgs_ip6_defip_ecmp_get_all, bcm_xgs_ip6_defip_add, bcm_xgs_ip6_defip_del, bcm_xgs_ip6_defip_traverse, bcm_xgs_l3_conflict_get, bcm_xgs_l3_info, bcm_xgs_lpm_sw_tbl_empty, bcm_xgs_lpm_hw_tbl_empty, bcm_xgs_lpm_compare_table, bcm_xgs_lpm_delete, bcm_xgs_lpm_insert, bcm_xgs_lpm_lookup, /* IPMC functions */ bcm_xgs_ipmc_init, bcm_xgs_ipmc_detach, bcm_xgs_ipmc_enable, bcm_xgs_ipmc_src_port_check, bcm_xgs_ipmc_src_ip_search, bcm_xgs_ipmc_add, bcm_xgs_ipmc_delete, bcm_xgs_ipmc_delete_all, bcm_xgs_ipmc_lookup, bcm_xgs_ipmc_get, bcm_xgs_ipmc_put, bcm_xgs_ipmc_egress_port_get, bcm_xgs_ipmc_egress_port_set, bcm_tucana_ipmc_repl_init, bcm_tucana_ipmc_repl_detach, bcm_tucana_ipmc_repl_get, bcm_tucana_ipmc_repl_add, bcm_tucana_ipmc_repl_delete, bcm_tucana_ipmc_repl_delete_all, bcm_tucana_ipmc_egress_intf_add, bcm_tucana_ipmc_egress_intf_delete, bcm_xgs_ipmc_age, bcm_xgs_ipmc_traverse, #endif /* INCLUDE_L3 */ };
662be907ea5d17c76d91c714d7608b6122c77dc1
f387fa97fe3ab29e166e6ef9341cf8f87b98acc8
/src/sdk/Libraries/SCPU_USB_Lib/SCPU_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h
ed2b341a927df6f48943e52177f7fb0584061719
[]
no_license
Mmatsnev/P7Core
8aee18ae357c66f48afc23606b361e7c5c6f2b1e
f2120e38263dca06f0bdccac8f300aa7a0dfef72
refs/heads/main
2023-03-24T03:20:27.166154
2021-03-21T10:13:41
2021-03-21T10:13:41
null
0
0
null
null
null
null
UTF-8
C
false
false
1,251
h
usbd_otp_if.h
/** ****************************************************************************** * @file usbd_otp_if.h * @author MCD Application Team * @version V1.1.0 * @date 19-March-2012 * @brief Header for usbd_otp_if.c file. ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __OTP_IF_MAL_H #define __OTP_IF_MAL_H /* Includes ------------------------------------------------------------------*/ #include "usbd_dfu_mal.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ #define OTP_START_ADD 0x1FFF7800 #define OTP_END_ADD (uint32_t)(OTP_START_ADD + 528) #define OTP_IF_STRING "@OTP Area /0x1FFF7800/01*512 g,01*016 g" extern DFU_MAL_Prop_TypeDef DFU_Otp_cb; /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __OTP_IF_MAL_H */ /************************ (C) COPYRIGHT Megahuntmicro *****END OF FILE****/
da2d14d867c20f70d04e3c269f0c08051188c54f
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
/lib/libc/include/any-windows-any/d3d10_1.h
b464a663ef085b07fba8fff1290ac95faf6be0a5
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-public-domain", "MIT" ]
permissive
ziglang/zig
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
refs/heads/master
2023-08-31T13:16:45.980913
2023-08-31T05:50:29
2023-08-31T05:50:29
40,276,274
25,560
2,399
MIT
2023-09-14T21:09:50
2015-08-06T00:51:28
Zig
UTF-8
C
false
false
70,921
h
d3d10_1.h
/*** Autogenerated by WIDL 7.0 from include/d3d10_1.idl - Do not edit ***/ #ifdef _WIN32 #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #endif #include <rpc.h> #include <rpcndr.h> #endif #ifndef COM_NO_WINDOWS_H #include <windows.h> #include <ole2.h> #endif #ifndef __d3d10_1_h__ #define __d3d10_1_h__ /* Forward declarations */ #ifndef __ID3D10BlendState1_FWD_DEFINED__ #define __ID3D10BlendState1_FWD_DEFINED__ typedef interface ID3D10BlendState1 ID3D10BlendState1; #ifdef __cplusplus interface ID3D10BlendState1; #endif /* __cplusplus */ #endif #ifndef __ID3D10ShaderResourceView1_FWD_DEFINED__ #define __ID3D10ShaderResourceView1_FWD_DEFINED__ typedef interface ID3D10ShaderResourceView1 ID3D10ShaderResourceView1; #ifdef __cplusplus interface ID3D10ShaderResourceView1; #endif /* __cplusplus */ #endif #ifndef __ID3D10Device1_FWD_DEFINED__ #define __ID3D10Device1_FWD_DEFINED__ typedef interface ID3D10Device1 ID3D10Device1; #ifdef __cplusplus interface ID3D10Device1; #endif /* __cplusplus */ #endif /* Headers for imported files */ #include <oaidl.h> #include <ocidl.h> #include <d3d10.h> #ifdef __cplusplus extern "C" { #endif #ifndef _D3D10_1_CONSTANTS #define _D3D10_1_CONSTANTS #define D3D10_1_DEFAULT_SAMPLE_MASK (0xffffffff) #define D3D10_1_GS_INPUT_REGISTER_COUNT (32) #define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT (32) #define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS (128) #define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT (32) #define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS (1) #define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT (32) #define D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT (1) #define D3D10_1_SHADER_MAJOR_VERSION (4) #define D3D10_1_SHADER_MINOR_VERSION (1) #define D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES (2048) #define D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES (256) #define D3D10_1_SO_BUFFER_SLOT_COUNT (4) #define D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER (1) #define D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT (64) #define D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT (32) #define D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT (8) #define D3D10_1_VS_INPUT_REGISTER_COUNT (32) #define D3D10_1_VS_OUTPUT_REGISTER_COUNT (32) #endif #define D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP (0.6) #define D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP (0.6f) #include <d3d10_1shader.h> typedef enum D3D10_FEATURE_LEVEL1 { D3D10_FEATURE_LEVEL_10_0 = 0xa000, D3D10_FEATURE_LEVEL_10_1 = 0xa100, D3D10_FEATURE_LEVEL_9_1 = 0x9100, D3D10_FEATURE_LEVEL_9_2 = 0x9200, D3D10_FEATURE_LEVEL_9_3 = 0x9300 } D3D10_FEATURE_LEVEL1; typedef struct D3D10_RENDER_TARGET_BLEND_DESC1 { WINBOOL BlendEnable; D3D10_BLEND SrcBlend; D3D10_BLEND DestBlend; D3D10_BLEND_OP BlendOp; D3D10_BLEND SrcBlendAlpha; D3D10_BLEND DestBlendAlpha; D3D10_BLEND_OP BlendOpAlpha; UINT8 RenderTargetWriteMask; } D3D10_RENDER_TARGET_BLEND_DESC1; typedef struct D3D10_BLEND_DESC1 { WINBOOL AlphaToCoverageEnable; WINBOOL IndependentBlendEnable; D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[8]; } D3D10_BLEND_DESC1; /***************************************************************************** * ID3D10BlendState1 interface */ #ifndef __ID3D10BlendState1_INTERFACE_DEFINED__ #define __ID3D10BlendState1_INTERFACE_DEFINED__ DEFINE_GUID(IID_ID3D10BlendState1, 0xedad8d99, 0x8a35, 0x4d6d, 0x85,0x66, 0x2e,0xa2,0x76,0xcd,0xe1,0x61); #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("edad8d99-8a35-4d6d-8566-2ea276cde161") ID3D10BlendState1 : public ID3D10BlendState { virtual void STDMETHODCALLTYPE GetDesc1( D3D10_BLEND_DESC1 *pDesc) = 0; }; #ifdef __CRT_UUID_DECL __CRT_UUID_DECL(ID3D10BlendState1, 0xedad8d99, 0x8a35, 0x4d6d, 0x85,0x66, 0x2e,0xa2,0x76,0xcd,0xe1,0x61) #endif #else typedef struct ID3D10BlendState1Vtbl { BEGIN_INTERFACE /*** IUnknown methods ***/ HRESULT (STDMETHODCALLTYPE *QueryInterface)( ID3D10BlendState1 *This, REFIID riid, void **ppvObject); ULONG (STDMETHODCALLTYPE *AddRef)( ID3D10BlendState1 *This); ULONG (STDMETHODCALLTYPE *Release)( ID3D10BlendState1 *This); /*** ID3D10DeviceChild methods ***/ void (STDMETHODCALLTYPE *GetDevice)( ID3D10BlendState1 *This, ID3D10Device **ppDevice); HRESULT (STDMETHODCALLTYPE *GetPrivateData)( ID3D10BlendState1 *This, REFGUID guid, UINT *pDataSize, void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateData)( ID3D10BlendState1 *This, REFGUID guid, UINT DataSize, const void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( ID3D10BlendState1 *This, REFGUID guid, const IUnknown *pData); /*** ID3D10BlendState methods ***/ void (STDMETHODCALLTYPE *GetDesc)( ID3D10BlendState1 *This, D3D10_BLEND_DESC *pDesc); /*** ID3D10BlendState1 methods ***/ void (STDMETHODCALLTYPE *GetDesc1)( ID3D10BlendState1 *This, D3D10_BLEND_DESC1 *pDesc); END_INTERFACE } ID3D10BlendState1Vtbl; interface ID3D10BlendState1 { CONST_VTBL ID3D10BlendState1Vtbl* lpVtbl; }; #ifdef COBJMACROS #ifndef WIDL_C_INLINE_WRAPPERS /*** IUnknown methods ***/ #define ID3D10BlendState1_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) #define ID3D10BlendState1_AddRef(This) (This)->lpVtbl->AddRef(This) #define ID3D10BlendState1_Release(This) (This)->lpVtbl->Release(This) /*** ID3D10DeviceChild methods ***/ #define ID3D10BlendState1_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice) #define ID3D10BlendState1_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData) #define ID3D10BlendState1_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData) #define ID3D10BlendState1_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData) /*** ID3D10BlendState methods ***/ #define ID3D10BlendState1_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc) /*** ID3D10BlendState1 methods ***/ #define ID3D10BlendState1_GetDesc1(This,pDesc) (This)->lpVtbl->GetDesc1(This,pDesc) #else /*** IUnknown methods ***/ static FORCEINLINE HRESULT ID3D10BlendState1_QueryInterface(ID3D10BlendState1* This,REFIID riid,void **ppvObject) { return This->lpVtbl->QueryInterface(This,riid,ppvObject); } static FORCEINLINE ULONG ID3D10BlendState1_AddRef(ID3D10BlendState1* This) { return This->lpVtbl->AddRef(This); } static FORCEINLINE ULONG ID3D10BlendState1_Release(ID3D10BlendState1* This) { return This->lpVtbl->Release(This); } /*** ID3D10DeviceChild methods ***/ static FORCEINLINE void ID3D10BlendState1_GetDevice(ID3D10BlendState1* This,ID3D10Device **ppDevice) { This->lpVtbl->GetDevice(This,ppDevice); } static FORCEINLINE HRESULT ID3D10BlendState1_GetPrivateData(ID3D10BlendState1* This,REFGUID guid,UINT *pDataSize,void *pData) { return This->lpVtbl->GetPrivateData(This,guid,pDataSize,pData); } static FORCEINLINE HRESULT ID3D10BlendState1_SetPrivateData(ID3D10BlendState1* This,REFGUID guid,UINT DataSize,const void *pData) { return This->lpVtbl->SetPrivateData(This,guid,DataSize,pData); } static FORCEINLINE HRESULT ID3D10BlendState1_SetPrivateDataInterface(ID3D10BlendState1* This,REFGUID guid,const IUnknown *pData) { return This->lpVtbl->SetPrivateDataInterface(This,guid,pData); } /*** ID3D10BlendState methods ***/ static FORCEINLINE void ID3D10BlendState1_GetDesc(ID3D10BlendState1* This,D3D10_BLEND_DESC *pDesc) { This->lpVtbl->GetDesc(This,pDesc); } /*** ID3D10BlendState1 methods ***/ static FORCEINLINE void ID3D10BlendState1_GetDesc1(ID3D10BlendState1* This,D3D10_BLEND_DESC1 *pDesc) { This->lpVtbl->GetDesc1(This,pDesc); } #endif #endif #endif #endif /* __ID3D10BlendState1_INTERFACE_DEFINED__ */ typedef struct D3D10_TEXCUBE_ARRAY_SRV1 { UINT MostDetailedMip; UINT MipLevels; UINT First2DArrayFace; UINT NumCubes; } D3D10_TEXCUBE_ARRAY_SRV1; typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1; typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1 { DXGI_FORMAT Format; D3D10_SRV_DIMENSION1 ViewDimension; __C89_NAMELESS union { D3D10_BUFFER_SRV Buffer; D3D10_TEX1D_SRV Texture1D; D3D10_TEX1D_ARRAY_SRV Texture1DArray; D3D10_TEX2D_SRV Texture2D; D3D10_TEX2D_ARRAY_SRV Texture2DArray; D3D10_TEX2DMS_SRV Texture2DMS; D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; D3D10_TEX3D_SRV Texture3D; D3D10_TEXCUBE_SRV TextureCube; D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray; } __C89_NAMELESSUNIONNAME; } D3D10_SHADER_RESOURCE_VIEW_DESC1; /***************************************************************************** * ID3D10ShaderResourceView1 interface */ #ifndef __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ #define __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ DEFINE_GUID(IID_ID3D10ShaderResourceView1, 0x9b7e4c87, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0); #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("9b7e4c87-342c-4106-a19f-4f2704f689f0") ID3D10ShaderResourceView1 : public ID3D10ShaderResourceView { virtual void STDMETHODCALLTYPE GetDesc1( D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0; }; #ifdef __CRT_UUID_DECL __CRT_UUID_DECL(ID3D10ShaderResourceView1, 0x9b7e4c87, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0) #endif #else typedef struct ID3D10ShaderResourceView1Vtbl { BEGIN_INTERFACE /*** IUnknown methods ***/ HRESULT (STDMETHODCALLTYPE *QueryInterface)( ID3D10ShaderResourceView1 *This, REFIID riid, void **ppvObject); ULONG (STDMETHODCALLTYPE *AddRef)( ID3D10ShaderResourceView1 *This); ULONG (STDMETHODCALLTYPE *Release)( ID3D10ShaderResourceView1 *This); /*** ID3D10DeviceChild methods ***/ void (STDMETHODCALLTYPE *GetDevice)( ID3D10ShaderResourceView1 *This, ID3D10Device **ppDevice); HRESULT (STDMETHODCALLTYPE *GetPrivateData)( ID3D10ShaderResourceView1 *This, REFGUID guid, UINT *pDataSize, void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateData)( ID3D10ShaderResourceView1 *This, REFGUID guid, UINT DataSize, const void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( ID3D10ShaderResourceView1 *This, REFGUID guid, const IUnknown *pData); /*** ID3D10View methods ***/ void (STDMETHODCALLTYPE *GetResource)( ID3D10ShaderResourceView1 *This, ID3D10Resource **ppResource); /*** ID3D10ShaderResourceView methods ***/ void (STDMETHODCALLTYPE *GetDesc)( ID3D10ShaderResourceView1 *This, D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); /*** ID3D10ShaderResourceView1 methods ***/ void (STDMETHODCALLTYPE *GetDesc1)( ID3D10ShaderResourceView1 *This, D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc); END_INTERFACE } ID3D10ShaderResourceView1Vtbl; interface ID3D10ShaderResourceView1 { CONST_VTBL ID3D10ShaderResourceView1Vtbl* lpVtbl; }; #ifdef COBJMACROS #ifndef WIDL_C_INLINE_WRAPPERS /*** IUnknown methods ***/ #define ID3D10ShaderResourceView1_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) #define ID3D10ShaderResourceView1_AddRef(This) (This)->lpVtbl->AddRef(This) #define ID3D10ShaderResourceView1_Release(This) (This)->lpVtbl->Release(This) /*** ID3D10DeviceChild methods ***/ #define ID3D10ShaderResourceView1_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice) #define ID3D10ShaderResourceView1_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData) #define ID3D10ShaderResourceView1_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData) #define ID3D10ShaderResourceView1_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData) /*** ID3D10View methods ***/ #define ID3D10ShaderResourceView1_GetResource(This,ppResource) (This)->lpVtbl->GetResource(This,ppResource) /*** ID3D10ShaderResourceView methods ***/ #define ID3D10ShaderResourceView1_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc) /*** ID3D10ShaderResourceView1 methods ***/ #define ID3D10ShaderResourceView1_GetDesc1(This,pDesc) (This)->lpVtbl->GetDesc1(This,pDesc) #else /*** IUnknown methods ***/ static FORCEINLINE HRESULT ID3D10ShaderResourceView1_QueryInterface(ID3D10ShaderResourceView1* This,REFIID riid,void **ppvObject) { return This->lpVtbl->QueryInterface(This,riid,ppvObject); } static FORCEINLINE ULONG ID3D10ShaderResourceView1_AddRef(ID3D10ShaderResourceView1* This) { return This->lpVtbl->AddRef(This); } static FORCEINLINE ULONG ID3D10ShaderResourceView1_Release(ID3D10ShaderResourceView1* This) { return This->lpVtbl->Release(This); } /*** ID3D10DeviceChild methods ***/ static FORCEINLINE void ID3D10ShaderResourceView1_GetDevice(ID3D10ShaderResourceView1* This,ID3D10Device **ppDevice) { This->lpVtbl->GetDevice(This,ppDevice); } static FORCEINLINE HRESULT ID3D10ShaderResourceView1_GetPrivateData(ID3D10ShaderResourceView1* This,REFGUID guid,UINT *pDataSize,void *pData) { return This->lpVtbl->GetPrivateData(This,guid,pDataSize,pData); } static FORCEINLINE HRESULT ID3D10ShaderResourceView1_SetPrivateData(ID3D10ShaderResourceView1* This,REFGUID guid,UINT DataSize,const void *pData) { return This->lpVtbl->SetPrivateData(This,guid,DataSize,pData); } static FORCEINLINE HRESULT ID3D10ShaderResourceView1_SetPrivateDataInterface(ID3D10ShaderResourceView1* This,REFGUID guid,const IUnknown *pData) { return This->lpVtbl->SetPrivateDataInterface(This,guid,pData); } /*** ID3D10View methods ***/ static FORCEINLINE void ID3D10ShaderResourceView1_GetResource(ID3D10ShaderResourceView1* This,ID3D10Resource **ppResource) { This->lpVtbl->GetResource(This,ppResource); } /*** ID3D10ShaderResourceView methods ***/ static FORCEINLINE void ID3D10ShaderResourceView1_GetDesc(ID3D10ShaderResourceView1* This,D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) { This->lpVtbl->GetDesc(This,pDesc); } /*** ID3D10ShaderResourceView1 methods ***/ static FORCEINLINE void ID3D10ShaderResourceView1_GetDesc1(ID3D10ShaderResourceView1* This,D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) { This->lpVtbl->GetDesc1(This,pDesc); } #endif #endif #endif #endif /* __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ */ /***************************************************************************** * ID3D10Device1 interface */ #ifndef __ID3D10Device1_INTERFACE_DEFINED__ #define __ID3D10Device1_INTERFACE_DEFINED__ DEFINE_GUID(IID_ID3D10Device1, 0x9b7e4c8f, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0); #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("9b7e4c8f-342c-4106-a19f-4f2704f689f0") ID3D10Device1 : public ID3D10Device { virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1( ID3D10Resource *pResource, const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, ID3D10ShaderResourceView1 **ppSRView) = 0; virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( const D3D10_BLEND_DESC1 *pBlendStateDesc, ID3D10BlendState1 **ppBlendState) = 0; virtual D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE GetFeatureLevel( ) = 0; }; #ifdef __CRT_UUID_DECL __CRT_UUID_DECL(ID3D10Device1, 0x9b7e4c8f, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0) #endif #else typedef struct ID3D10Device1Vtbl { BEGIN_INTERFACE /*** IUnknown methods ***/ HRESULT (STDMETHODCALLTYPE *QueryInterface)( ID3D10Device1 *This, REFIID riid, void **ppvObject); ULONG (STDMETHODCALLTYPE *AddRef)( ID3D10Device1 *This); ULONG (STDMETHODCALLTYPE *Release)( ID3D10Device1 *This); /*** ID3D10Device methods ***/ void (STDMETHODCALLTYPE *VSSetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer *const *ppConstantBuffers); void (STDMETHODCALLTYPE *PSSetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView *const *ppShaderResourceViews); void (STDMETHODCALLTYPE *PSSetShader)( ID3D10Device1 *This, ID3D10PixelShader *pPixelShader); void (STDMETHODCALLTYPE *PSSetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState *const *ppSamplers); void (STDMETHODCALLTYPE *VSSetShader)( ID3D10Device1 *This, ID3D10VertexShader *pVertexShader); void (STDMETHODCALLTYPE *DrawIndexed)( ID3D10Device1 *This, UINT IndexCount, UINT StartIndexLocation, INT BaseVertexLocation); void (STDMETHODCALLTYPE *Draw)( ID3D10Device1 *This, UINT VertexCount, UINT StartVertexLocation); void (STDMETHODCALLTYPE *PSSetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer *const *ppConstantBuffers); void (STDMETHODCALLTYPE *IASetInputLayout)( ID3D10Device1 *This, ID3D10InputLayout *pInputLayout); void (STDMETHODCALLTYPE *IASetVertexBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer *const *ppVertexBuffers, const UINT *pStrides, const UINT *pOffsets); void (STDMETHODCALLTYPE *IASetIndexBuffer)( ID3D10Device1 *This, ID3D10Buffer *pIndexBuffer, DXGI_FORMAT Format, UINT Offset); void (STDMETHODCALLTYPE *DrawIndexedInstanced)( ID3D10Device1 *This, UINT IndexCountPerInstance, UINT InstanceCount, UINT StartIndexLocation, INT BaseVertexLocation, UINT StartInstanceLocation); void (STDMETHODCALLTYPE *DrawInstanced)( ID3D10Device1 *This, UINT VertexCountPerInstance, UINT InstanceCount, UINT StartVertexLocation, UINT StartInstanceLocation); void (STDMETHODCALLTYPE *GSSetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer *const *ppConstantBuffers); void (STDMETHODCALLTYPE *GSSetShader)( ID3D10Device1 *This, ID3D10GeometryShader *pShader); void (STDMETHODCALLTYPE *IASetPrimitiveTopology)( ID3D10Device1 *This, D3D10_PRIMITIVE_TOPOLOGY Topology); void (STDMETHODCALLTYPE *VSSetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView *const *ppShaderResourceViews); void (STDMETHODCALLTYPE *VSSetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState *const *ppSamplers); void (STDMETHODCALLTYPE *SetPredication)( ID3D10Device1 *This, ID3D10Predicate *pPredicate, WINBOOL PredicateValue); void (STDMETHODCALLTYPE *GSSetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView *const *ppShaderResourceViews); void (STDMETHODCALLTYPE *GSSetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState *const *ppSamplers); void (STDMETHODCALLTYPE *OMSetRenderTargets)( ID3D10Device1 *This, UINT NumViews, ID3D10RenderTargetView *const *ppRenderTargetViews, ID3D10DepthStencilView *pDepthStencilView); void (STDMETHODCALLTYPE *OMSetBlendState)( ID3D10Device1 *This, ID3D10BlendState *pBlendState, const FLOAT BlendFactor[4], UINT SampleMask); void (STDMETHODCALLTYPE *OMSetDepthStencilState)( ID3D10Device1 *This, ID3D10DepthStencilState *pDepthStencilState, UINT StencilRef); void (STDMETHODCALLTYPE *SOSetTargets)( ID3D10Device1 *This, UINT NumBuffers, ID3D10Buffer *const *ppSOTargets, const UINT *pOffsets); void (STDMETHODCALLTYPE *DrawAuto)( ID3D10Device1 *This); void (STDMETHODCALLTYPE *RSSetState)( ID3D10Device1 *This, ID3D10RasterizerState *pRasterizerState); void (STDMETHODCALLTYPE *RSSetViewports)( ID3D10Device1 *This, UINT NumViewports, const D3D10_VIEWPORT *pViewports); void (STDMETHODCALLTYPE *RSSetScissorRects)( ID3D10Device1 *This, UINT NumRects, const D3D10_RECT *pRects); void (STDMETHODCALLTYPE *CopySubresourceRegion)( ID3D10Device1 *This, ID3D10Resource *pDstResource, UINT DstSubresource, UINT DstX, UINT DstY, UINT DstZ, ID3D10Resource *pSrcResource, UINT SrcSubresource, const D3D10_BOX *pSrcBox); void (STDMETHODCALLTYPE *CopyResource)( ID3D10Device1 *This, ID3D10Resource *pDstResource, ID3D10Resource *pSrcResource); void (STDMETHODCALLTYPE *UpdateSubresource)( ID3D10Device1 *This, ID3D10Resource *pDstResource, UINT DstSubresource, const D3D10_BOX *pDstBox, const void *pSrcData, UINT SrcRowPitch, UINT SrcDepthPitch); void (STDMETHODCALLTYPE *ClearRenderTargetView)( ID3D10Device1 *This, ID3D10RenderTargetView *pRenderTargetView, const FLOAT ColorRGBA[4]); void (STDMETHODCALLTYPE *ClearDepthStencilView)( ID3D10Device1 *This, ID3D10DepthStencilView *pDepthStencilView, UINT ClearFlags, FLOAT Depth, UINT8 Stencil); void (STDMETHODCALLTYPE *GenerateMips)( ID3D10Device1 *This, ID3D10ShaderResourceView *pShaderResourceView); void (STDMETHODCALLTYPE *ResolveSubresource)( ID3D10Device1 *This, ID3D10Resource *pDstResource, UINT DstSubresource, ID3D10Resource *pSrcResource, UINT SrcSubresource, DXGI_FORMAT Format); void (STDMETHODCALLTYPE *VSGetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer **ppConstantBuffers); void (STDMETHODCALLTYPE *PSGetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView **ppShaderResourceViews); void (STDMETHODCALLTYPE *PSGetShader)( ID3D10Device1 *This, ID3D10PixelShader **ppPixelShader); void (STDMETHODCALLTYPE *PSGetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState **ppSamplers); void (STDMETHODCALLTYPE *VSGetShader)( ID3D10Device1 *This, ID3D10VertexShader **ppVertexShader); void (STDMETHODCALLTYPE *PSGetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer **ppConstantBuffers); void (STDMETHODCALLTYPE *IAGetInputLayout)( ID3D10Device1 *This, ID3D10InputLayout **ppInputLayout); void (STDMETHODCALLTYPE *IAGetVertexBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer **ppVertexBuffers, UINT *pStrides, UINT *pOffsets); void (STDMETHODCALLTYPE *IAGetIndexBuffer)( ID3D10Device1 *This, ID3D10Buffer **pIndexBuffer, DXGI_FORMAT *Format, UINT *Offset); void (STDMETHODCALLTYPE *GSGetConstantBuffers)( ID3D10Device1 *This, UINT StartSlot, UINT NumBuffers, ID3D10Buffer **ppConstantBuffers); void (STDMETHODCALLTYPE *GSGetShader)( ID3D10Device1 *This, ID3D10GeometryShader **ppGeometryShader); void (STDMETHODCALLTYPE *IAGetPrimitiveTopology)( ID3D10Device1 *This, D3D10_PRIMITIVE_TOPOLOGY *pTopology); void (STDMETHODCALLTYPE *VSGetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView **ppShaderResourceViews); void (STDMETHODCALLTYPE *VSGetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState **ppSamplers); void (STDMETHODCALLTYPE *GetPredication)( ID3D10Device1 *This, ID3D10Predicate **ppPredicate, WINBOOL *pPredicateValue); void (STDMETHODCALLTYPE *GSGetShaderResources)( ID3D10Device1 *This, UINT StartSlot, UINT NumViews, ID3D10ShaderResourceView **ppShaderResourceViews); void (STDMETHODCALLTYPE *GSGetSamplers)( ID3D10Device1 *This, UINT StartSlot, UINT NumSamplers, ID3D10SamplerState **ppSamplers); void (STDMETHODCALLTYPE *OMGetRenderTargets)( ID3D10Device1 *This, UINT NumViews, ID3D10RenderTargetView **ppRenderTargetViews, ID3D10DepthStencilView **ppDepthStencilView); void (STDMETHODCALLTYPE *OMGetBlendState)( ID3D10Device1 *This, ID3D10BlendState **ppBlendState, FLOAT BlendFactor[4], UINT *pSampleMask); void (STDMETHODCALLTYPE *OMGetDepthStencilState)( ID3D10Device1 *This, ID3D10DepthStencilState **ppDepthStencilState, UINT *pStencilRef); void (STDMETHODCALLTYPE *SOGetTargets)( ID3D10Device1 *This, UINT NumBuffers, ID3D10Buffer **ppSOTargets, UINT *pOffsets); void (STDMETHODCALLTYPE *RSGetState)( ID3D10Device1 *This, ID3D10RasterizerState **ppRasterizerState); void (STDMETHODCALLTYPE *RSGetViewports)( ID3D10Device1 *This, UINT *NumViewports, D3D10_VIEWPORT *pViewports); void (STDMETHODCALLTYPE *RSGetScissorRects)( ID3D10Device1 *This, UINT *NumRects, D3D10_RECT *pRects); HRESULT (STDMETHODCALLTYPE *GetDeviceRemovedReason)( ID3D10Device1 *This); HRESULT (STDMETHODCALLTYPE *SetExceptionMode)( ID3D10Device1 *This, UINT RaiseFlags); UINT (STDMETHODCALLTYPE *GetExceptionMode)( ID3D10Device1 *This); HRESULT (STDMETHODCALLTYPE *GetPrivateData)( ID3D10Device1 *This, REFGUID guid, UINT *pDataSize, void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateData)( ID3D10Device1 *This, REFGUID guid, UINT DataSize, const void *pData); HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( ID3D10Device1 *This, REFGUID guid, const IUnknown *pData); void (STDMETHODCALLTYPE *ClearState)( ID3D10Device1 *This); void (STDMETHODCALLTYPE *Flush)( ID3D10Device1 *This); HRESULT (STDMETHODCALLTYPE *CreateBuffer)( ID3D10Device1 *This, const D3D10_BUFFER_DESC *pDesc, const D3D10_SUBRESOURCE_DATA *pInitialData, ID3D10Buffer **ppBuffer); HRESULT (STDMETHODCALLTYPE *CreateTexture1D)( ID3D10Device1 *This, const D3D10_TEXTURE1D_DESC *pDesc, const D3D10_SUBRESOURCE_DATA *pInitialData, ID3D10Texture1D **ppTexture1D); HRESULT (STDMETHODCALLTYPE *CreateTexture2D)( ID3D10Device1 *This, const D3D10_TEXTURE2D_DESC *pDesc, const D3D10_SUBRESOURCE_DATA *pInitialData, ID3D10Texture2D **ppTexture2D); HRESULT (STDMETHODCALLTYPE *CreateTexture3D)( ID3D10Device1 *This, const D3D10_TEXTURE3D_DESC *pDesc, const D3D10_SUBRESOURCE_DATA *pInitialData, ID3D10Texture3D **ppTexture3D); HRESULT (STDMETHODCALLTYPE *CreateShaderResourceView)( ID3D10Device1 *This, ID3D10Resource *pResource, const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, ID3D10ShaderResourceView **ppSRView); HRESULT (STDMETHODCALLTYPE *CreateRenderTargetView)( ID3D10Device1 *This, ID3D10Resource *pResource, const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, ID3D10RenderTargetView **ppRTView); HRESULT (STDMETHODCALLTYPE *CreateDepthStencilView)( ID3D10Device1 *This, ID3D10Resource *pResource, const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, ID3D10DepthStencilView **ppDepthStencilView); HRESULT (STDMETHODCALLTYPE *CreateInputLayout)( ID3D10Device1 *This, const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, UINT NumElements, const void *pShaderBytecodeWithInputSignature, SIZE_T BytecodeLength, ID3D10InputLayout **ppInputLayout); HRESULT (STDMETHODCALLTYPE *CreateVertexShader)( ID3D10Device1 *This, const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10VertexShader **ppVertexShader); HRESULT (STDMETHODCALLTYPE *CreateGeometryShader)( ID3D10Device1 *This, const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10GeometryShader **ppGeometryShader); HRESULT (STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput)( ID3D10Device1 *This, const void *pShaderBytecode, SIZE_T BytecodeLength, const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, UINT NumEntries, UINT OutputStreamStride, ID3D10GeometryShader **ppGeometryShader); HRESULT (STDMETHODCALLTYPE *CreatePixelShader)( ID3D10Device1 *This, const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10PixelShader **ppPixelShader); HRESULT (STDMETHODCALLTYPE *CreateBlendState)( ID3D10Device1 *This, const D3D10_BLEND_DESC *pBlendStateDesc, ID3D10BlendState **ppBlendState); HRESULT (STDMETHODCALLTYPE *CreateDepthStencilState)( ID3D10Device1 *This, const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, ID3D10DepthStencilState **ppDepthStencilState); HRESULT (STDMETHODCALLTYPE *CreateRasterizerState)( ID3D10Device1 *This, const D3D10_RASTERIZER_DESC *pRasterizerDesc, ID3D10RasterizerState **ppRasterizerState); HRESULT (STDMETHODCALLTYPE *CreateSamplerState)( ID3D10Device1 *This, const D3D10_SAMPLER_DESC *pSamplerDesc, ID3D10SamplerState **ppSamplerState); HRESULT (STDMETHODCALLTYPE *CreateQuery)( ID3D10Device1 *This, const D3D10_QUERY_DESC *pQueryDesc, ID3D10Query **ppQuery); HRESULT (STDMETHODCALLTYPE *CreatePredicate)( ID3D10Device1 *This, const D3D10_QUERY_DESC *pPredicateDesc, ID3D10Predicate **ppPredicate); HRESULT (STDMETHODCALLTYPE *CreateCounter)( ID3D10Device1 *This, const D3D10_COUNTER_DESC *pCounterDesc, ID3D10Counter **ppCounter); HRESULT (STDMETHODCALLTYPE *CheckFormatSupport)( ID3D10Device1 *This, DXGI_FORMAT Format, UINT *pFormatSupport); HRESULT (STDMETHODCALLTYPE *CheckMultisampleQualityLevels)( ID3D10Device1 *This, DXGI_FORMAT Format, UINT SampleCount, UINT *pNumQualityLevels); void (STDMETHODCALLTYPE *CheckCounterInfo)( ID3D10Device1 *This, D3D10_COUNTER_INFO *pCounterInfo); HRESULT (STDMETHODCALLTYPE *CheckCounter)( ID3D10Device1 *This, const D3D10_COUNTER_DESC *pDesc, D3D10_COUNTER_TYPE *pType, UINT *pActiveCounters, char *name, UINT *pNameLength, char *units, UINT *pUnitsLength, char *description, UINT *pDescriptionLength); UINT (STDMETHODCALLTYPE *GetCreationFlags)( ID3D10Device1 *This); HRESULT (STDMETHODCALLTYPE *OpenSharedResource)( ID3D10Device1 *This, HANDLE hResource, REFIID ReturnedInterface, void **ppResource); void (STDMETHODCALLTYPE *SetTextFilterSize)( ID3D10Device1 *This, UINT Width, UINT Height); void (STDMETHODCALLTYPE *GetTextFilterSize)( ID3D10Device1 *This, UINT *pWidth, UINT *pHeight); /*** ID3D10Device1 methods ***/ HRESULT (STDMETHODCALLTYPE *CreateShaderResourceView1)( ID3D10Device1 *This, ID3D10Resource *pResource, const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, ID3D10ShaderResourceView1 **ppSRView); HRESULT (STDMETHODCALLTYPE *CreateBlendState1)( ID3D10Device1 *This, const D3D10_BLEND_DESC1 *pBlendStateDesc, ID3D10BlendState1 **ppBlendState); D3D10_FEATURE_LEVEL1 (STDMETHODCALLTYPE *GetFeatureLevel)( ID3D10Device1 *This); END_INTERFACE } ID3D10Device1Vtbl; interface ID3D10Device1 { CONST_VTBL ID3D10Device1Vtbl* lpVtbl; }; #ifdef COBJMACROS #ifndef WIDL_C_INLINE_WRAPPERS /*** IUnknown methods ***/ #define ID3D10Device1_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) #define ID3D10Device1_AddRef(This) (This)->lpVtbl->AddRef(This) #define ID3D10Device1_Release(This) (This)->lpVtbl->Release(This) /*** ID3D10Device methods ***/ #define ID3D10Device1_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_PSSetShader(This,pPixelShader) (This)->lpVtbl->PSSetShader(This,pPixelShader) #define ID3D10Device1_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_VSSetShader(This,pVertexShader) (This)->lpVtbl->VSSetShader(This,pVertexShader) #define ID3D10Device1_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) (This)->lpVtbl->DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) #define ID3D10Device1_Draw(This,VertexCount,StartVertexLocation) (This)->lpVtbl->Draw(This,VertexCount,StartVertexLocation) #define ID3D10Device1_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_IASetInputLayout(This,pInputLayout) (This)->lpVtbl->IASetInputLayout(This,pInputLayout) #define ID3D10Device1_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) (This)->lpVtbl->IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) #define ID3D10Device1_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) (This)->lpVtbl->IASetIndexBuffer(This,pIndexBuffer,Format,Offset) #define ID3D10Device1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) (This)->lpVtbl->DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) #define ID3D10Device1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) (This)->lpVtbl->DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) #define ID3D10Device1_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_GSSetShader(This,pShader) (This)->lpVtbl->GSSetShader(This,pShader) #define ID3D10Device1_IASetPrimitiveTopology(This,Topology) (This)->lpVtbl->IASetPrimitiveTopology(This,Topology) #define ID3D10Device1_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_SetPredication(This,pPredicate,PredicateValue) (This)->lpVtbl->SetPredication(This,pPredicate,PredicateValue) #define ID3D10Device1_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) (This)->lpVtbl->OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) #define ID3D10Device1_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) (This)->lpVtbl->OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) #define ID3D10Device1_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) (This)->lpVtbl->OMSetDepthStencilState(This,pDepthStencilState,StencilRef) #define ID3D10Device1_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) (This)->lpVtbl->SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) #define ID3D10Device1_DrawAuto(This) (This)->lpVtbl->DrawAuto(This) #define ID3D10Device1_RSSetState(This,pRasterizerState) (This)->lpVtbl->RSSetState(This,pRasterizerState) #define ID3D10Device1_RSSetViewports(This,NumViewports,pViewports) (This)->lpVtbl->RSSetViewports(This,NumViewports,pViewports) #define ID3D10Device1_RSSetScissorRects(This,NumRects,pRects) (This)->lpVtbl->RSSetScissorRects(This,NumRects,pRects) #define ID3D10Device1_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) (This)->lpVtbl->CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) #define ID3D10Device1_CopyResource(This,pDstResource,pSrcResource) (This)->lpVtbl->CopyResource(This,pDstResource,pSrcResource) #define ID3D10Device1_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) (This)->lpVtbl->UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) #define ID3D10Device1_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) (This)->lpVtbl->ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) #define ID3D10Device1_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) (This)->lpVtbl->ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) #define ID3D10Device1_GenerateMips(This,pShaderResourceView) (This)->lpVtbl->GenerateMips(This,pShaderResourceView) #define ID3D10Device1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) (This)->lpVtbl->ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) #define ID3D10Device1_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_PSGetShader(This,ppPixelShader) (This)->lpVtbl->PSGetShader(This,ppPixelShader) #define ID3D10Device1_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_VSGetShader(This,ppVertexShader) (This)->lpVtbl->VSGetShader(This,ppVertexShader) #define ID3D10Device1_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_IAGetInputLayout(This,ppInputLayout) (This)->lpVtbl->IAGetInputLayout(This,ppInputLayout) #define ID3D10Device1_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) (This)->lpVtbl->IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) #define ID3D10Device1_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) (This)->lpVtbl->IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) #define ID3D10Device1_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) #define ID3D10Device1_GSGetShader(This,ppGeometryShader) (This)->lpVtbl->GSGetShader(This,ppGeometryShader) #define ID3D10Device1_IAGetPrimitiveTopology(This,pTopology) (This)->lpVtbl->IAGetPrimitiveTopology(This,pTopology) #define ID3D10Device1_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_GetPredication(This,ppPredicate,pPredicateValue) (This)->lpVtbl->GetPredication(This,ppPredicate,pPredicateValue) #define ID3D10Device1_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) #define ID3D10Device1_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) #define ID3D10Device1_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) (This)->lpVtbl->OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) #define ID3D10Device1_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) (This)->lpVtbl->OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) #define ID3D10Device1_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) (This)->lpVtbl->OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) #define ID3D10Device1_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) (This)->lpVtbl->SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) #define ID3D10Device1_RSGetState(This,ppRasterizerState) (This)->lpVtbl->RSGetState(This,ppRasterizerState) #define ID3D10Device1_RSGetViewports(This,NumViewports,pViewports) (This)->lpVtbl->RSGetViewports(This,NumViewports,pViewports) #define ID3D10Device1_RSGetScissorRects(This,NumRects,pRects) (This)->lpVtbl->RSGetScissorRects(This,NumRects,pRects) #define ID3D10Device1_GetDeviceRemovedReason(This) (This)->lpVtbl->GetDeviceRemovedReason(This) #define ID3D10Device1_SetExceptionMode(This,RaiseFlags) (This)->lpVtbl->SetExceptionMode(This,RaiseFlags) #define ID3D10Device1_GetExceptionMode(This) (This)->lpVtbl->GetExceptionMode(This) #define ID3D10Device1_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData) #define ID3D10Device1_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData) #define ID3D10Device1_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData) #define ID3D10Device1_ClearState(This) (This)->lpVtbl->ClearState(This) #define ID3D10Device1_Flush(This) (This)->lpVtbl->Flush(This) #define ID3D10Device1_CreateBuffer(This,pDesc,pInitialData,ppBuffer) (This)->lpVtbl->CreateBuffer(This,pDesc,pInitialData,ppBuffer) #define ID3D10Device1_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) (This)->lpVtbl->CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) #define ID3D10Device1_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) (This)->lpVtbl->CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) #define ID3D10Device1_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) (This)->lpVtbl->CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) #define ID3D10Device1_CreateShaderResourceView(This,pResource,pDesc,ppSRView) (This)->lpVtbl->CreateShaderResourceView(This,pResource,pDesc,ppSRView) #define ID3D10Device1_CreateRenderTargetView(This,pResource,pDesc,ppRTView) (This)->lpVtbl->CreateRenderTargetView(This,pResource,pDesc,ppRTView) #define ID3D10Device1_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) (This)->lpVtbl->CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) #define ID3D10Device1_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) (This)->lpVtbl->CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) #define ID3D10Device1_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) (This)->lpVtbl->CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) #define ID3D10Device1_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) (This)->lpVtbl->CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) #define ID3D10Device1_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) (This)->lpVtbl->CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) #define ID3D10Device1_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) (This)->lpVtbl->CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) #define ID3D10Device1_CreateBlendState(This,pBlendStateDesc,ppBlendState) (This)->lpVtbl->CreateBlendState(This,pBlendStateDesc,ppBlendState) #define ID3D10Device1_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) (This)->lpVtbl->CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) #define ID3D10Device1_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) (This)->lpVtbl->CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) #define ID3D10Device1_CreateSamplerState(This,pSamplerDesc,ppSamplerState) (This)->lpVtbl->CreateSamplerState(This,pSamplerDesc,ppSamplerState) #define ID3D10Device1_CreateQuery(This,pQueryDesc,ppQuery) (This)->lpVtbl->CreateQuery(This,pQueryDesc,ppQuery) #define ID3D10Device1_CreatePredicate(This,pPredicateDesc,ppPredicate) (This)->lpVtbl->CreatePredicate(This,pPredicateDesc,ppPredicate) #define ID3D10Device1_CreateCounter(This,pCounterDesc,ppCounter) (This)->lpVtbl->CreateCounter(This,pCounterDesc,ppCounter) #define ID3D10Device1_CheckFormatSupport(This,Format,pFormatSupport) (This)->lpVtbl->CheckFormatSupport(This,Format,pFormatSupport) #define ID3D10Device1_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) (This)->lpVtbl->CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) #define ID3D10Device1_CheckCounterInfo(This,pCounterInfo) (This)->lpVtbl->CheckCounterInfo(This,pCounterInfo) #define ID3D10Device1_CheckCounter(This,pDesc,pType,pActiveCounters,name,pNameLength,units,pUnitsLength,description,pDescriptionLength) (This)->lpVtbl->CheckCounter(This,pDesc,pType,pActiveCounters,name,pNameLength,units,pUnitsLength,description,pDescriptionLength) #define ID3D10Device1_GetCreationFlags(This) (This)->lpVtbl->GetCreationFlags(This) #define ID3D10Device1_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) (This)->lpVtbl->OpenSharedResource(This,hResource,ReturnedInterface,ppResource) #define ID3D10Device1_SetTextFilterSize(This,Width,Height) (This)->lpVtbl->SetTextFilterSize(This,Width,Height) #define ID3D10Device1_GetTextFilterSize(This,pWidth,pHeight) (This)->lpVtbl->GetTextFilterSize(This,pWidth,pHeight) /*** ID3D10Device1 methods ***/ #define ID3D10Device1_CreateShaderResourceView1(This,pResource,pDesc,ppSRView) (This)->lpVtbl->CreateShaderResourceView1(This,pResource,pDesc,ppSRView) #define ID3D10Device1_CreateBlendState1(This,pBlendStateDesc,ppBlendState) (This)->lpVtbl->CreateBlendState1(This,pBlendStateDesc,ppBlendState) #define ID3D10Device1_GetFeatureLevel(This) (This)->lpVtbl->GetFeatureLevel(This) #else /*** IUnknown methods ***/ static FORCEINLINE HRESULT ID3D10Device1_QueryInterface(ID3D10Device1* This,REFIID riid,void **ppvObject) { return This->lpVtbl->QueryInterface(This,riid,ppvObject); } static FORCEINLINE ULONG ID3D10Device1_AddRef(ID3D10Device1* This) { return This->lpVtbl->AddRef(This); } static FORCEINLINE ULONG ID3D10Device1_Release(ID3D10Device1* This) { return This->lpVtbl->Release(This); } /*** ID3D10Device methods ***/ static FORCEINLINE void ID3D10Device1_VSSetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer *const *ppConstantBuffers) { This->lpVtbl->VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_PSSetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView *const *ppShaderResourceViews) { This->lpVtbl->PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_PSSetShader(ID3D10Device1* This,ID3D10PixelShader *pPixelShader) { This->lpVtbl->PSSetShader(This,pPixelShader); } static FORCEINLINE void ID3D10Device1_PSSetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState *const *ppSamplers) { This->lpVtbl->PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_VSSetShader(ID3D10Device1* This,ID3D10VertexShader *pVertexShader) { This->lpVtbl->VSSetShader(This,pVertexShader); } static FORCEINLINE void ID3D10Device1_DrawIndexed(ID3D10Device1* This,UINT IndexCount,UINT StartIndexLocation,INT BaseVertexLocation) { This->lpVtbl->DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation); } static FORCEINLINE void ID3D10Device1_Draw(ID3D10Device1* This,UINT VertexCount,UINT StartVertexLocation) { This->lpVtbl->Draw(This,VertexCount,StartVertexLocation); } static FORCEINLINE void ID3D10Device1_PSSetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer *const *ppConstantBuffers) { This->lpVtbl->PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_IASetInputLayout(ID3D10Device1* This,ID3D10InputLayout *pInputLayout) { This->lpVtbl->IASetInputLayout(This,pInputLayout); } static FORCEINLINE void ID3D10Device1_IASetVertexBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer *const *ppVertexBuffers,const UINT *pStrides,const UINT *pOffsets) { This->lpVtbl->IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets); } static FORCEINLINE void ID3D10Device1_IASetIndexBuffer(ID3D10Device1* This,ID3D10Buffer *pIndexBuffer,DXGI_FORMAT Format,UINT Offset) { This->lpVtbl->IASetIndexBuffer(This,pIndexBuffer,Format,Offset); } static FORCEINLINE void ID3D10Device1_DrawIndexedInstanced(ID3D10Device1* This,UINT IndexCountPerInstance,UINT InstanceCount,UINT StartIndexLocation,INT BaseVertexLocation,UINT StartInstanceLocation) { This->lpVtbl->DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation); } static FORCEINLINE void ID3D10Device1_DrawInstanced(ID3D10Device1* This,UINT VertexCountPerInstance,UINT InstanceCount,UINT StartVertexLocation,UINT StartInstanceLocation) { This->lpVtbl->DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation); } static FORCEINLINE void ID3D10Device1_GSSetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer *const *ppConstantBuffers) { This->lpVtbl->GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_GSSetShader(ID3D10Device1* This,ID3D10GeometryShader *pShader) { This->lpVtbl->GSSetShader(This,pShader); } static FORCEINLINE void ID3D10Device1_IASetPrimitiveTopology(ID3D10Device1* This,D3D10_PRIMITIVE_TOPOLOGY Topology) { This->lpVtbl->IASetPrimitiveTopology(This,Topology); } static FORCEINLINE void ID3D10Device1_VSSetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView *const *ppShaderResourceViews) { This->lpVtbl->VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_VSSetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState *const *ppSamplers) { This->lpVtbl->VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_SetPredication(ID3D10Device1* This,ID3D10Predicate *pPredicate,WINBOOL PredicateValue) { This->lpVtbl->SetPredication(This,pPredicate,PredicateValue); } static FORCEINLINE void ID3D10Device1_GSSetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView *const *ppShaderResourceViews) { This->lpVtbl->GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_GSSetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState *const *ppSamplers) { This->lpVtbl->GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_OMSetRenderTargets(ID3D10Device1* This,UINT NumViews,ID3D10RenderTargetView *const *ppRenderTargetViews,ID3D10DepthStencilView *pDepthStencilView) { This->lpVtbl->OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView); } static FORCEINLINE void ID3D10Device1_OMSetBlendState(ID3D10Device1* This,ID3D10BlendState *pBlendState,const FLOAT BlendFactor[4],UINT SampleMask) { This->lpVtbl->OMSetBlendState(This,pBlendState,BlendFactor,SampleMask); } static FORCEINLINE void ID3D10Device1_OMSetDepthStencilState(ID3D10Device1* This,ID3D10DepthStencilState *pDepthStencilState,UINT StencilRef) { This->lpVtbl->OMSetDepthStencilState(This,pDepthStencilState,StencilRef); } static FORCEINLINE void ID3D10Device1_SOSetTargets(ID3D10Device1* This,UINT NumBuffers,ID3D10Buffer *const *ppSOTargets,const UINT *pOffsets) { This->lpVtbl->SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets); } static FORCEINLINE void ID3D10Device1_DrawAuto(ID3D10Device1* This) { This->lpVtbl->DrawAuto(This); } static FORCEINLINE void ID3D10Device1_RSSetState(ID3D10Device1* This,ID3D10RasterizerState *pRasterizerState) { This->lpVtbl->RSSetState(This,pRasterizerState); } static FORCEINLINE void ID3D10Device1_RSSetViewports(ID3D10Device1* This,UINT NumViewports,const D3D10_VIEWPORT *pViewports) { This->lpVtbl->RSSetViewports(This,NumViewports,pViewports); } static FORCEINLINE void ID3D10Device1_RSSetScissorRects(ID3D10Device1* This,UINT NumRects,const D3D10_RECT *pRects) { This->lpVtbl->RSSetScissorRects(This,NumRects,pRects); } static FORCEINLINE void ID3D10Device1_CopySubresourceRegion(ID3D10Device1* This,ID3D10Resource *pDstResource,UINT DstSubresource,UINT DstX,UINT DstY,UINT DstZ,ID3D10Resource *pSrcResource,UINT SrcSubresource,const D3D10_BOX *pSrcBox) { This->lpVtbl->CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox); } static FORCEINLINE void ID3D10Device1_CopyResource(ID3D10Device1* This,ID3D10Resource *pDstResource,ID3D10Resource *pSrcResource) { This->lpVtbl->CopyResource(This,pDstResource,pSrcResource); } static FORCEINLINE void ID3D10Device1_UpdateSubresource(ID3D10Device1* This,ID3D10Resource *pDstResource,UINT DstSubresource,const D3D10_BOX *pDstBox,const void *pSrcData,UINT SrcRowPitch,UINT SrcDepthPitch) { This->lpVtbl->UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch); } static FORCEINLINE void ID3D10Device1_ClearRenderTargetView(ID3D10Device1* This,ID3D10RenderTargetView *pRenderTargetView,const FLOAT ColorRGBA[4]) { This->lpVtbl->ClearRenderTargetView(This,pRenderTargetView,ColorRGBA); } static FORCEINLINE void ID3D10Device1_ClearDepthStencilView(ID3D10Device1* This,ID3D10DepthStencilView *pDepthStencilView,UINT ClearFlags,FLOAT Depth,UINT8 Stencil) { This->lpVtbl->ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil); } static FORCEINLINE void ID3D10Device1_GenerateMips(ID3D10Device1* This,ID3D10ShaderResourceView *pShaderResourceView) { This->lpVtbl->GenerateMips(This,pShaderResourceView); } static FORCEINLINE void ID3D10Device1_ResolveSubresource(ID3D10Device1* This,ID3D10Resource *pDstResource,UINT DstSubresource,ID3D10Resource *pSrcResource,UINT SrcSubresource,DXGI_FORMAT Format) { This->lpVtbl->ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format); } static FORCEINLINE void ID3D10Device1_VSGetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer **ppConstantBuffers) { This->lpVtbl->VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_PSGetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView **ppShaderResourceViews) { This->lpVtbl->PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_PSGetShader(ID3D10Device1* This,ID3D10PixelShader **ppPixelShader) { This->lpVtbl->PSGetShader(This,ppPixelShader); } static FORCEINLINE void ID3D10Device1_PSGetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState **ppSamplers) { This->lpVtbl->PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_VSGetShader(ID3D10Device1* This,ID3D10VertexShader **ppVertexShader) { This->lpVtbl->VSGetShader(This,ppVertexShader); } static FORCEINLINE void ID3D10Device1_PSGetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer **ppConstantBuffers) { This->lpVtbl->PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_IAGetInputLayout(ID3D10Device1* This,ID3D10InputLayout **ppInputLayout) { This->lpVtbl->IAGetInputLayout(This,ppInputLayout); } static FORCEINLINE void ID3D10Device1_IAGetVertexBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer **ppVertexBuffers,UINT *pStrides,UINT *pOffsets) { This->lpVtbl->IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets); } static FORCEINLINE void ID3D10Device1_IAGetIndexBuffer(ID3D10Device1* This,ID3D10Buffer **pIndexBuffer,DXGI_FORMAT *Format,UINT *Offset) { This->lpVtbl->IAGetIndexBuffer(This,pIndexBuffer,Format,Offset); } static FORCEINLINE void ID3D10Device1_GSGetConstantBuffers(ID3D10Device1* This,UINT StartSlot,UINT NumBuffers,ID3D10Buffer **ppConstantBuffers) { This->lpVtbl->GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers); } static FORCEINLINE void ID3D10Device1_GSGetShader(ID3D10Device1* This,ID3D10GeometryShader **ppGeometryShader) { This->lpVtbl->GSGetShader(This,ppGeometryShader); } static FORCEINLINE void ID3D10Device1_IAGetPrimitiveTopology(ID3D10Device1* This,D3D10_PRIMITIVE_TOPOLOGY *pTopology) { This->lpVtbl->IAGetPrimitiveTopology(This,pTopology); } static FORCEINLINE void ID3D10Device1_VSGetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView **ppShaderResourceViews) { This->lpVtbl->VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_VSGetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState **ppSamplers) { This->lpVtbl->VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_GetPredication(ID3D10Device1* This,ID3D10Predicate **ppPredicate,WINBOOL *pPredicateValue) { This->lpVtbl->GetPredication(This,ppPredicate,pPredicateValue); } static FORCEINLINE void ID3D10Device1_GSGetShaderResources(ID3D10Device1* This,UINT StartSlot,UINT NumViews,ID3D10ShaderResourceView **ppShaderResourceViews) { This->lpVtbl->GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews); } static FORCEINLINE void ID3D10Device1_GSGetSamplers(ID3D10Device1* This,UINT StartSlot,UINT NumSamplers,ID3D10SamplerState **ppSamplers) { This->lpVtbl->GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers); } static FORCEINLINE void ID3D10Device1_OMGetRenderTargets(ID3D10Device1* This,UINT NumViews,ID3D10RenderTargetView **ppRenderTargetViews,ID3D10DepthStencilView **ppDepthStencilView) { This->lpVtbl->OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView); } static FORCEINLINE void ID3D10Device1_OMGetBlendState(ID3D10Device1* This,ID3D10BlendState **ppBlendState,FLOAT BlendFactor[4],UINT *pSampleMask) { This->lpVtbl->OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask); } static FORCEINLINE void ID3D10Device1_OMGetDepthStencilState(ID3D10Device1* This,ID3D10DepthStencilState **ppDepthStencilState,UINT *pStencilRef) { This->lpVtbl->OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef); } static FORCEINLINE void ID3D10Device1_SOGetTargets(ID3D10Device1* This,UINT NumBuffers,ID3D10Buffer **ppSOTargets,UINT *pOffsets) { This->lpVtbl->SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets); } static FORCEINLINE void ID3D10Device1_RSGetState(ID3D10Device1* This,ID3D10RasterizerState **ppRasterizerState) { This->lpVtbl->RSGetState(This,ppRasterizerState); } static FORCEINLINE void ID3D10Device1_RSGetViewports(ID3D10Device1* This,UINT *NumViewports,D3D10_VIEWPORT *pViewports) { This->lpVtbl->RSGetViewports(This,NumViewports,pViewports); } static FORCEINLINE void ID3D10Device1_RSGetScissorRects(ID3D10Device1* This,UINT *NumRects,D3D10_RECT *pRects) { This->lpVtbl->RSGetScissorRects(This,NumRects,pRects); } static FORCEINLINE HRESULT ID3D10Device1_GetDeviceRemovedReason(ID3D10Device1* This) { return This->lpVtbl->GetDeviceRemovedReason(This); } static FORCEINLINE HRESULT ID3D10Device1_SetExceptionMode(ID3D10Device1* This,UINT RaiseFlags) { return This->lpVtbl->SetExceptionMode(This,RaiseFlags); } static FORCEINLINE UINT ID3D10Device1_GetExceptionMode(ID3D10Device1* This) { return This->lpVtbl->GetExceptionMode(This); } static FORCEINLINE HRESULT ID3D10Device1_GetPrivateData(ID3D10Device1* This,REFGUID guid,UINT *pDataSize,void *pData) { return This->lpVtbl->GetPrivateData(This,guid,pDataSize,pData); } static FORCEINLINE HRESULT ID3D10Device1_SetPrivateData(ID3D10Device1* This,REFGUID guid,UINT DataSize,const void *pData) { return This->lpVtbl->SetPrivateData(This,guid,DataSize,pData); } static FORCEINLINE HRESULT ID3D10Device1_SetPrivateDataInterface(ID3D10Device1* This,REFGUID guid,const IUnknown *pData) { return This->lpVtbl->SetPrivateDataInterface(This,guid,pData); } static FORCEINLINE void ID3D10Device1_ClearState(ID3D10Device1* This) { This->lpVtbl->ClearState(This); } static FORCEINLINE void ID3D10Device1_Flush(ID3D10Device1* This) { This->lpVtbl->Flush(This); } static FORCEINLINE HRESULT ID3D10Device1_CreateBuffer(ID3D10Device1* This,const D3D10_BUFFER_DESC *pDesc,const D3D10_SUBRESOURCE_DATA *pInitialData,ID3D10Buffer **ppBuffer) { return This->lpVtbl->CreateBuffer(This,pDesc,pInitialData,ppBuffer); } static FORCEINLINE HRESULT ID3D10Device1_CreateTexture1D(ID3D10Device1* This,const D3D10_TEXTURE1D_DESC *pDesc,const D3D10_SUBRESOURCE_DATA *pInitialData,ID3D10Texture1D **ppTexture1D) { return This->lpVtbl->CreateTexture1D(This,pDesc,pInitialData,ppTexture1D); } static FORCEINLINE HRESULT ID3D10Device1_CreateTexture2D(ID3D10Device1* This,const D3D10_TEXTURE2D_DESC *pDesc,const D3D10_SUBRESOURCE_DATA *pInitialData,ID3D10Texture2D **ppTexture2D) { return This->lpVtbl->CreateTexture2D(This,pDesc,pInitialData,ppTexture2D); } static FORCEINLINE HRESULT ID3D10Device1_CreateTexture3D(ID3D10Device1* This,const D3D10_TEXTURE3D_DESC *pDesc,const D3D10_SUBRESOURCE_DATA *pInitialData,ID3D10Texture3D **ppTexture3D) { return This->lpVtbl->CreateTexture3D(This,pDesc,pInitialData,ppTexture3D); } static FORCEINLINE HRESULT ID3D10Device1_CreateShaderResourceView(ID3D10Device1* This,ID3D10Resource *pResource,const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,ID3D10ShaderResourceView **ppSRView) { return This->lpVtbl->CreateShaderResourceView(This,pResource,pDesc,ppSRView); } static FORCEINLINE HRESULT ID3D10Device1_CreateRenderTargetView(ID3D10Device1* This,ID3D10Resource *pResource,const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,ID3D10RenderTargetView **ppRTView) { return This->lpVtbl->CreateRenderTargetView(This,pResource,pDesc,ppRTView); } static FORCEINLINE HRESULT ID3D10Device1_CreateDepthStencilView(ID3D10Device1* This,ID3D10Resource *pResource,const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,ID3D10DepthStencilView **ppDepthStencilView) { return This->lpVtbl->CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView); } static FORCEINLINE HRESULT ID3D10Device1_CreateInputLayout(ID3D10Device1* This,const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,UINT NumElements,const void *pShaderBytecodeWithInputSignature,SIZE_T BytecodeLength,ID3D10InputLayout **ppInputLayout) { return This->lpVtbl->CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout); } static FORCEINLINE HRESULT ID3D10Device1_CreateVertexShader(ID3D10Device1* This,const void *pShaderBytecode,SIZE_T BytecodeLength,ID3D10VertexShader **ppVertexShader) { return This->lpVtbl->CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader); } static FORCEINLINE HRESULT ID3D10Device1_CreateGeometryShader(ID3D10Device1* This,const void *pShaderBytecode,SIZE_T BytecodeLength,ID3D10GeometryShader **ppGeometryShader) { return This->lpVtbl->CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader); } static FORCEINLINE HRESULT ID3D10Device1_CreateGeometryShaderWithStreamOutput(ID3D10Device1* This,const void *pShaderBytecode,SIZE_T BytecodeLength,const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,UINT NumEntries,UINT OutputStreamStride,ID3D10GeometryShader **ppGeometryShader) { return This->lpVtbl->CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader); } static FORCEINLINE HRESULT ID3D10Device1_CreatePixelShader(ID3D10Device1* This,const void *pShaderBytecode,SIZE_T BytecodeLength,ID3D10PixelShader **ppPixelShader) { return This->lpVtbl->CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader); } static FORCEINLINE HRESULT ID3D10Device1_CreateBlendState(ID3D10Device1* This,const D3D10_BLEND_DESC *pBlendStateDesc,ID3D10BlendState **ppBlendState) { return This->lpVtbl->CreateBlendState(This,pBlendStateDesc,ppBlendState); } static FORCEINLINE HRESULT ID3D10Device1_CreateDepthStencilState(ID3D10Device1* This,const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,ID3D10DepthStencilState **ppDepthStencilState) { return This->lpVtbl->CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState); } static FORCEINLINE HRESULT ID3D10Device1_CreateRasterizerState(ID3D10Device1* This,const D3D10_RASTERIZER_DESC *pRasterizerDesc,ID3D10RasterizerState **ppRasterizerState) { return This->lpVtbl->CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState); } static FORCEINLINE HRESULT ID3D10Device1_CreateSamplerState(ID3D10Device1* This,const D3D10_SAMPLER_DESC *pSamplerDesc,ID3D10SamplerState **ppSamplerState) { return This->lpVtbl->CreateSamplerState(This,pSamplerDesc,ppSamplerState); } static FORCEINLINE HRESULT ID3D10Device1_CreateQuery(ID3D10Device1* This,const D3D10_QUERY_DESC *pQueryDesc,ID3D10Query **ppQuery) { return This->lpVtbl->CreateQuery(This,pQueryDesc,ppQuery); } static FORCEINLINE HRESULT ID3D10Device1_CreatePredicate(ID3D10Device1* This,const D3D10_QUERY_DESC *pPredicateDesc,ID3D10Predicate **ppPredicate) { return This->lpVtbl->CreatePredicate(This,pPredicateDesc,ppPredicate); } static FORCEINLINE HRESULT ID3D10Device1_CreateCounter(ID3D10Device1* This,const D3D10_COUNTER_DESC *pCounterDesc,ID3D10Counter **ppCounter) { return This->lpVtbl->CreateCounter(This,pCounterDesc,ppCounter); } static FORCEINLINE HRESULT ID3D10Device1_CheckFormatSupport(ID3D10Device1* This,DXGI_FORMAT Format,UINT *pFormatSupport) { return This->lpVtbl->CheckFormatSupport(This,Format,pFormatSupport); } static FORCEINLINE HRESULT ID3D10Device1_CheckMultisampleQualityLevels(ID3D10Device1* This,DXGI_FORMAT Format,UINT SampleCount,UINT *pNumQualityLevels) { return This->lpVtbl->CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels); } static FORCEINLINE void ID3D10Device1_CheckCounterInfo(ID3D10Device1* This,D3D10_COUNTER_INFO *pCounterInfo) { This->lpVtbl->CheckCounterInfo(This,pCounterInfo); } static FORCEINLINE HRESULT ID3D10Device1_CheckCounter(ID3D10Device1* This,const D3D10_COUNTER_DESC *pDesc,D3D10_COUNTER_TYPE *pType,UINT *pActiveCounters,char *name,UINT *pNameLength,char *units,UINT *pUnitsLength,char *description,UINT *pDescriptionLength) { return This->lpVtbl->CheckCounter(This,pDesc,pType,pActiveCounters,name,pNameLength,units,pUnitsLength,description,pDescriptionLength); } static FORCEINLINE UINT ID3D10Device1_GetCreationFlags(ID3D10Device1* This) { return This->lpVtbl->GetCreationFlags(This); } static FORCEINLINE HRESULT ID3D10Device1_OpenSharedResource(ID3D10Device1* This,HANDLE hResource,REFIID ReturnedInterface,void **ppResource) { return This->lpVtbl->OpenSharedResource(This,hResource,ReturnedInterface,ppResource); } static FORCEINLINE void ID3D10Device1_SetTextFilterSize(ID3D10Device1* This,UINT Width,UINT Height) { This->lpVtbl->SetTextFilterSize(This,Width,Height); } static FORCEINLINE void ID3D10Device1_GetTextFilterSize(ID3D10Device1* This,UINT *pWidth,UINT *pHeight) { This->lpVtbl->GetTextFilterSize(This,pWidth,pHeight); } /*** ID3D10Device1 methods ***/ static FORCEINLINE HRESULT ID3D10Device1_CreateShaderResourceView1(ID3D10Device1* This,ID3D10Resource *pResource,const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc,ID3D10ShaderResourceView1 **ppSRView) { return This->lpVtbl->CreateShaderResourceView1(This,pResource,pDesc,ppSRView); } static FORCEINLINE HRESULT ID3D10Device1_CreateBlendState1(ID3D10Device1* This,const D3D10_BLEND_DESC1 *pBlendStateDesc,ID3D10BlendState1 **ppBlendState) { return This->lpVtbl->CreateBlendState1(This,pBlendStateDesc,ppBlendState); } static FORCEINLINE D3D10_FEATURE_LEVEL1 ID3D10Device1_GetFeatureLevel(ID3D10Device1* This) { return This->lpVtbl->GetFeatureLevel(This); } #endif #endif #endif #endif /* __ID3D10Device1_INTERFACE_DEFINED__ */ #define D3D10_1_SDK_VERSION (0x20) HRESULT WINAPI D3D10CreateDevice1(IDXGIAdapter*,D3D10_DRIVER_TYPE, HMODULE,UINT,D3D10_FEATURE_LEVEL1,UINT,ID3D10Device1**); HRESULT __stdcall D3D10CreateDeviceAndSwapChain1(IDXGIAdapter *adapter,enum D3D10_DRIVER_TYPE driver_type,HMODULE swrast,UINT flags,D3D10_FEATURE_LEVEL1 feature_level,UINT sdk_version,DXGI_SWAP_CHAIN_DESC *swapchain_desc,IDXGISwapChain **swapchain,ID3D10Device1 **device); /* Begin additional prototypes for all interfaces */ /* End additional prototypes */ #ifdef __cplusplus } #endif #endif /* __d3d10_1_h__ */
5686db71fed5ffe9491457d6d972ba9054b3d7aa
485741c6f00d939c2a1bc5011d01f5666325b0dd
/uspace/include/vserver.h
467a9a41a0035cc91fcafb249ef701246db4c834
[]
no_license
frankfanslc/ustack
f623881cb6d6327741969758fe2caedd329c68d6
7fb7296601c3f92827fa0ae8d24e41e4af71edf6
refs/heads/master
2022-02-12T12:03:59.888457
2016-10-09T22:09:22
2016-10-09T22:09:22
null
0
0
null
null
null
null
UTF-8
C
false
false
581
h
vserver.h
#ifndef _VSERVER_H #define _VSERVER_H #include "common/types.h" #include "types/local_ip.h" #include "types/vserver.h" #define VS_IS_TCP(vs) (vs->protocol == PROTO_TCP) int vserver_module_init(); struct vserver * vserver_lookup(struct ip_address * ip, u16 port, u8 protocol, struct local_ip ** vs_lip); struct vserver * vserver_create(struct server_pool * p, u16 port, u8 protocol, u8 is_fullnat); void vserver_free(struct vserver * vs); int vserver_add_ip(struct vserver * vs, struct local_ip * lip ); struct server * vserver_get_server(struct vserver * vs); #endif
9ef2731b302b50e2d16b7ba0284cf2936a61b251
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/reactos/boot/freeldr/freeldr/lib/mm/extr_heap.c_FrLdrHeapDestroy.c
fb1db73fce999de4a15141127ff784731297ae65
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
1,426
c
extr_heap.c_FrLdrHeapDestroy.c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ VOID ; typedef int ULONG_PTR ; struct TYPE_5__ {int MaximumSize; } ; typedef TYPE_1__* PVOID ; typedef TYPE_1__* PHEAP ; typedef int /*<<< orphan*/ PFN_COUNT ; /* Variables and functions */ int /*<<< orphan*/ LoaderFirmwareTemporary ; int MM_PAGE_SIZE ; int /*<<< orphan*/ MmMarkPagesInLookupTable (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ PageLookupTableAddress ; int /*<<< orphan*/ RtlFillMemory (TYPE_1__*,int,int) ; VOID FrLdrHeapDestroy( PVOID HeapHandle) { PHEAP Heap = HeapHandle; /* Mark all pages as firmware temporary, so they are free for the kernel */ MmMarkPagesInLookupTable(PageLookupTableAddress, (ULONG_PTR)Heap / MM_PAGE_SIZE, (PFN_COUNT)(Heap->MaximumSize / MM_PAGE_SIZE), LoaderFirmwareTemporary); #if DBG /* Make sure everything is dead */ RtlFillMemory(Heap, Heap->MaximumSize, 0xCCCCCCCC); #endif }
1f565fdba4075fa0909302d398a5155f907bce50
b6bd0bab6806300558edad02d8242a995ac5a66c
/nemu/src/cpu/instr/inc.c
1cde9097fcad2f366a5f9b3ac1726bfd3e79f063
[]
no_license
Chilliii/nju_ics_pa2018fall
c80f9565813045f0d422cfe3d3f7deb147ed4750
6979531b54234ddc5e3b0c26cba0ebd3f6df9b0b
refs/heads/master
2020-12-13T05:08:51.184435
2019-02-03T09:29:27
2019-02-03T09:29:27
null
0
0
null
null
null
null
UTF-8
C
false
false
273
c
inc.c
#include "cpu/instr.h" static void instr_execute_1op(){ operand_read(&opr_src); int cf = cpu.eflags.CF; opr_src.val = alu_add(1, opr_src.val, data_size); cpu.eflags.CF = cf; operand_write(&opr_src); } make_instr_impl_1op(inc, rm, v); make_instr_impl_1op(inc, r, v);
da0c80e543dec4e02bda74e3564ea012d3e4d332
7c99d96b3261d29f67b575d4fce12fe95534e8a0
/utils/hashmap.h
9b4febb31c8c15758c2fabca1171f98089bc8b0c
[]
no_license
braydnm/CAOS
16124662edf1890897ba3a6856abbe629c1b400f
37bb049e22f67a42eb6237dc4ffbf7fd2c44ccef
refs/heads/master
2022-07-03T20:21:10.708122
2020-03-26T03:07:42
2022-06-26T03:32:22
230,808,373
0
0
null
null
null
null
UTF-8
C
false
false
1,333
h
hashmap.h
#ifndef OS_HASHMAP_H #define OS_HASHMAP_H #include "../kernel/kernel.h" typedef unsigned int (*hashmap_hash_t) (void * key); typedef int (*hashmap_comp_t) (void * a, void * b); typedef void (*hashmap_free_t) (void *); typedef void * (*hashmap_dupe_t) (void *); typedef struct hashmap_entry { char * key; void * value; struct hashmap_entry * next; } hashmap_entry_t; typedef struct hashmap { hashmap_hash_t hash_func; hashmap_comp_t hash_comp; hashmap_dupe_t hash_key_dup; hashmap_free_t hash_key_free; hashmap_free_t hash_val_free; size_t size; hashmap_entry_t ** entries; } hashmap_t; extern hashmap_t * hashmap_create(int size); extern hashmap_t * hashmap_create_int(int size); extern void * hashmap_set(hashmap_t * map, void * key, void * value); extern void * hashmap_get(hashmap_t * map, void * key); extern void * hashmap_remove(hashmap_t * map, void * key); extern int hashmap_has(hashmap_t * map, void * key); extern list_t * hashmap_keys(hashmap_t * map); extern list_t * hashmap_values(hashmap_t * map); extern void hashmap_free(hashmap_t * map); extern unsigned int hashmap_string_hash(void * key); extern int hashmap_string_comp(void * a, void * b); extern void * hashmap_string_dupe(void * key); extern int hashmap_is_empty(hashmap_t * map); #endif //OS_HASHMAP_H
862423b1a6eec4b1c308c9413e587bd9bc404abb
48de496dc490bd9abcc4560180f4ebe07aff9bf6
/zjunix/include/zjunix/vfs/err.h
1cf587fb59017e98f3fba682d6941012bf62e180
[ "BSD-3-Clause" ]
permissive
ZJU-OS-Group/Operation-System
7c54f499a946c6cea2dae3b7062b7bafc7164302
e574bbfe0f132e0e0c5a1a9e2aa3962f15ef189d
refs/heads/dev
2020-04-01T00:54:04.341721
2019-01-16T01:09:49
2019-01-16T01:09:49
152,717,981
0
0
null
2018-11-16T11:16:13
2018-10-12T08:23:18
C
UTF-8
C
false
false
552
h
err.h
#ifndef OPERATION_SYSTEM_ERR_H #define OPERATION_SYSTEM_ERR_H #include <zjunix/vfs/errno.h> #include <zjunix/type.h> #define MAX_ERRNO 4095 #define IS_ERR_VALUE(x) ((x) >= (u32)-MAX_ERRNO) // 判断是不是错误指针或者空指针 static inline u32 IS_ERR_OR_NULL(const void *ptr){ return (!ptr) || IS_ERR_VALUE((u32)ptr); } static inline u32 PTR_ERR(const void *ptr){ return (u32) ptr; } static inline u32 IS_ERR(const void *ptr){ return IS_ERR_VALUE((u32)ptr); } static inline void * ERR_PTR(u32 error){ return (void *) error; } #endif
59767f5770c2b285af1d73c46143a7673da000ee
21b6341754d1b8c1563643c86c2e81ccd783843b
/include/nuttx/usb/rndis.h
aa637faae8a8baa8d3177a65085f8a4a66e398bd
[ "HPND", "LicenseRef-scancode-warranty-disclaimer", "MIT-0", "GPL-1.0-or-later", "HPND-sell-variant", "LicenseRef-scancode-bsd-atmel", "MIT-open-group", "ISC", "Apache-2.0", "LicenseRef-scancode-other-permissive", "BSD-2-Clause", "BSD-3-Clause", "MIT", "CC-BY-4.0", "CC-BY-2.0" ]
permissive
lambdaconcept/incubator-nuttx
74b731b2c3fb01e9cd5f290c8085d597c924828b
940c5b69c36fd1210ada473a5665e4c83420be77
refs/heads/master
2021-07-12T02:50:55.038996
2021-04-28T07:51:50
2021-04-29T10:19:44
248,243,157
2
0
Apache-2.0
2020-03-18T13:44:45
2020-03-18T13:44:44
null
UTF-8
C
false
false
6,229
h
rndis.h
/**************************************************************************** * include/nuttx/usb/rndis.h * * Copyright (C) 2011-2018 Gregory Nutt. All rights reserved. * Authors: Sakari Kapanen <sakari.m.kapanen@gmail.com>, * Petteri Aimonen <jpa@git.mail.kapsi.fi> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX 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. * ****************************************************************************/ #ifndef __INCLUDE_NUTTX_USB_RNDIS_H #define __INCLUDE_NUTTX_USB_RNDIS_H /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <nuttx/usb/usbdev.h> /**************************************************************************** * Preprocessor definitions ****************************************************************************/ /* Indexes for devinfo.epno[] array. * Used for composite device configuration. */ #define RNDIS_EP_INTIN_IDX (0) #define RNDIS_EP_BULKIN_IDX (1) #define RNDIS_EP_BULKOUT_IDX (2) /* Endpoint configuration ***************************************************/ #define RNDIS_MKEPINTIN(desc) (USB_DIR_IN | (desc)->epno[RNDIS_EP_INTIN_IDX]) #define RNDIS_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT) #define RNDIS_MKEPBULKIN(desc) (USB_DIR_IN | (desc)->epno[RNDIS_EP_BULKIN_IDX]) #define RNDIS_EPOUTBULK_ATTR (USB_EP_ATTR_XFER_BULK) #define RNDIS_MKEPBULKOUT(desc) ((desc)->epno[RNDIS_EP_BULKOUT_IDX]) #define RNDIS_EPINBULK_ATTR (USB_EP_ATTR_XFER_BULK) #ifndef CONFIG_RNDIS_EPINTIN_FSSIZE # define CONFIG_RNDIS_EPINTIN_FSSIZE 16 #endif #ifndef CONFIG_RNDIS_EPINTIN_HSSIZE # define CONFIG_RNDIS_EPINTIN_HSSIZE 16 #endif #ifndef CONFIG_RNDIS_EPBULKIN_FSSIZE # define CONFIG_RNDIS_EPBULKIN_FSSIZE 64 #endif #ifndef CONFIG_RNDIS_EPBULKIN_HSSIZE # define CONFIG_RNDIS_EPBULKIN_HSSIZE 512 #endif #ifndef CONFIG_RNDIS_EPBULKOUT_FSSIZE # define CONFIG_RNDIS_EPBULKOUT_FSSIZE 64 #endif #ifndef CONFIG_RNDIS_EPBULKOUT_HSSIZE # define CONFIG_RNDIS_EPBULKOUT_HSSIZE 512 #endif /**************************************************************************** * Public Data ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) # define EXTERN extern "C" extern "C" { #else # define EXTERN extern #endif /**************************************************************************** * Public Functions Definitions ****************************************************************************/ /**************************************************************************** * Name: usbdev_rndis_initialize * * Description: * Register RNDIS USB device interface. * Register the corresponding network driver to NuttX and bring up the * network. * * Input Parameters: * mac_address: an array of 6 bytes which make the MAC address of the host * side of the network. * * Returned Value: * 0 on success; -errno on failure * ****************************************************************************/ #ifndef CONFIG_RNDIS_COMPOSITE int usbdev_rndis_initialize(FAR const uint8_t *mac_address); #endif /**************************************************************************** * Name: usbdev_rndis_set_host_mac_addr * * Description: * Set host MAC address. Mainly for use with composite devices where * the MAC cannot be given directly to usbdev_rndis_initialize(). * * Input Parameters: * netdev: pointer to the network interface. Can be obtained from * e.g. netdev_findbyname(). * * mac_address: pointer to an array of six octets which is the MAC address * of the host side of the interface. May be NULL to use the * default MAC address. * * Returned Value: * 0 on success, -errno on failure * ****************************************************************************/ int usbdev_rndis_set_host_mac_addr(FAR struct net_driver_s *netdev, FAR const uint8_t *mac_address); /**************************************************************************** * Name: usbdev_rndis_get_composite_devdesc * * Description: * Helper function to fill in some constants into the composite * configuration struct. * * Input Parameters: * dev - Pointer to the configuration struct we should fill * * Returned Value: * None * ****************************************************************************/ #ifdef CONFIG_RNDIS_COMPOSITE void usbdev_rndis_get_composite_devdesc(struct composite_devdesc_s *dev); #endif #undef EXTERN #if defined(__cplusplus) } #endif #endif /* __INCLUDE_NUTTX_USB_RNDIS_H */
c11bc8de7da968c2f3c48a0c434c3f39eeb7e707
3e049ac72a94cca272e907a1840d0aed1f37644e
/c tutorials/elearn/Tutorial47/Tutorial47A.c
028404d3fd20b166a06d5d4901ef4dac276cb28e
[]
no_license
Brotin003/Programming
1fa13c71e10bb378e3d6551cf486c51b0a511581
70e36a29d43bae9ef7cacf2859330529216323e8
refs/heads/master
2022-12-18T11:10:00.369121
2020-10-01T09:33:14
2020-10-01T09:33:14
300,222,675
0
0
null
2020-10-01T09:30:44
2020-10-01T09:30:43
null
UTF-8
C
false
false
563
c
Tutorial47A.c
//FUNCTIONS FOR FILE I/O // ****1.READING A FILE**** // it means only for reading the .txt file //we have to use a _ (underscore) insted of wide space ...... to print all .txt file.....and we have to use a _ (underscore) in every wide space for print all txt file in compiler...if we dont use under score then it will print only one word #include <stdio.h> int main() { FILE *ptr = NULL; char string[64]; ptr = fopen("Tutorial47A.txt", "r"); fscanf(ptr, "%s", string); printf("The content of this file has %s\n", string); return 0; }
db4f1c9892925a99996cb7c75126e7a11656e73c
e87162ea84a47319e27155ad594e3e220e397841
/bitlock/libbtc/utils.c
a76158ff22572a14fe4759c5710dc63cd73d4bb8
[]
no_license
vaulto-wallet/senselock-firmware
5bb3480fdcd14eae00b70b6469de6ef8dea33fce
5493a0c688fb0c9ee015403d30a1776ba67004ca
refs/heads/master
2020-07-13T14:55:46.390974
2019-08-29T07:33:08
2019-08-29T07:33:08
205,102,313
0
0
null
null
null
null
UTF-8
C
false
false
667
c
utils.c
#include <stdio.h> #include <stdlib.h> #include <string.h> void utils_bin_to_hex(unsigned char* bin_in, size_t inlen, char* hex_out) { static char digits[] = "0123456789abcdef"; size_t i; for (i = 0; i < inlen; i++) { hex_out[i * 2] = digits[(bin_in[i] >> 4) & 0xF]; hex_out[i * 2 + 1] = digits[bin_in[i] & 0xF]; } hex_out[inlen * 2] = '\0'; } void assert(unsigned int res){ return; } void *btc_mem_zero(volatile void *dst, size_t len){ memset(dst, 0, len); } void btc_random_init(void){ return; } unsigned int btc_random_bytes(uint8_t* buf, uint32_t len, const uint8_t update_seed){ memset(buf, 1, len); return 1; }
d405f7436987dbcf4f40dbbe70238e16798e7131
8c636e103ffd9d0cf807931a38f6edd07ae717ad
/src/crypto/ecp2_BN254.c
db6e5844b5ee30c8ca3a69d5e7bd29a03fb34ae8
[ "Apache-2.0" ]
permissive
andyyzh/SecureUnionID
31f17a98b7449b76295aab4120a28a07372ef18f
dc9d340f1c25f2a514ee8ab4513b85bd350b95b1
refs/heads/main
2023-03-12T03:37:49.344355
2021-03-02T12:06:57
2021-03-02T12:06:57
345,005,669
0
0
Apache-2.0
2021-03-06T04:34:44
2021-03-06T04:34:43
null
UTF-8
C
false
false
19,495
c
ecp2_BN254.c
/* AMCL Weierstrass elliptic curve functions over FP2 */ /* SU=m, m is Stack Usage */ #include "ecp2_BN254.h" #include "ecp_BN254.h" int ECP2_BN254_isinf(ECP2_BN254 *P) { return (FP2_BN254_iszilch(&(P->x)) & FP2_BN254_iszilch(&(P->z))); } /* Set P=Q */ /* SU= 16 */ void ECP2_BN254_copy(ECP2_BN254 *P, ECP2_BN254 *Q) { FP2_BN254_copy(&(P->x), &(Q->x)); FP2_BN254_copy(&(P->y), &(Q->y)); FP2_BN254_copy(&(P->z), &(Q->z)); } /* set P to Infinity */ /* SU= 8 */ void ECP2_BN254_inf(ECP2_BN254 *P) { FP2_BN254_zero(&(P->x)); FP2_BN254_one(&(P->y)); FP2_BN254_zero(&(P->z)); } /* Conditional move Q to P dependant on d */ static void ECP2_BN254_cmove(ECP2_BN254 *P, ECP2_BN254 *Q, int d) { FP2_BN254_cmove(&(P->x), &(Q->x), d); FP2_BN254_cmove(&(P->y), &(Q->y), d); FP2_BN254_cmove(&(P->z), &(Q->z), d); } /* return 1 if b==c, no branching */ static int ECP2_teq(sign32 b, sign32 c) { sign32 x = b ^c; x -= 1; // if x=0, x now -1 return (int) ((x >> 31) & 1); } /* Constant time select from pre-computed table */ static void ECP2_BN254_select(ECP2_BN254 *P, ECP2_BN254 W[], sign32 b) { ECP2_BN254 MP; sign32 m = b >> 31; sign32 babs = (b ^ m) - m; babs = (babs - 1) / 2; ECP2_BN254_cmove(P, &W[0], ECP2_teq(babs, 0)); // conditional move ECP2_BN254_cmove(P, &W[1], ECP2_teq(babs, 1)); ECP2_BN254_cmove(P, &W[2], ECP2_teq(babs, 2)); ECP2_BN254_cmove(P, &W[3], ECP2_teq(babs, 3)); ECP2_BN254_cmove(P, &W[4], ECP2_teq(babs, 4)); ECP2_BN254_cmove(P, &W[5], ECP2_teq(babs, 5)); ECP2_BN254_cmove(P, &W[6], ECP2_teq(babs, 6)); ECP2_BN254_cmove(P, &W[7], ECP2_teq(babs, 7)); ECP2_BN254_copy(&MP, P); ECP2_BN254_neg(&MP); // minus P ECP2_BN254_cmove(P, &MP, (int) (m & 1)); } /* return 1 if P==Q, else 0 */ /* SU= 312 */ int ECP2_BN254_equals(ECP2_BN254 *P, ECP2_BN254 *Q) { FP2_BN254 a, b; FP2_BN254_mul(&a, &(P->x), &(Q->z)); FP2_BN254_mul(&b, &(Q->x), &(P->z)); if (!FP2_BN254_equals(&a, &b)) return 0; FP2_BN254_mul(&a, &(P->y), &(Q->z)); FP2_BN254_mul(&b, &(Q->y), &(P->z)); if (!FP2_BN254_equals(&a, &b)) return 0; return 1; } /* Make P affine (so z=1) */ /* SU= 232 */ void ECP2_BN254_affine(ECP2_BN254 *P) { FP2_BN254 one, iz; if (ECP2_BN254_isinf(P)) return; FP2_BN254_one(&one); if (FP2_BN254_isunity(&(P->z))) { FP2_BN254_reduce(&(P->x)); FP2_BN254_reduce(&(P->y)); return; } FP2_BN254_inv(&iz, &(P->z)); FP2_BN254_mul(&(P->x), &(P->x), &iz); FP2_BN254_mul(&(P->y), &(P->y), &iz); FP2_BN254_reduce(&(P->x)); FP2_BN254_reduce(&(P->y)); FP2_BN254_copy(&(P->z), &one); } /* extract x, y from point P */ /* SU= 16 */ int ECP2_BN254_get(FP2_BN254 *x, FP2_BN254 *y, ECP2_BN254 *P) { ECP2_BN254 W; ECP2_BN254_copy(&W, P); ECP2_BN254_affine(&W); if (ECP2_BN254_isinf(&W)) return -1; FP2_BN254_copy(y, &(W.y)); FP2_BN254_copy(x, &(W.x)); return 0; } /* SU= 152 */ /* Output point P */ void ECP2_BN254_output(ECP2_BN254 *P) { FP2_BN254 x, y; if (ECP2_BN254_isinf(P)) { printf("Infinity\n"); return; } ECP2_BN254_get(&x, &y, P); printf("("); FP2_BN254_output(&x); printf(","); FP2_BN254_output(&y); printf(")\n"); } /* SU= 232 */ void ECP2_BN254_outputxyz(ECP2_BN254 *P) { ECP2_BN254 Q; if (ECP2_BN254_isinf(P)) { printf("Infinity\n"); return; } ECP2_BN254_copy(&Q, P); printf("("); FP2_BN254_output(&(Q.x)); printf(","); FP2_BN254_output(&(Q.y)); printf(","); FP2_BN254_output(&(Q.z)); printf(")\n"); } /* SU= 168 */ /* Convert Q to octet string */ void ECP2_BN254_toOctet(octet *W, ECP2_BN254 *Q) { BIG_256_56 b; FP2_BN254 qx, qy; ECP2_BN254_get(&qx, &qy, Q); FP_BN254_redc(b, &(qx.a)); BIG_256_56_toBytes(&(W->val[0]), b); FP_BN254_redc(b, &(qx.b)); BIG_256_56_toBytes(&(W->val[MODBYTES_256_56]), b); FP_BN254_redc(b, &(qy.a)); BIG_256_56_toBytes(&(W->val[2 * MODBYTES_256_56]), b); FP_BN254_redc(b, &(qy.b)); BIG_256_56_toBytes(&(W->val[3 * MODBYTES_256_56]), b); W->len = 4 * MODBYTES_256_56; } /* SU= 176 */ /* restore Q from octet string */ int ECP2_BN254_fromOctet(ECP2_BN254 *Q, octet *W) { BIG_256_56 b; FP2_BN254 qx, qy; BIG_256_56_fromBytes(b, &(W->val[0])); FP_BN254_nres(&(qx.a), b); BIG_256_56_fromBytes(b, &(W->val[MODBYTES_256_56])); FP_BN254_nres(&(qx.b), b); BIG_256_56_fromBytes(b, &(W->val[2 * MODBYTES_256_56])); FP_BN254_nres(&(qy.a), b); BIG_256_56_fromBytes(b, &(W->val[3 * MODBYTES_256_56])); FP_BN254_nres(&(qy.b), b); if (ECP2_BN254_set(Q, &qx, &qy)) return 1; return 0; } /* SU= 128 */ /* Calculate RHS of twisted curve equation x^3+B/i or x^3+Bi*/ void ECP2_BN254_rhs(FP2_BN254 *rhs, FP2_BN254 *x) { /* calculate RHS of elliptic curve equation */ FP2_BN254 t; BIG_256_56 b; FP2_BN254_sqr(&t, x); FP2_BN254_mul(rhs, &t, x); /* Assuming CURVE_A=0 */ BIG_256_56_rcopy(b, CURVE_B_BN254); FP2_BN254_from_BIG(&t, b); #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_div_ip(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ #endif #if SEXTIC_TWIST_BN254 == M_TYPE FP2_BN254_norm(&t); FP2_BN254_mul_ip(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ FP2_BN254_norm(&t); #endif FP2_BN254_add(rhs, &t, rhs); FP2_BN254_reduce(rhs); } /* Set P=(x,y). Return 1 if (x,y) is on the curve, else return 0*/ /* SU= 232 */ int ECP2_BN254_set(ECP2_BN254 *P, FP2_BN254 *x, FP2_BN254 *y) { FP2_BN254 rhs, y2; FP2_BN254_sqr(&y2, y); ECP2_BN254_rhs(&rhs, x); if (!FP2_BN254_equals(&y2, &rhs)) { ECP2_BN254_inf(P); return 0; } FP2_BN254_copy(&(P->x), x); FP2_BN254_copy(&(P->y), y); FP2_BN254_one(&(P->z)); return 1; } /* Set P=(x,y). Return 1 if (x,.) is on the curve, else return 0 */ /* SU= 232 */ int ECP2_BN254_setx(ECP2_BN254 *P, FP2_BN254 *x) { FP2_BN254 y; ECP2_BN254_rhs(&y, x); if (!FP2_BN254_sqrt(&y, &y)) { ECP2_BN254_inf(P); return 0; } FP2_BN254_copy(&(P->x), x); FP2_BN254_copy(&(P->y), &y); FP2_BN254_one(&(P->z)); return 1; } /* Set P=-P */ /* SU= 8 */ void ECP2_BN254_neg(ECP2_BN254 *P) { FP2_BN254_norm(&(P->y)); FP2_BN254_neg(&(P->y), &(P->y)); FP2_BN254_norm(&(P->y)); } /* R+=R */ /* return -1 for Infinity, 0 for addition, 1 for doubling */ /* SU= 448 */ int ECP2_BN254_dbl(ECP2_BN254 *P) { FP2_BN254 t0, t1, t2, iy, x3, y3; FP2_BN254_copy(&iy, &(P->y)); //FP2 iy=new FP2(y); #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_mul_ip(&iy); //iy.mul_ip(); FP2_BN254_norm(&iy); //iy.norm(); #endif FP2_BN254_sqr(&t0, &(P->y)); //t0.sqr(); #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_mul_ip(&t0); //t0.mul_ip(); #endif FP2_BN254_mul(&t1, &iy, &(P->z)); //t1.mul(z); FP2_BN254_sqr(&t2, &(P->z)); //t2.sqr(); FP2_BN254_add(&(P->z), &t0, &t0); //z.add(t0); FP2_BN254_norm(&(P->z)); //z.norm(); FP2_BN254_add(&(P->z), &(P->z), &(P->z)); //z.add(z); FP2_BN254_add(&(P->z), &(P->z), &(P->z)); //z.add(z); FP2_BN254_norm(&(P->z)); //z.norm(); FP2_BN254_imul(&t2, &t2, 3 * CURVE_B_I_BN254); //t2.imul(3*ROM.CURVE_B_I); #if SEXTIC_TWIST_BN254 == M_TYPE FP2_BN254_mul_ip(&t2); FP2_BN254_norm(&t2); #endif FP2_BN254_mul(&x3, &t2, &(P->z)); //x3.mul(z); FP2_BN254_add(&y3, &t0, &t2); //y3.add(t2); FP2_BN254_norm(&y3); //y3.norm(); FP2_BN254_mul(&(P->z), &(P->z), &t1); //z.mul(t1); FP2_BN254_add(&t1, &t2, &t2); //t1.add(t2); FP2_BN254_add(&t2, &t2, &t1); //t2.add(t1); FP2_BN254_norm(&t2); //t2.norm(); FP2_BN254_sub(&t0, &t0, &t2); //t0.sub(t2); FP2_BN254_norm(&t0); //t0.norm(); //y^2-9bz^2 FP2_BN254_mul(&y3, &y3, &t0); //y3.mul(t0); FP2_BN254_add(&(P->y), &y3, &x3); //y3.add(x3); //(y^2+3z*2)(y^2-9z^2)+3b.z^2.8y^2 FP2_BN254_mul(&t1, &(P->x), &iy); //t1.mul(iy); // FP2_BN254_norm(&t0); //x.norm(); FP2_BN254_mul(&(P->x), &t0, &t1); //x.mul(t1); FP2_BN254_add(&(P->x), &(P->x), &(P->x)); //x.add(x); //(y^2-9bz^2)xy2 FP2_BN254_norm(&(P->x)); //x.norm(); FP2_BN254_norm(&(P->y)); //y.norm(); return 1; } /* Set P+=Q */ /* SU= 400 */ int ECP2_BN254_add(ECP2_BN254 *P, ECP2_BN254 *Q) { FP2_BN254 t0, t1, t2, t3, t4, x3, y3, z3; int b3 = 3 * CURVE_B_I_BN254; FP2_BN254_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); // x.Q.x FP2_BN254_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); // y.Q.y FP2_BN254_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); FP2_BN254_add(&t3, &(P->x), &(P->y)); //t3.add(y); FP2_BN254_norm(&t3); //t3.norm(); //t3=X1+Y1 FP2_BN254_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); FP2_BN254_norm(&t4); //t4.norm(); //t4=X2+Y2 FP2_BN254_mul(&t3, &t3, &t4); //t3.mul(t4); //t3=(X1+Y1)(X2+Y2) FP2_BN254_add(&t4, &t0, &t1); //t4.add(t1); //t4=X1.X2+Y1.Y2 FP2_BN254_sub(&t3, &t3, &t4); //t3.sub(t4); FP2_BN254_norm(&t3); //t3.norm(); #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_mul_ip(&t3); //t3.mul_ip(); FP2_BN254_norm(&t3); //t3.norm(); //t3=(X1+Y1)(X2+Y2)-(X1.X2+Y1.Y2) = X1.Y2+X2.Y1 #endif FP2_BN254_add(&t4, &(P->y), &(P->z)); //t4.add(z); FP2_BN254_norm(&t4); //t4.norm(); //t4=Y1+Z1 FP2_BN254_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); FP2_BN254_norm(&x3); //x3.norm(); //x3=Y2+Z2 FP2_BN254_mul(&t4, &t4, &x3); //t4.mul(x3); //t4=(Y1+Z1)(Y2+Z2) FP2_BN254_add(&x3, &t1, &t2); //x3.add(t2); //X3=Y1.Y2+Z1.Z2 FP2_BN254_sub(&t4, &t4, &x3); //t4.sub(x3); FP2_BN254_norm(&t4); //t4.norm(); #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_mul_ip(&t4); //t4.mul_ip(); FP2_BN254_norm(&t4); //t4.norm(); //t4=(Y1+Z1)(Y2+Z2) - (Y1.Y2+Z1.Z2) = Y1.Z2+Y2.Z1 #endif FP2_BN254_add(&x3, &(P->x), &(P->z)); //x3.add(z); FP2_BN254_norm(&x3); //x3.norm(); // x3=X1+Z1 FP2_BN254_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); FP2_BN254_norm(&y3); //y3.norm(); // y3=X2+Z2 FP2_BN254_mul(&x3, &x3, &y3); //x3.mul(y3); // x3=(X1+Z1)(X2+Z2) FP2_BN254_add(&y3, &t0, &t2); //y3.add(t2); // y3=X1.X2+Z1+Z2 FP2_BN254_sub(&y3, &x3, &y3); //y3.rsub(x3); FP2_BN254_norm(&y3); //y3.norm(); // y3=(X1+Z1)(X2+Z2) - (X1.X2+Z1.Z2) = X1.Z2+X2.Z1 #if SEXTIC_TWIST_BN254 == D_TYPE FP2_BN254_mul_ip(&t0); //t0.mul_ip(); FP2_BN254_norm(&t0); //t0.norm(); // x.Q.x FP2_BN254_mul_ip(&t1); //t1.mul_ip(); FP2_BN254_norm(&t1); //t1.norm(); // y.Q.y #endif FP2_BN254_add(&x3, &t0, &t0); //x3.add(t0); FP2_BN254_add(&t0, &t0, &x3); //t0.add(x3); FP2_BN254_norm(&t0); //t0.norm(); FP2_BN254_imul(&t2, &t2, b3); //t2.imul(b); #if SEXTIC_TWIST_BN254 == M_TYPE FP2_BN254_mul_ip(&t2); FP2_BN254_norm(&t2); #endif FP2_BN254_add(&z3, &t1, &t2); //z3.add(t2); FP2_BN254_norm(&z3); //z3.norm(); FP2_BN254_sub(&t1, &t1, &t2); //t1.sub(t2); FP2_BN254_norm(&t1); //t1.norm(); FP2_BN254_imul(&y3, &y3, b3); //y3.imul(b); #if SEXTIC_TWIST_BN254 == M_TYPE FP2_BN254_mul_ip(&y3); FP2_BN254_norm(&y3); #endif FP2_BN254_mul(&x3, &y3, &t4); //x3.mul(t4); FP2_BN254_mul(&t2, &t3, &t1); //t2.mul(t1); FP2_BN254_sub(&(P->x), &t2, &x3); //x3.rsub(t2); FP2_BN254_mul(&y3, &y3, &t0); //y3.mul(t0); FP2_BN254_mul(&t1, &t1, &z3); //t1.mul(z3); FP2_BN254_add(&(P->y), &y3, &t1); //y3.add(t1); FP2_BN254_mul(&t0, &t0, &t3); //t0.mul(t3); FP2_BN254_mul(&z3, &z3, &t4); //z3.mul(t4); FP2_BN254_add(&(P->z), &z3, &t0); //z3.add(t0); FP2_BN254_norm(&(P->x)); //x.norm(); FP2_BN254_norm(&(P->y)); //y.norm(); FP2_BN254_norm(&(P->z)); //z.norm(); return 0; } /* Set P-=Q */ /* SU= 16 */ void ECP2_BN254_sub(ECP2_BN254 *P, ECP2_BN254 *Q) { ECP2_BN254 NQ; ECP2_BN254_copy(&NQ, Q); ECP2_BN254_neg(&NQ); ECP2_BN254_add(P, &NQ); } /* P*=e */ /* SU= 280 */ void ECP2_BN254_mul(ECP2_BN254 *P, BIG_256_56 e) { /* fixed size windows */ int i, nb, s, ns; BIG_256_56 mt, t; ECP2_BN254 Q, W[8], C; sign8 w[1 + (NLEN_256_56 * BASEBITS_256_56 + 3) / 4]; if (ECP2_BN254_isinf(P)) return; /* precompute table */ ECP2_BN254_copy(&Q, P); ECP2_BN254_dbl(&Q); ECP2_BN254_copy(&W[0], P); for (i = 1; i < 8; i++) { ECP2_BN254_copy(&W[i], &W[i - 1]); ECP2_BN254_add(&W[i], &Q); } /* make exponent odd - add 2P if even, P if odd */ BIG_256_56_copy(t, e); s = BIG_256_56_parity(t); BIG_256_56_inc(t, 1); BIG_256_56_norm(t); ns = BIG_256_56_parity(t); BIG_256_56_copy(mt, t); BIG_256_56_inc(mt, 1); BIG_256_56_norm(mt); BIG_256_56_cmove(t, mt, s); ECP2_BN254_cmove(&Q, P, ns); ECP2_BN254_copy(&C, &Q); nb = 1 + (BIG_256_56_nbits(t) + 3) / 4; /* convert exponent to signed 4-bit window */ for (i = 0; i < nb; i++) { w[i] = BIG_256_56_lastbits(t, 5) - 16; BIG_256_56_dec(t, w[i]); BIG_256_56_norm(t); BIG_256_56_fshr(t, 4); } w[nb] = BIG_256_56_lastbits(t, 5); ECP2_BN254_copy(P, &W[(w[nb] - 1) / 2]); for (i = nb - 1; i >= 0; i--) { ECP2_BN254_select(&Q, W, w[i]); ECP2_BN254_dbl(P); ECP2_BN254_dbl(P); ECP2_BN254_dbl(P); ECP2_BN254_dbl(P); ECP2_BN254_add(P, &Q); } ECP2_BN254_sub(P, &C); /* apply correction */ ECP2_BN254_affine(P); } /* Calculates q.P using Frobenius constant X */ /* SU= 96 */ void ECP2_BN254_frob(ECP2_BN254 *P, FP2_BN254 *X) { FP2_BN254 X2; FP2_BN254_sqr(&X2, X); FP2_BN254_conj(&(P->x), &(P->x)); FP2_BN254_conj(&(P->y), &(P->y)); FP2_BN254_conj(&(P->z), &(P->z)); FP2_BN254_reduce(&(P->z)); FP2_BN254_mul(&(P->x), &X2, &(P->x)); FP2_BN254_mul(&(P->y), &X2, &(P->y)); FP2_BN254_mul(&(P->y), X, &(P->y)); } // Bos & Costello https://eprint.iacr.org/2013/458.pdf // Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf // Side channel attack secure void ECP2_BN254_mul4(ECP2_BN254 *P, ECP2_BN254 Q[4], BIG_256_56 u[4]) { int i, j, k, nb, pb, bt; ECP2_BN254 T[8], W; BIG_256_56 t[4], mt; sign8 w[NLEN_256_56 * BASEBITS_256_56 + 1]; sign8 s[NLEN_256_56 * BASEBITS_256_56 + 1]; for (i = 0; i < 4; i++) { BIG_256_56_copy(t[i], u[i]); } // Precomputed table ECP2_BN254_copy(&T[0], &Q[0]); // Q[0] ECP2_BN254_copy(&T[1], &T[0]); ECP2_BN254_add(&T[1], &Q[1]); // Q[0]+Q[1] ECP2_BN254_copy(&T[2], &T[0]); ECP2_BN254_add(&T[2], &Q[2]); // Q[0]+Q[2] ECP2_BN254_copy(&T[3], &T[1]); ECP2_BN254_add(&T[3], &Q[2]); // Q[0]+Q[1]+Q[2] ECP2_BN254_copy(&T[4], &T[0]); ECP2_BN254_add(&T[4], &Q[3]); // Q[0]+Q[3] ECP2_BN254_copy(&T[5], &T[1]); ECP2_BN254_add(&T[5], &Q[3]); // Q[0]+Q[1]+Q[3] ECP2_BN254_copy(&T[6], &T[2]); ECP2_BN254_add(&T[6], &Q[3]); // Q[0]+Q[2]+Q[3] ECP2_BN254_copy(&T[7], &T[3]); ECP2_BN254_add(&T[7], &Q[3]); // Q[0]+Q[1]+Q[2]+Q[3] // Make it odd pb = 1 - BIG_256_56_parity(t[0]); BIG_256_56_inc(t[0], pb); BIG_256_56_norm(t[0]); // Number of bits BIG_256_56_zero(mt); for (i = 0; i < 4; i++) { BIG_256_56_or(mt, mt, t[i]); } nb = 1 + BIG_256_56_nbits(mt); // Sign pivot s[nb - 1] = 1; for (i = 0; i < nb - 1; i++) { BIG_256_56_fshr(t[0], 1); s[i] = 2 * BIG_256_56_parity(t[0]) - 1; } // Recoded exponent for (i = 0; i < nb; i++) { w[i] = 0; k = 1; for (j = 1; j < 4; j++) { bt = s[i] * BIG_256_56_parity(t[j]); BIG_256_56_fshr(t[j], 1); BIG_256_56_dec(t[j], (bt >> 1)); BIG_256_56_norm(t[j]); w[i] += bt * k; k *= 2; } } // Main loop ECP2_BN254_select(P, T, 2 * w[nb - 1] + 1); for (i = nb - 2; i >= 0; i--) { ECP2_BN254_select(&W, T, 2 * w[i] + s[i]); ECP2_BN254_dbl(P); ECP2_BN254_add(P, &W); } // apply correction ECP2_BN254_copy(&W, P); ECP2_BN254_sub(&W, &Q[0]); ECP2_BN254_cmove(P, &W, pb); ECP2_BN254_affine(P); } /* Map to hash value to point on G2 from random BIG */ void ECP2_BN254_mapit(ECP2_BN254 *Q, octet *W) { BIG_256_56 q, one, Fx, Fy, x, hv; FP2_BN254 X; #if (PAIRING_FRIENDLY_BN254 == BN) ECP2_BN254 T, K; #elif (PAIRING_FRIENDLY_BN254 == BLS) ECP2_BN254 xQ, x2Q; #endif BIG_256_56_fromBytes(hv, W->val); BIG_256_56_rcopy(q, Modulus_BN254); BIG_256_56_one(one); BIG_256_56_mod(hv, q); for (;;) { FP2_BN254_from_BIGs(&X, one, hv); if (ECP2_BN254_setx(Q, &X)) break; BIG_256_56_inc(hv, 1); } BIG_256_56_rcopy(Fx, Fra_BN254); BIG_256_56_rcopy(Fy, Frb_BN254); FP2_BN254_from_BIGs(&X, Fx, Fy); #if SEXTIC_TWIST_BN254 == M_TYPE FP2_BN254_inv(&X,&X); FP2_BN254_norm(&X); #endif BIG_256_56_rcopy(x, CURVE_Bnx_BN254); #if (PAIRING_FRIENDLY_BN254 == BN) /* Faster Hashing to G2 - Fuentes-Castaneda, Knapp and Rodriguez-Henriquez */ /* Q -> xQ + F(3xQ) + F(F(xQ)) + F(F(F(Q))). */ ECP2_BN254_copy(&T, Q); ECP2_BN254_mul(&T, x); #if SIGN_OF_X_BN254 == NEGATIVEX ECP2_BN254_neg(&T); // our x is negative #endif ECP2_BN254_copy(&K, &T); ECP2_BN254_dbl(&K); ECP2_BN254_add(&K, &T); ECP2_BN254_frob(&K, &X); ECP2_BN254_frob(Q, &X); ECP2_BN254_frob(Q, &X); ECP2_BN254_frob(Q, &X); ECP2_BN254_add(Q, &T); ECP2_BN254_add(Q, &K); ECP2_BN254_frob(&T, &X); ECP2_BN254_frob(&T, &X); ECP2_BN254_add(Q, &T); ECP2_BN254_affine(Q); #elif (PAIRING_FRIENDLY_BN254 == BLS) /* Efficient hash maps to G2 on BLS curves - Budroni, Pintore */ /* Q -> x2Q -xQ -Q +F(xQ -Q) +F(F(2Q)) */ ECP2_BN254_copy(&xQ,Q); ECP2_BN254_mul(&xQ,x); ECP2_BN254_copy(&x2Q,&xQ); ECP2_BN254_mul(&x2Q,x); #if SIGN_OF_X_BN254==NEGATIVEX ECP2_BN254_neg(&xQ); #endif ECP2_BN254_sub(&x2Q,&xQ); ECP2_BN254_sub(&x2Q,Q); ECP2_BN254_sub(&xQ,Q); ECP2_BN254_frob(&xQ,&X); ECP2_BN254_dbl(Q); ECP2_BN254_frob(Q,&X); ECP2_BN254_frob(Q,&X); ECP2_BN254_add(Q,&x2Q); ECP2_BN254_add(Q,&xQ); ECP2_BN254_affine(Q); #endif } void ECP2_BN254_generator(ECP2_BN254 *G) { FP2_BN254 wx, wy; FP_BN254_rcopy(&(wx.a), CURVE_Pxa_BN254); FP_BN254_rcopy(&(wx.b), CURVE_Pxb_BN254); FP_BN254_rcopy(&(wy.a), CURVE_Pya_BN254); FP_BN254_rcopy(&(wy.b), CURVE_Pyb_BN254); ECP2_BN254_set(G, &wx, &wy); }
2468037fdba6e8736f4fa4842d2f4b03bb2bc22a
28cc3fc74ec8d9817bb23cea1830947266acc1b3
/code_gen_ex1/defs.h
6d2eff4de9b830320474c892aeceb2e9defd7f88
[]
no_license
jcespinoza/compilers_class
67cc1a5778da372743a9f382b90adc314775f342
9b4073f7edce87dd1f7d65639564ceff783e621c
refs/heads/master
2021-01-01T17:04:26.321730
2017-09-11T00:23:16
2017-09-11T00:23:16
97,995,693
0
0
null
null
null
null
UTF-8
C
false
false
108
h
defs.h
#ifndef _DEFS_H #define _DEFS_H typedef union TokenType{ int int_t; char* char_t; } TokenType; #endif
064ed757aa3383fdffd28566142a6abfd801dd25
5ce37c7df2f417d5a27bf8d21b0ec110ff34ac80
/common.c
74d91cfdf59885359b5407f756ec5cee0f0a8930
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
QSCTech/door-access-control
61f2a9bc4948a39577d8fe668f687a1aa5177244
a1d64cc6369d8ae2253f6a933b946b7ab1db8f6e
refs/heads/master
2020-12-11T05:22:44.230576
2015-11-15T10:39:46
2015-11-15T10:39:46
46,212,829
5
2
null
2015-11-15T10:39:46
2015-11-15T10:12:21
C
UTF-8
C
false
false
7,043
c
common.c
/* * Copyright (C) 2014, 2015 Sen "Senorsen" Zhang <sen@senorsen.com> * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <errno.h> #include <sys/types.h> #include <time.h> #include <sys/time.h> #include "macros.h" #include "config.h" #include "common.h" int sockfd = -1; struct sockaddr_in adr_srvr; struct sockaddr_in adr_inet; struct sockaddr_in adr_clnt; void print_function(const char * function_name) { printf("[FUNCTION] %s\n", function_name); } uint16_t calc_checksum(uint8_t * data, uint16_t length) { uint16_t checksum = 0; int i; for (i = 1; i < length - 3; i++) { checksum += data[i]; } return checksum; } uint16_t write_checksum(uint8_t * data, uint16_t length) { uint16_t checksum; checksum = calc_checksum(data, length); data[length - 3] = checksum % 0x100; data[length - 2] = checksum / 0x100; return checksum; } uint16_t read_checksum(uint8_t * data, uint16_t length) { uint16_t checksum = 0; checksum = data[length - 3] + data[length - 2] * 0x100; return checksum; } int socket_init(int prog) { sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if UNLIKELY (sockfd == -1) { perror("socket error\n"); return 1; } in_addr_t addr = inet_addr(DOOR_IPADDR); if UNLIKELY (!prog) printf("Preparing data...\n"); /* build ip addr */ memset(&(adr_srvr), 0, sizeof(adr_srvr)); adr_srvr.sin_family = AF_INET; adr_srvr.sin_port = htons(DOOR_PORT); adr_srvr.sin_addr.s_addr = addr; struct timeval tv_out; tv_out.tv_sec = 10; // 超时时间 tv_out.tv_usec = 0; printf("[INFO] setsockopt = %d\n", setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv_out, sizeof(tv_out))); return 0; } void socket_end() { close(sockfd); } int process_data(int prog, uint8_t control[2], uint8_t data[], uint16_t length, uint8_t * rets, uint16_t * ret_length) { int i = 0; int z; unsigned int len; uint8_t buf[4096] = {0x7e}; // buf ready buf[1] = DOOR_SN_1; buf[2] = DOOR_SN_2; buf[3] = control[0]; buf[4] = control[1]; for (i = 0; i < length; i++) { buf[i + 5] = data[i]; } int total_length = 5 + length + 2 + 1; if LIKELY (total_length < 34) { // 小包规格 total_length = 34; } buf[total_length - 1] = 0x0d; write_checksum(buf, total_length); // 0x7e | serial | control | data | checksum | end if UNLIKELY (!prog) printf("Sending... "); z = sendto(sockfd, buf, total_length, 0, (struct sockaddr *)&adr_srvr, sizeof(adr_srvr)); if UNLIKELY (z == -1) { perror("sendto error\n"); return 1; } if UNLIKELY (!prog) printf("Sended & Pending\n"); len = sizeof(buf); z = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr *) &adr_srvr, &len); if UNLIKELY (z < 0) { perror("recvfrom error, may be network issues?\n"); return 1; } if UNLIKELY (!prog) printf("Ok\n"); total_length = z; *ret_length = total_length - 1 - 2 - 2 - 3; if UNLIKELY (!prog) printf("Checking... "); int succ = 1; if UNLIKELY (buf[0] != 0x7e) { succ = 0; perror("no 7e header\n"); } if UNLIKELY (buf[1] != DOOR_SN_1 || buf[2] != DOOR_SN_2) { succ = 0; perror("serial error\n"); } if UNLIKELY (buf[3] != control[0] || buf[4] != control[1]) { succ = 0; perror("control error\n"); } if UNLIKELY (calc_checksum(buf, total_length) != read_checksum(buf, total_length)) { succ = 0; perror("checksum error\n"); } if UNLIKELY (!succ) { perror("buf invalid\n"); return 1; } if UNLIKELY (!prog) printf("Ok\n"); memcpy(rets, buf + 5, *ret_length); return 0; } int dec_fake_hex(uint16_t n) { return n / 10 * 16 + n % 10; } void store_int16(uint16_t n, uint8_t * buf) { // 大端 buf[0] = n % 0x100; buf[1] = n / 0x100; } void store_int32(uint32_t n, uint8_t * buf) { buf[0] = n % 0x100; buf[1] = n % 0x10000 / 0x100; buf[2] = n % 0x1000000 / 0x10000; buf[3] = n / 0x1000000; } uint16_t convert_int16(uint8_t * buf) { return (uint16_t)buf[1] * 0x100 + buf[0]; } uint32_t convert_int32(uint8_t * buf) { return (uint32_t)buf[3] * 0x1000000 + (uint32_t)buf[2] * 0x10000 + (uint32_t)buf[1] * 0x100 + (uint32_t)buf[0] * 0x1; } int mask_check(uint8_t num, uint8_t pos) { // pos: 0 ~ 7 return !! (num & (1 << pos)); } void store_wiegand(uint32_t wiegand, uint8_t * buf) { store_int16(wiegand % 100000, buf); buf[2] = wiegand / 100000; } uint32_t read_card_wiegand(uint8_t * buf) { if LIKELY ((buf[0] & buf[1] & buf[2]) == 0xff) { return 0; } uint32_t ret, arg2, arg0; arg0 = convert_int16(buf); arg2 = buf[2]; ret = arg2 * 100000 + arg0; return ret; } uint32_t read_card_org_part(uint8_t * buf) { if LIKELY ((buf[0] & buf[1] & buf[2]) == 0xff) { return 0; } uint8_t new_buf[4] = {buf[0], buf[1], buf[2], 0}; return convert_int32(new_buf); } void store_wiegand_date(int type, int year, int month, int day, int hour, int minute, int second, uint8_t * buf) { // simulation for msDateToWgDate encode. buf[1] = year % 100 * 2 + month / 8; buf[0] = month / 8 * day; if UNLIKELY (type) { // 4 bytes with h:m:s buf[3] = hour * 8 + minute / 8; buf[2] = minute / 8 * 32 + second / 2; } } wgDate read_wiegand_date(uint8_t * buf) { // simulation for wgDataToMsDate decode. // bytes data struct: 2 2 2 2 uint32_t ymdh, ymdl, hmsh = 0, hmsl = 0; ymdh = *(buf + 1); ymdl = *(buf + 0); hmsh = *(buf + 3); hmsl = *(buf + 2); int num = (ymdh & 127) / 2; time_t now; struct tm * timenow; time(&now); timenow = localtime(&now); int year, month, day, hour, minute, second; wgDate date; year = timenow->tm_year + 1900; if UNLIKELY (year % 100 > 60 && num < 60) { num += 60; } if UNLIKELY (year < 2000) { year = 2000; } month = (ymdh % 2) * 8 + ymdl / 32; day = ymdl % 32; hour = hmsh / 8; minute = (hmsh % 8) * 8 + hmsl / 32; second = (hmsl % 32) * 2 + (ymdh > 128 ? 1 : 0); date.year = year; date.month = month; date.day = day; date.hour = hour; date.minute = minute; date.second = second; return date; }
fd44ffa0b90223b91577b70e4277cf9c47063b50
f3a9fb6af2032fd047cd906c6a14678444724b95
/WarOfScales/Point.c
249cde3f118cdc3a6753efa05398854843d2ffeb
[]
no_license
FluffyJay1/WarOfScales
be8a080507f77acb3f6a53a8b7345762231aa2ea
44c9bcbfc4e5229fecbe2af81aabdf0598e1b907
refs/heads/master
2021-01-15T11:03:57.756088
2019-11-29T23:30:15
2019-11-29T23:30:15
99,612,016
2
1
null
2017-09-08T20:44:54
2017-08-07T19:21:50
C
UTF-8
C
false
false
28,936
c
Point.c
#include "Point.h" #include <stdio.h> void Point_Init(Point* p) { p->x = 0; p->y = 0; p->z = 0; } inline Point* Point_Create(double x, double y, double z) { Point* p = malloc(sizeof(Point)); p->x = x; p->y = y; p->z = z; return p; } void SDL_Point_to_Point(Point* out, SDL_Point* point) { out->x = point->x; out->y = point->y; out->z = 0; } void Point_Copy(Point* output, Point* in) { /* Point input = *in; *output = input; */ memcpy(output, in, sizeof(Point)); } void Point_Add(Point* output, Point* p1, Point* p2) { output->x = p1->x + p2->x; output->y = p1->y + p2->y; output->z = p1->z + p2->z; } void Point_Subtract(Point* output, Point* p1, Point* p2) { output->x = p1->x - p2->x; output->y = p1->y - p2->y; output->z = p1->z - p2->z; } void Point_Multiply(Point* output, Point* p, double d) { output->x = p->x * d; output->y = p->y * d; output->z = p->z * d; } void Point_Multiply2D(Point* output, Point* p, double d) { output->x = p->x * d; output->y = p->y * d; output->z = p->z; } void Point_Dot(double* output, Point* p1, Point* p2) { *output = p1->x * p2->x + p1->y * p2->y + p1->z * p2->z; } void Point_Cross(Point* output, Point* p1, Point* p2) { Point *p = Point_Create(p1->y * p2->z - p1->z * p2->y, p1->z * p2->x - p1->x * p2->z, p1->x * p2->y - p1->y * p2->x); Point_Copy(output, p); } void Point_Rotate(Point* output, Point* p, double radians) { if (output != p) { output->x = p->x * cos(radians) - p->y * sin(radians); output->y = p->x * sin(radians) + p->y * cos(radians); output->z = p->z; } else { Point temp; temp.x = p->x * cos(radians) - p->y * sin(radians); temp.y = p->x * sin(radians) + p->y * cos(radians); temp.z = p->z; Point_Copy(output, &temp); } } void Point_Normalize(Point* output, Point* p) { if (Point_Magnitude(p) > 0) { Point_Multiply(output, p, 1 / Point_Magnitude(p)); } else { *output = (Point) { 0, 0, 0 }; } } void Point_Normalize2D(Point* output, Point* p) { if (Point_Magnitude2D(p) > 0) { Point_Multiply2D(output, p, 1 / Point_Magnitude2D(p)); } else { *output = (Point) { 0, 0, p->z }; } } void Point_Traverse(Point* output, Point* p1, Point* p2, double distance) { Point vec; Point_Subtract(&vec, p2, p1); Point_Normalize(&vec, &vec); Point_Multiply(&vec, &vec, distance); Point_Add(output, p1, &vec); } void Point_Traverse2D(Point* output, Point* p1, Point* p2, double distance) { Point vec; Point_Subtract(&vec, p2, p1); vec.z = 0; Point_Normalize(&vec, &vec); Point_Multiply(&vec, &vec, distance); Point_Add(output, p1, &vec); } void Point_MapToGrid(Point* output, Point* griddim, Point* mapdim, Point* pos, Point* in) { output->x = (in->x - pos->x) * griddim->x / mapdim->x; output->y = (in->y - pos->y) * griddim->y / mapdim->y; output->z = in->z; } void Point_GridToMap(Point* output, Point* griddim, Point* mapdim, Point* pos, Point* in) { output->x = in->x * mapdim->x / griddim->x + pos->x; output->y = in->y * mapdim->y / griddim->y + pos->y; output->z = in->z; } void Point_ToInt(Point* output, Point* in) { output->x = (int)in->x; output->y = (int)in->y; output->z = (int)in->z; } /* Format: Next 3 tokens are the points x y z */ void Point_GenerateFromData(Point* out, char* data, char** returnpointer) { char* sc = data; out->x = ParseDouble(sc, &sc); out->y = ParseDouble(sc + 1, &sc); out->z = ParseDouble(sc + 1, &sc); if (returnpointer) { *returnpointer = sc; } } BOOLEAN Point_IsLessThan2D(Point* p1, Point* p2) { return p1->x < p2->x && p1->y < p2->y ? TRUE : FALSE; } inline BOOLEAN Point_IsInsideCircle(Point* p, Point* circlepos, double radius) { return Point_Length(p, circlepos) < radius; } BOOLEAN SDL_Point_IsEqual(SDL_Point* left, SDL_Point* right) { return (left->x == right->x) && (left->y == right->y) ? TRUE : FALSE; } BOOLEAN Point_IsEqual(Point* left, Point* right) { return double_IsEqual(left->x, right->x) && double_IsEqual(left->y, right->y) && double_IsEqual(left->z, right->z) ? TRUE : FALSE; } BOOLEAN Point_IsInside2D(Point* dim, Point* p) { return p->x >= 0 && p->x < dim->x && p->y >= 0 && p->y < dim->y ? TRUE : FALSE; } double SDL_Point_Length(SDL_Point* p1, SDL_Point* p2) { return sqrt((double)(p2->x - p1->x) * (double)(p2->x - p1->x) + (double)(p2->y - p1->y) * (double)(p2->y - p1->y)); } inline double Point_Length(Point* p1, Point* p2) { return sqrt((p2->x - p1->x) * (p2->x - p1->x) + (p2->y - p1->y) * (p2->y - p1->y) + (p2->z - p1->z) * (p2->z - p1->z)); } double Point_Length2D(Point* p1, Point* p2) { return sqrt((p2->x - p1->x) * (p2->x - p1->x) + (p2->y - p1->y) * (p2->y - p1->y)); } inline double Point_LengthSquared(Point* p1, Point* p2) { return (p2->x - p1->x) * (p2->x - p1->x) + (p2->y - p1->y) * (p2->y - p1->y) + (p2->z - p1->z) * (p2->z - p1->z); } inline double Point_LengthSquared2D(Point* p1, Point* p2) { return (p2->x - p1->x) * (p2->x - p1->x) + (p2->y - p1->y) * (p2->y - p1->y); } double Point_Magnitude(Point* p) { return sqrt(p->x * p->x + p->y * p->y + p->z * p->z); } double Point_Magnitude2D(Point* p) { return sqrt(p->x * p->x + p->y * p->y); } void Point_Print(Point* p) { printf("Point %i: (%f, %f, %f)\n", p, p->x, p->y, p->z); } PointArray* PointArray_Create(int size) { PointArray* pa = malloc(sizeof(PointArray)); pa->points = malloc(sizeof(Point) * size); pa->size = size; return pa; } void PointArray_Copy(PointArray* out, PointArray* in) { int i; for (i = 0; i < in->size && i < out->size; i++) { Point_Copy(&out->points[i], &in->points[i]); } } void PointArray_Destroy(PointArray* pa) { free(pa->points); free(pa); } /* Format: First token "points" is how many points are For each point, the next 3 tokens are the point's x y z */ PointArray* PointArray_CreateFromData(char* data, char** returnpointer) { char* sc; int i, points = ParseInt(data, &sc); Point p; PointArray* pa = PointArray_Create(points); for (i = 0; i < points; i++) { Point_GenerateFromData(&p, sc + 1, &sc); pa->points[i] = p; } if (returnpointer) { *returnpointer = sc; } return pa; } inline Line* PointArray_GetLine(PointArray* pa, int lineindex) { return Line_Create(&pa->points[lineindex % pa->size], &pa->points[(lineindex + 1) % pa->size]); } void PointArray_GetLines(NodeList* out, PointArray* pa) { int i; if (out == NULL) { printf("Error in function PointArray_GetLines: output nodelist is null!"); } for (i = 0; i < pa->size; i++) { Node* n = Node_Create(); n->Geom.Line = PointArray_GetLine(pa, i); NodeList_AddNode(out, n); } } void PointArray_Rotate(PointArray* out, PointArray* in, double radians) { int i; if (out == NULL) { printf("Error in function PointArray_Rotate: output pointarray is null!"); } if (out->size < in->size) { printf("Error in function PointArray_Rotate: output pointarray is smaller than input!"); } for (i = 0; i < in->size; i++) { Point_Rotate(&out->points[i], &in->points[i], radians); } } Line* Line_Create(Point* p1, Point* p2) //compile the properties of a line so we don't have to repeatedly recalculate it { Line* l = malloc(sizeof(Line)); Line_CreateAt(l, p1, p2); return l; } void Line_CreateAt(Line* l, Point* p1, Point* p2) { Point_Copy(&l->p1, p1); Point_Copy(&l->p2, p2); if (p1->x < p2->x) { l->bound_left = p1->x; l->bound_right = p2->x; l->p1right = FALSE; } else { l->bound_left = p2->x; l->bound_right = p1->x; l->p1right = TRUE; } if (p1->y < p2->y) { l->bound_up = p1->y; l->bound_down = p2->y; l->p1down = FALSE; } else { l->bound_up = p2->y; l->bound_down = p1->y; l->p1down = TRUE; } if (double_IsEqual(p1->x, p2->x) || Point_IsEqual(p1, p2)) { l->vertical = TRUE; l->slope = INFINITY; } else { l->vertical = FALSE; l->slope = (p2->y - p1->y) / (p2->x - p1->x); } l->length = Point_Length2D(p1, p2); } void Line_Copy(Line* out, Line* in) { memcpy(out, in, sizeof(Line)); } /* Format: Next 6 tokens are the line's p1x, p1y, p1z, p2x, p2y, p2z, not necessarily integers */ void Line_GenerateFromData(Line* out, char* data, char** returnpointer) { char* sc = data; Point p1, p2; Point_GenerateFromData(&p1, sc, &sc); Point_GenerateFromData(&p2, sc + 1, &sc); Line_CreateAt(out, &p1, &p2); if (returnpointer) { *returnpointer = sc; } } /* Format: First token "times" is how many lines there are For each line, the next 6 tokens are the line's p1x, p1y, p1z, p2x, p2y, p2z, not necessarily integers */ void Line_GenerateListFromData(NodeList* n, char* data, char** returnpointer) { Node* linenode; char* sc; double p1x, p1y, p1z, p2x, p2y, p2z; int i, times = ParseInt(data, &sc); for (i = 0; i < times; i++) { linenode = Node_Create(); Line_GenerateFromData(linenode->Geom.Line, sc + 1, &sc); NodeList_AddNode(n, linenode); } if (returnpointer) { *returnpointer = sc; } } BOOLEAN Line_Collides(Point* out, Line* l1, Line* l2, BOOLEAN considerHeight) { Point ret; if ( !l1 || !l2 //either line is null || l1->bound_left > l2->bound_right || l1->bound_right < l2->bound_left || l1->bound_up > l2->bound_down || l1->bound_down < l2->bound_up || (considerHeight && l1->p1.z > l2->p1.z && l1->p2.z > l2->p1.z && l1->p1.z > l2->p2.z && l1->p2.z > l2->p2.z)) { return FALSE; } if (l1->vertical && l2->vertical) //same slopes, both vertical { if (double_IsEqual(l1->p1.x, l2->p1.x)) { out->x = l1->p1.x; out->y = abs((l1->bound_up > l2->bound_up ? l1->bound_up : l2->bound_up) - l1->p1.y) < abs((l1->bound_down < l2->bound_down ? l1->bound_down : l2->bound_down) - l1->p1.y) ? (l1->bound_up > l2->bound_up ? l1->bound_up : l2->bound_up) : (l1->bound_down < l2->bound_down ? l1->bound_down : l2->bound_down); return TRUE; } return FALSE; } else if (l1->vertical == FALSE && l2->vertical == FALSE && double_IsEqual(l1->slope, l2->slope)) //same slopes { if (double_IsEqual(l1->p1.y - l1->slope * l1->p1.x, l2->p1.y - l2->slope * l2->p1.x)) //same intercepts { if (abs((l1->bound_up > l2->bound_up ? l1->bound_up : l2->bound_up) - l1->p1.y) < abs((l1->bound_down < l2->bound_down ? l1->bound_down : l2->bound_down) - l1->p1.y)) { if (l1->bound_up > l2->bound_up) { Point_Copy(out, l1->p1down ? &l1->p2 : &l1->p1); } else { Point_Copy(out, l2->p1down ? &l2->p2 : &l2->p1); } } else { if (l1->bound_down < l2->bound_down) { Point_Copy(out, l1->p1down ? &l1->p1 : &l1->p2); } else { Point_Copy(out, l2->p1down ? &l2->p1 : &l2->p2); } } return TRUE; } return FALSE; } if (l1->vertical) { ret.x = l1->p1.x; ret.y = l2->slope * (ret.x - l2->p1.x) + l2->p1.y; } else if(l2->vertical) { ret.x = l2->p1.x; ret.y = l1->slope * (ret.x - l1->p1.x) + l1->p1.y; } else { ret.x = (l2->p1.y + l1->slope * l1->p1.x - l1->p1.y - l2->slope * l2->p1.x) / (l1->slope - l2->slope); ret.y = l1->slope * (ret.x - l1->p1.x) + l1->p1.y; } if (ret.x >= l1->bound_left && ret.x >= l2->bound_left && ret.x <= l1->bound_right && ret.x <= l2->bound_right && ret.y >= l1->bound_up && ret.y >= l2->bound_up && ret.y <= l1->bound_down && ret.y <= l2->bound_down && (!considerHeight || (Line_HeightAt(l1, &ret) <= Line_HeightAt(l2, &ret)))) { Point_Copy(out, &ret); return TRUE; } return FALSE; } /* outputs will be calculated if the pointers given aren't null outcoll is the entire list of collisions, grouped such that l1 collisions are together outcoll 1 is for if each line1 collides outcoll 2 is for if each line2 collides outpos is the entire list of collision locations outpos1 gives the collision location closest to l1's p1 outpos2 gives the collision location closest to l2's p1 outline1 gives the closest line that line1 collides with, only if outpos1 isn't null outline2 gives the closest line that line2 collides with, only if outpos2 isn't null */ void Line_CollidesBatch(BOOLEAN* outcoll, BOOLEAN* outcoll1, BOOLEAN* outcoll2, Point* outpos, Point* outpos1, Point* outpos2, Line** outline1, Line** outline2, NodeList* nl1, NodeList* nl2, BOOLEAN considerHeight) { if (usegpu) { Node *iterator, *iterator1, *iterator2; int i, ind1, ind2; //int index; BOOLEAN* outputcollides; double *outputx, *outputy, *l1p1x, *l1p1y, *l1p2x, *l1p2y, *l2p1x, *l2p1y, *l2p2x, *l2p2y, *l1slope, *l2slope, *l1bound_up, *l1bound_down, *l1bound_left, *l1bound_right, *l2bound_up, *l2bound_down, *l2bound_left, *l2bound_right, *l1p1z, *l1p2z, *l2p1z, *l2p2z; BOOLEAN *l1p1down, *l1vertical, *l2p1down, *l2vertical, *l1null, *l2null; size_t l1sized = sizeof(double) * nl1->listSize; size_t l1sizeb = sizeof(BOOLEAN) * nl1->listSize; size_t l2sized = sizeof(double) * nl2->listSize; size_t l2sizeb = sizeof(BOOLEAN) * nl2->listSize; opencl_global_item_size = nl1->listSize * nl2->listSize; opencl_local_item_size = nl2->listSize; //malloc everything outputcollides = malloc(sizeof(BOOLEAN) * nl1->listSize * nl2->listSize); outputx = malloc(sizeof(double) * nl1->listSize * nl2->listSize); outputy = malloc(sizeof(double) * nl1->listSize * nl2->listSize); #define X(k, v, j) k = malloc(v); LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X l1null = malloc(l1sizeb); l2null = malloc(l2sizeb); //write to arrays #define X(k, v, j, l) k[iterator->index] = iterator->Geom.Line->l; iterator = nl1->headNode; //index = 0; while (iterator != NULL) { if (iterator->Geom.Line) { LINECOLLISION_L1MAP(X); l1null[iterator->index] = FALSE; } else { l1null[iterator->index] = TRUE; } iterator = iterator->nextNode; //index++; } iterator = nl2->headNode; //index = 0; while (iterator != NULL) { if (iterator->Geom.Line) { LINECOLLISION_L2MAP(X); l2null[iterator->index] = FALSE; } else { l2null[iterator->index] = TRUE; } iterator = iterator->nextNode; //index++; } #undef X //create memobjs outputcollides_memobj = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(BOOLEAN) * nl1->listSize * nl2->listSize, NULL, &ret); CL_PRDEBUG; outputx_memobj = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(double) * nl1->listSize * nl2->listSize, NULL, &ret); CL_PRDEBUG; outputy_memobj = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(double) * nl1->listSize * nl2->listSize, NULL, &ret); CL_PRDEBUG; #define X(k, v, j) l_mem[j] = clCreateBuffer(context, CL_MEM_READ_ONLY, v, NULL, &ret); CL_PRDEBUG; LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X considerHeight_memobj = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(BOOLEAN), NULL, &ret); l1null_memobj = clCreateBuffer(context, CL_MEM_READ_ONLY, l1sizeb, NULL, &ret); l2null_memobj = clCreateBuffer(context, CL_MEM_READ_ONLY, l2sizeb, NULL, &ret); //write to memobjs #define X(k, v, j) ret = clEnqueueWriteBuffer(command_queue, l_mem[j], CL_TRUE, 0, v, k, 0, NULL, NULL); LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X ret = clEnqueueWriteBuffer(command_queue, considerHeight_memobj, CL_TRUE, 0, sizeof(BOOLEAN), &considerHeight, 0, NULL, NULL); ret = clEnqueueWriteBuffer(command_queue, l1null_memobj, CL_TRUE, 0, l1sizeb, l1null, 0, NULL, NULL); ret = clEnqueueWriteBuffer(command_queue, l2null_memobj, CL_TRUE, 0, l2sizeb, l2null, 0, NULL, NULL); //set args ret = clSetKernelArg(kernels[LineCollision], 0, sizeof(cl_mem), (void *)&outputcollides_memobj); CL_PRDEBUG; ret = clSetKernelArg(kernels[LineCollision], 1, sizeof(cl_mem), (void *)&outputx_memobj); CL_PRDEBUG; ret = clSetKernelArg(kernels[LineCollision], 2, sizeof(cl_mem), (void *)&outputy_memobj); CL_PRDEBUG; #define X(k, v, j, l, i) ret = clSetKernelArg(kernels[LineCollision], i, sizeof(cl_mem), (void *)&l_mem[j]); CL_PRDEBUG; LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X ret = clSetKernelArg(kernels[LineCollision], 29, sizeof(cl_mem), (void *)&considerHeight_memobj); CL_PRDEBUG; ret = clSetKernelArg(kernels[LineCollision], 30, sizeof(cl_mem), (void *)&l1null_memobj); CL_PRDEBUG; ret = clSetKernelArg(kernels[LineCollision], 31, sizeof(cl_mem), (void *)&l2null_memobj); CL_PRDEBUG; //do the shit ret = clEnqueueNDRangeKernel(command_queue, kernels[LineCollision], 1, NULL, &opencl_global_item_size, &opencl_local_item_size, 0, NULL, NULL); CL_PRDEBUG; //read the stuff ret = clEnqueueReadBuffer(command_queue, outputcollides_memobj, CL_TRUE, 0, sizeof(BOOLEAN) * nl1->listSize * nl2->listSize, outputcollides, 0, NULL, NULL); CL_PRDEBUG; ret = clEnqueueReadBuffer(command_queue, outputx_memobj, CL_TRUE, 0, sizeof(double) * nl1->listSize * nl2->listSize, outputx, 0, NULL, NULL); CL_PRDEBUG; ret = clEnqueueReadBuffer(command_queue, outputy_memobj, CL_TRUE, 0, sizeof(double) * nl1->listSize * nl2->listSize, outputy, 0, NULL, NULL); CL_PRDEBUG; if (outcoll != NULL) { memcpy(outcoll, outputcollides, sizeof(BOOLEAN) * nl1->listSize * nl2->listSize); } if (outcoll1 != NULL) { SetArray(outcoll1, NULL, nl1->listSize, FALSE); } if (outcoll2 != NULL) { SetArray(outcoll2, NULL, nl2->listSize, FALSE); } /* //commented out for redundancy if (outpos != NULL) { for (i = 0; i < nl1->listSize * nl2->listSize; i++) { if (outputcollides[i]) { outpos[i] = (Point) { outputx[i], outputy[i], 0 }; } } } */ for (iterator1 = nl1->headNode, ind1 = 0; iterator1 != NULL; iterator1 = iterator1->nextNode, ind1++) { for (iterator2 = nl2->headNode, ind2 = 0; iterator2 != NULL; iterator2 = iterator2->nextNode, ind2++) { i = ind1 * nl2->listSize + ind2; if (outputcollides[i]) { if (outpos != NULL) { outpos[i] = (Point) { outputx[i], outputy[i], 0 }; } if (outcoll1 != NULL) { if (outpos1 != NULL) { if (outcoll1[ind1] == FALSE || //if is first time we see collision, or if it's closer to p1 than the one previously there Point_LengthSquared2D(&(Point) { l1p1x[ind1], l1p1y[ind1], 0 }, &(Point) { outputx[i], outputy[i], 0 }) < Point_LengthSquared2D(&(Point) { l1p1x[ind1], l1p1y[ind1], 0 }, &outpos1[ind1])) { outpos1[ind1] = (Point) { outputx[i], outputy[i], 0 }; if (outline1 != NULL) { outline1[ind1] = iterator2->Geom.Line; } } } outcoll1[ind1] = TRUE; } if (outcoll2 != NULL) { if (outpos2 != NULL) { if (outcoll2[ind2] == FALSE || //if is first time we see collision, or if it's closer to p1 than the one previously there Point_LengthSquared2D(&(Point) { l2p1x[ind2], l2p1y[ind2], 0 }, &(Point) { outputx[i], outputy[i], 0 }) < Point_LengthSquared2D(&(Point) { l2p1x[ind2], l2p1y[ind2], 0 }, &outpos2[ind2])) { outpos2[ind2] = (Point) { outputx[i], outputy[i], 0 }; if (outline2 != NULL) { outline2[ind2] = iterator1->Geom.Line; } } } outcoll2[ind2] = TRUE; } } } } ret = clReleaseMemObject(outputcollides_memobj); ret = clReleaseMemObject(outputx_memobj); ret = clReleaseMemObject(outputy_memobj); #define X(k, v, j) ret = clReleaseMemObject(l_mem[j]); LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X ret = clReleaseMemObject(considerHeight_memobj); ret = clReleaseMemObject(l1null_memobj); ret = clReleaseMemObject(l2null_memobj); free(outputcollides); free(outputx); free(outputy); #define X(k) free(k); LINECOLLISION_L1MAP(X); LINECOLLISION_L2MAP(X); #undef X free(l1null); free(l2null); } else //no gpu { Node *iterator1, *iterator2; int ind1, ind2; Point p; BOOLEAN collides; if (outcoll1 != NULL) { SetArray(outcoll1, NULL, nl1->listSize, FALSE); } if (outcoll2 != NULL) { SetArray(outcoll2, NULL, nl2->listSize, FALSE); } for (iterator1 = nl1->headNode, ind1 = 0; iterator1 != NULL; iterator1 = iterator1->nextNode, ind1++) { for (iterator2 = nl2->headNode, ind2 = 0; iterator2 != NULL; iterator2 = iterator2->nextNode, ind2++) { collides = Line_Collides(&p, iterator1->Geom.Line, iterator2->Geom.Line, considerHeight); if (outcoll != NULL) { outcoll[ind1 * nl2->listSize + ind2] = collides; } if (collides) { if (outpos != NULL) { outpos[ind1 * nl2->listSize + ind2] = p; } if (outcoll1 != NULL) { if (outpos1 != NULL && (outcoll1[ind1] == FALSE || //if is first time we see collision, or if it's closer to p1 than the one previously there Point_LengthSquared2D(&p, &iterator1->Geom.Line->p1) < Point_LengthSquared2D(&outpos1[ind1], &iterator1->Geom.Line->p1))) { outpos1[ind1] = p; if (outline1 != NULL) { outline1[ind1] = iterator2->Geom.Line; } } outcoll1[ind1] = TRUE; } if (outcoll2 != NULL) { if (outpos2 != NULL && (outcoll2[ind2] == FALSE || //if is first time we see collision, or if it's closer to p1 than the one previously there Point_LengthSquared2D(&p, &iterator2->Geom.Line->p1) < Point_LengthSquared2D(&outpos2[ind2], &iterator2->Geom.Line->p1))) { outpos2[ind2] = p; if (outline1 != NULL) { outline2[ind2] = iterator1->Geom.Line; } } outcoll1[ind2] = TRUE; } } } } } } BOOLEAN Line_CollidesCircle(Point* out, Line* line, Point* circlepos, double circleradius) { double intercept, x1, x2, y1, y2, f, g, h, det; //used for quadratic equation if (line->bound_left > circlepos->x + circleradius || line->bound_right < circlepos->x - circleradius //check bounding boxes || line->bound_up > circlepos->y + circleradius || line->bound_down < circlepos->y - circleradius) { return FALSE; } if (out == NULL) //if we don't need the location of collision, we can take some shortcuts { if (Point_IsInsideCircle(&line->p1, circlepos, circleradius) + Point_IsInsideCircle(&line->p2, circlepos, circleradius) == 1)//if only 1 point is inside the circle { return TRUE; } } if (!line->vertical) { intercept = line->p1.y - line->p1.x * line->slope; f = 1 + line->slope * line->slope; g = line->slope * (intercept - circlepos->y) - circlepos->x; h = circlepos->x * circlepos->x + circlepos->y * circlepos->y + intercept * intercept - 2 * circlepos->y * intercept - circleradius * circleradius; det = g * g - f * h; if (out == NULL) //despite what it seems this is not redundant { return det >= 0 ? TRUE : FALSE; } if (det >= 0) { x1 = (-g + sqrt(det)) / f; x2 = (-g - sqrt(det)) / f; y1 = line->slope * x1 + intercept; y2 = line->slope * x2 + intercept; if (Point_LengthSquared(&(Point) { x1, y1, 0 }, &line->p1) < Point_LengthSquared(&(Point) { x2, y2, 0 }, &line->p2) //point associated with x1 is closer to p1 && x1 < line->bound_right + EPSILON && x1 > line->bound_left - EPSILON) //make sure the point is on the line { out->x = x1; out->y = y1; } else if (x2 < line->bound_right + EPSILON && x2 > line->bound_left - EPSILON) { out->x = x2; out->y = y2; } else { return FALSE; } return TRUE; } return FALSE; } //if we get to this point it's a vertical line det = (line->p1.x - circlepos->x) * (line->p1.x - circlepos->x) - circleradius * circleradius; if (out == NULL) //despite what it seems this is not redundant { return det >= 0 ? TRUE : FALSE; } if (det >= 0) { y1 = circlepos->y + sqrt(det); y2 = circlepos->y - sqrt(det); out->x = line->p1.x; if (abs(y1 - line->p1.y) < abs(y2 - line->p2.y) //y1 is closer to p1.y or not && y1 < line->bound_down + EPSILON && y1 > line->bound_up - EPSILON) { out->y = y1; } else if(y2 < line->bound_down + EPSILON && y2 > line->bound_up - EPSILON) { out->y = y2; } else { return FALSE; //i think theres a better way to do the if else logic tree here but whatevs } return TRUE; } return FALSE; } void Line_Rasterize(BOOLEAN* booleangrid, double* doublegrid, double result, BOOLEAN thick, Point* griddim, Point* mapdim, Point* pos, Line* line) { //output->x = (int)((in->x - dfield->pos.x) * dfield->dim.x / dfield->mapdim.x) int i; Point gridp1, gridp2; Line* gridline; Point_MapToGrid(&gridp1, griddim, mapdim, pos, &line->p1); Point_MapToGrid(&gridp2, griddim, mapdim, pos, &line->p2); gridline = Line_Create(&gridp1, &gridp2); if (gridline->vertical) { for (i = gridline->bound_up > 0 ? gridline->bound_up : 0; i <= gridline->bound_down && i < griddim->y; i++) { if (booleangrid != NULL) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){(int)gridp1.x, i, 0 })] = result; } if (doublegrid != NULL) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){(int)gridp1.x, i, 0 })] = result; } } } else if (gridline->slope < 1 && gridline->slope > -1) //slope is between -1 and 1 { for (i = gridline->bound_left > 0 ? gridline->bound_left : 0; i + 0.5 <= gridline->bound_right && i < griddim->x; i++) { //initial line int y = gridline->slope * (i + 0.5 - gridline->p1.x) + gridline->p1.y; if (y >= 0 && y < griddim->y) { if (booleangrid != NULL) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){i, y, 0 })] = result; } if (doublegrid != NULL) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){i, y, 0 })] = result; } } } if (thick) //thicc line { for (i = gridline->bound_up > 0 ? gridline->bound_up : 0; i <= gridline->bound_down + 1 && i < griddim->y; i++) { int x = (i - gridline->p1.y) / gridline->slope + gridline->p1.x; if (x >= 0 && x < griddim->x && x >= (int)gridline->bound_left && x <= (int)gridline->bound_right) { if (booleangrid != NULL) { if (i <= gridline->bound_down) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){x, i, 0 })] = result; } if (i > 0 && i > gridline->bound_up) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){x, i - 1, 0 })] = result; } } if (doublegrid != NULL) { if (i <= gridline->bound_down) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){x, i, 0 })] = result; } if (i > 0 && i > gridline->bound_up) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){x, i - 1, 0 })] = result; } } } } } } else //magnitude of slope is greater than 1 { for (i = gridline->bound_up > 0 ? gridline->bound_up : 0; i + 0.5 <= gridline->bound_down && i < griddim->y; i++) { int x = (i + 0.5 - gridline->p1.y) / gridline->slope + gridline->p1.x; if (x >= 0 && x < griddim->x) { if (booleangrid != NULL) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){x, i, 0 })] = result; } if (doublegrid != NULL) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){x, i, 0 })] = result; } } } if (thick) //thicc line { for (i = gridline->bound_left > 0 ? gridline->bound_left : 0; i <= gridline->bound_right + 1 && i < griddim->x; i++) { int y = gridline->slope * (i - gridline->p1.x) + gridline->p1.y; if (y >= 0 && y < griddim->y && y >= (int)gridline->bound_up && y <= (int)gridline->bound_down) { if (booleangrid != NULL) { if (i <= gridline->bound_right) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){i, y, 0 })] = result; } if (i > 0 && i > gridline->bound_left) { booleangrid[Grid_PointerArithmetic(griddim, &(Point){i - 1, y, 0 })] = result; } } if (doublegrid != NULL) { if (i <= gridline->bound_right) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){i, y, 0 })] = result; } if (i > 0 && i > gridline->bound_left) { doublegrid[Grid_PointerArithmetic(griddim, &(Point){i - 1, y, 0 })] = result; } } } } } } free(gridline); } double Line_HeightAt(Line *l, Point *p) { if (l->length != 0) { if (!l->vertical) { return l->p1.z + ((p->x - l->p1.x) / (l->p2.x - l->p1.x)) * (l->p2.z - l->p1.z); } else { return l->p1.z + ((p->y - l->p1.y) / (l->p2.y - l->p1.y)) * (l->p2.z - l->p1.z); } } return Max(l->p1.z, l->p2.z); } Grid* Grid_Create(Point* dim, BOOLEAN booleangrid, BOOLEAN doublegrid) { Grid* g = malloc(sizeof(Grid)); Point_Copy(&g->dim, dim); if (booleangrid) { g->booleangrid = malloc(dim->x * dim->y * sizeof(BOOLEAN)); } else { g->booleangrid = NULL; } if (doublegrid) { g->doublegrid = malloc(dim->x * dim->y * sizeof(double)); } else { g->doublegrid = NULL; } return g; } void Grid_Destroy(Grid* grid) { if (grid->booleangrid) { free(grid->booleangrid); } if (grid->doublegrid) { free(grid->doublegrid); } free(grid); } inline int Grid_PointerArithmetic(Point* dim, Point* pos) { return pos->y * dim->x + pos->x; } inline void Grid_ArithmeticPointer(int* outx, int* outy, Point* dim, int ptr) { *outx = ptr % Round(dim->x); *outy = (int)(ptr / dim->x); }
a003d20d45101a13f8c4c79345e6ea8ed7be94eb
74d9ffb8ba7494d9eb56ce3a5c805a6b143dc4d3
/shell/shell_errors.h
5dbae1a7725c0b195e1e97761f0c706f9596b656
[]
no_license
CuriousGeorgiy/sysprog
d06f3c4a6c61420670189c82618f36286ab40bf2
6d663be0b2710987cea320222f9d24a8e108e023
refs/heads/master
2023-04-07T18:39:52.352522
2021-04-14T16:41:09
2021-04-14T16:41:09
349,710,756
0
0
null
2021-04-10T21:41:16
2021-03-20T11:52:06
C
UTF-8
C
false
false
1,261
h
shell_errors.h
#ifndef SHELL_ERRORS_H #define SHELL_ERRORS_H #include <errno.h> #include <stdio.h> #include <string.h> enum shell_status { SHELL_SUCCESS, SHELL_SYS_ERROR, SHELL_LOGIC_ERROR, SHELL_CHILD_PROCESS_ERROR }; /*! * Macro for handling errors * * @details prints the error description calling by calling perror and then executes code for * handling error */ #define HANDLE_SYS_ERROR(error_handling_src_code, ...) \ { \ fprintf(stderr, __VA_ARGS__, strerror(errno)); \ \ { \ error_handling_src_code \ } \ } do {} while (false) #define HANDLE_LOGIC_ERROR(error_handling_src_code, ...) \ { \ fprintf(stderr, __VA_ARGS__); \ \ { \ error_handling_src_code \ } \ } do {} while (false) #endif /* SHELL_ERRORS_H */
8007d5dccbe5fc4bab60b785cb9ce30539e3b7ec
63b4a698bc22fd54857c8fa097b1331f79c39e5a
/src/gdb/gdb-8.3/gdb/gnu-v3-abi.c
15c7c66700133c119e7b556946f5b886c17761cb
[ "GPL-3.0-only", "LGPL-3.0-only", "GPL-2.0-only", "GPL-1.0-or-later", "LGPL-2.0-or-later", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-other-copyleft", "LGPL-2.0-only", "LicenseRef-scancode-other-permissive", "GPL-2.0-or-later", "LicenseRef-scancode-unknown-license-reference", "AGPL-3.0-or-later", "GPL-3.0-or-later", "Apache-2.0" ]
permissive
MinimSecure/unum-sdk
67e04e2b230f9afb3ae328501a16afa4b94cdac6
30c63f0eccddba39a760671a831be3602842f3f4
refs/heads/master
2023-07-13T07:33:43.078672
2023-07-07T13:52:05
2023-07-07T13:52:05
143,209,329
33
22
Apache-2.0
2021-03-05T22:56:59
2018-08-01T21:13:43
C
UTF-8
C
false
false
44,501
c
gnu-v3-abi.c
/* Abstraction of GNU v3 abi. Contributed by Jim Blandy <jimb@redhat.com> Copyright (C) 2001-2019 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "defs.h" #include "value.h" #include "cp-abi.h" #include "cp-support.h" #include "demangle.h" #include "objfiles.h" #include "valprint.h" #include "c-lang.h" #include "typeprint.h" #include <algorithm> static struct cp_abi_ops gnu_v3_abi_ops; /* A gdbarch key for std::type_info, in the event that it can't be found in the debug info. */ static struct gdbarch_data *std_type_info_gdbarch_data; static int gnuv3_is_vtable_name (const char *name) { return startswith (name, "_ZTV"); } static int gnuv3_is_operator_name (const char *name) { return startswith (name, CP_OPERATOR_STR); } /* To help us find the components of a vtable, we build ourselves a GDB type object representing the vtable structure. Following the V3 ABI, it goes something like this: struct gdb_gnu_v3_abi_vtable { / * An array of virtual call and virtual base offsets. The real length of this array depends on the class hierarchy; we use negative subscripts to access the elements. Yucky, but better than the alternatives. * / ptrdiff_t vcall_and_vbase_offsets[0]; / * The offset from a virtual pointer referring to this table to the top of the complete object. * / ptrdiff_t offset_to_top; / * The type_info pointer for this class. This is really a std::type_info *, but GDB doesn't really look at the type_info object itself, so we don't bother to get the type exactly right. * / void *type_info; / * Virtual table pointers in objects point here. * / / * Virtual function pointers. Like the vcall/vbase array, the real length of this table depends on the class hierarchy. * / void (*virtual_functions[0]) (); }; The catch, of course, is that the exact layout of this table depends on the ABI --- word size, endianness, alignment, etc. So the GDB type object is actually a per-architecture kind of thing. vtable_type_gdbarch_data is a gdbarch per-architecture data pointer which refers to the struct type * for this structure, laid out appropriately for the architecture. */ static struct gdbarch_data *vtable_type_gdbarch_data; /* Human-readable names for the numbers of the fields above. */ enum { vtable_field_vcall_and_vbase_offsets, vtable_field_offset_to_top, vtable_field_type_info, vtable_field_virtual_functions }; /* Return a GDB type representing `struct gdb_gnu_v3_abi_vtable', described above, laid out appropriately for ARCH. We use this function as the gdbarch per-architecture data initialization function. */ static void * build_gdb_vtable_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; int offset; struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; struct type *ptr_to_void_fn_type = builtin_type (arch)->builtin_func_ptr; /* ARCH can't give us the true ptrdiff_t type, so we guess. */ struct type *ptrdiff_type = arch_integer_type (arch, gdbarch_ptr_bit (arch), 0, "ptrdiff_t"); /* We assume no padding is necessary, since GDB doesn't know anything about alignment at the moment. If this assumption bites us, we should add a gdbarch method which, given a type, returns the alignment that type requires, and then use that here. */ /* Build the field list. */ field_list = XCNEWVEC (struct field, 4); field = &field_list[0]; offset = 0; /* ptrdiff_t vcall_and_vbase_offsets[0]; */ FIELD_NAME (*field) = "vcall_and_vbase_offsets"; FIELD_TYPE (*field) = lookup_array_range_type (ptrdiff_type, 0, -1); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* ptrdiff_t offset_to_top; */ FIELD_NAME (*field) = "offset_to_top"; FIELD_TYPE (*field) = ptrdiff_type; SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* void *type_info; */ FIELD_NAME (*field) = "type_info"; FIELD_TYPE (*field) = void_ptr_type; SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* void (*virtual_functions[0]) (); */ FIELD_NAME (*field) = "virtual_functions"; FIELD_TYPE (*field) = lookup_array_range_type (ptr_to_void_fn_type, 0, -1); SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* We assumed in the allocation above that there were four fields. */ gdb_assert (field == (field_list + 4)); t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL); TYPE_NFIELDS (t) = field - field_list; TYPE_FIELDS (t) = field_list; TYPE_NAME (t) = "gdb_gnu_v3_abi_vtable"; INIT_CPLUS_SPECIFIC (t); return make_type_with_address_space (t, TYPE_INSTANCE_FLAG_CODE_SPACE); } /* Return the ptrdiff_t type used in the vtable type. */ static struct type * vtable_ptrdiff_type (struct gdbarch *gdbarch) { struct type *vtable_type = (struct type *) gdbarch_data (gdbarch, vtable_type_gdbarch_data); /* The "offset_to_top" field has the appropriate (ptrdiff_t) type. */ return TYPE_FIELD_TYPE (vtable_type, vtable_field_offset_to_top); } /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ static int vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = (struct type *) gdbarch_data (gdbarch, vtable_type_gdbarch_data); return (TYPE_FIELD_BITPOS (vtable_type, vtable_field_virtual_functions) / TARGET_CHAR_BIT); } /* Determine whether structure TYPE is a dynamic class. Cache the result. */ static int gnuv3_dynamic_class (struct type *type) { int fieldnum, fieldelem; type = check_typedef (type); gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION); if (TYPE_CODE (type) == TYPE_CODE_UNION) return 0; if (TYPE_CPLUS_DYNAMIC (type)) return TYPE_CPLUS_DYNAMIC (type) == 1; ALLOCATE_CPLUS_STRUCT_TYPE (type); for (fieldnum = 0; fieldnum < TYPE_N_BASECLASSES (type); fieldnum++) if (BASETYPE_VIA_VIRTUAL (type, fieldnum) || gnuv3_dynamic_class (TYPE_FIELD_TYPE (type, fieldnum))) { TYPE_CPLUS_DYNAMIC (type) = 1; return 1; } for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++) for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum); fieldelem++) { struct fn_field *f = TYPE_FN_FIELDLIST1 (type, fieldnum); if (TYPE_FN_FIELD_VIRTUAL_P (f, fieldelem)) { TYPE_CPLUS_DYNAMIC (type) = 1; return 1; } } TYPE_CPLUS_DYNAMIC (type) = -1; return 0; } /* Find the vtable for a value of CONTAINER_TYPE located at CONTAINER_ADDR. Return a value of the correct vtable type for this architecture, or NULL if CONTAINER does not have a vtable. */ static struct value * gnuv3_get_vtable (struct gdbarch *gdbarch, struct type *container_type, CORE_ADDR container_addr) { struct type *vtable_type = (struct type *) gdbarch_data (gdbarch, vtable_type_gdbarch_data); struct type *vtable_pointer_type; struct value *vtable_pointer; CORE_ADDR vtable_address; container_type = check_typedef (container_type); gdb_assert (TYPE_CODE (container_type) == TYPE_CODE_STRUCT); /* If this type does not have a virtual table, don't read the first field. */ if (!gnuv3_dynamic_class (container_type)) return NULL; /* We do not consult the debug information to find the virtual table. The ABI specifies that it is always at offset zero in any class, and debug information may not represent it. We avoid using value_contents on principle, because the object might be large. */ /* Find the type "pointer to virtual table". */ vtable_pointer_type = lookup_pointer_type (vtable_type); /* Load it from the start of the class. */ vtable_pointer = value_at (vtable_pointer_type, container_addr); vtable_address = value_as_address (vtable_pointer); /* Correct it to point at the start of the virtual table, rather than the address point. */ return value_at_lazy (vtable_type, vtable_address - vtable_address_point_offset (gdbarch)); } static struct type * gnuv3_rtti_type (struct value *value, int *full_p, LONGEST *top_p, int *using_enc_p) { struct gdbarch *gdbarch; struct type *values_type = check_typedef (value_type (value)); struct value *vtable; struct minimal_symbol *vtable_symbol; const char *vtable_symbol_name; const char *class_name; struct type *run_time_type; LONGEST offset_to_top; const char *atsign; /* We only have RTTI for dynamic class objects. */ if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT || !gnuv3_dynamic_class (values_type)) return NULL; /* Determine architecture. */ gdbarch = get_type_arch (values_type); if (using_enc_p) *using_enc_p = 0; vtable = gnuv3_get_vtable (gdbarch, values_type, value_as_address (value_addr (value))); if (vtable == NULL) return NULL; /* Find the linker symbol for this vtable. */ vtable_symbol = lookup_minimal_symbol_by_pc (value_address (vtable) + value_embedded_offset (vtable)).minsym; if (! vtable_symbol) return NULL; /* The symbol's demangled name should be something like "vtable for CLASS", where CLASS is the name of the run-time type of VALUE. If we didn't like this approach, we could instead look in the type_info object itself to get the class name. But this way should work just as well, and doesn't read target memory. */ vtable_symbol_name = MSYMBOL_DEMANGLED_NAME (vtable_symbol); if (vtable_symbol_name == NULL || !startswith (vtable_symbol_name, "vtable for ")) { warning (_("can't find linker symbol for virtual table for `%s' value"), TYPE_SAFE_NAME (values_type)); if (vtable_symbol_name) warning (_(" found `%s' instead"), vtable_symbol_name); return NULL; } class_name = vtable_symbol_name + 11; /* Strip off @plt and version suffixes. */ atsign = strchr (class_name, '@'); if (atsign != NULL) { char *copy; copy = (char *) alloca (atsign - class_name + 1); memcpy (copy, class_name, atsign - class_name); copy[atsign - class_name] = '\0'; class_name = copy; } /* Try to look up the class name as a type name. */ /* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */ run_time_type = cp_lookup_rtti_type (class_name, NULL); if (run_time_type == NULL) return NULL; /* Get the offset from VALUE to the top of the complete object. NOTE: this is the reverse of the meaning of *TOP_P. */ offset_to_top = value_as_long (value_field (vtable, vtable_field_offset_to_top)); if (full_p) *full_p = (- offset_to_top == value_embedded_offset (value) && (TYPE_LENGTH (value_enclosing_type (value)) >= TYPE_LENGTH (run_time_type))); if (top_p) *top_p = - offset_to_top; return run_time_type; } /* Return a function pointer for CONTAINER's VTABLE_INDEX'th virtual function, of type FNTYPE. */ static struct value * gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, struct type *fntype, int vtable_index) { struct value *vtable, *vfn; /* Every class with virtual functions must have a vtable. */ vtable = gnuv3_get_vtable (gdbarch, value_type (container), value_as_address (value_addr (container))); gdb_assert (vtable != NULL); /* Fetch the appropriate function pointer from the vtable. */ vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions), vtable_index); /* If this architecture uses function descriptors directly in the vtable, then the address of the vtable entry is actually a "function pointer" (i.e. points to the descriptor). We don't need to scale the index by the size of a function descriptor; GCC does that before outputing debug information. */ if (gdbarch_vtable_function_descriptors (gdbarch)) vfn = value_addr (vfn); /* Cast the function pointer to the appropriate type. */ vfn = value_cast (lookup_pointer_type (fntype), vfn); return vfn; } /* GNU v3 implementation of value_virtual_fn_field. See cp-abi.h for a description of the arguments. */ static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, struct type *vfn_base, int offset) { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; /* Some simple sanity checks. */ if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT) error (_("Only classes can have virtual functions.")); /* Determine architecture. */ gdbarch = get_type_arch (values_type); /* Cast our value to the base class which defines this virtual function. This takes care of any necessary `this' adjustments. */ if (vfn_base != values_type) *value_p = value_cast (vfn_base, *value_p); return gnuv3_get_virtual_fn (gdbarch, *value_p, TYPE_FN_FIELD_TYPE (f, j), TYPE_FN_FIELD_VOFFSET (f, j)); } /* Compute the offset of the baseclass which is the INDEXth baseclass of class TYPE, for value at VALADDR (in host) at ADDRESS (in target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. -1 is returned on error. */ static int gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct gdbarch *gdbarch; struct type *ptr_type; struct value *vtable; struct value *vbase_array; long int cur_base_offset, base_offset; /* Determine architecture. */ gdbarch = get_type_arch (type); ptr_type = builtin_type (gdbarch)->builtin_data_ptr; /* If it isn't a virtual base, this is easy. The offset is in the type definition. */ if (!BASETYPE_VIA_VIRTUAL (type, index)) return TYPE_BASECLASS_BITPOS (type, index) / 8; /* To access a virtual base, we need to use the vbase offset stored in our vtable. Recent GCC versions provide this information. If it isn't available, we could get what we needed from RTTI, or from drawing the complete inheritance graph based on the debug info. Neither is worthwhile. */ cur_base_offset = TYPE_BASECLASS_BITPOS (type, index) / 8; if (cur_base_offset >= - vtable_address_point_offset (gdbarch)) error (_("Expected a negative vbase offset (old compiler?)")); cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); vbase_array = value_field (vtable, vtable_field_vcall_and_vbase_offsets); base_offset = value_as_long (value_subscript (vbase_array, cur_base_offset)); return base_offset; } /* Locate a virtual method in DOMAIN or its non-virtual base classes which has virtual table index VOFFSET. The method has an associated "this" adjustment of ADJUSTMENT bytes. */ static const char * gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, LONGEST adjustment) { int i; /* Search this class first. */ if (adjustment == 0) { int len; len = TYPE_NFN_FIELDS (domain); for (i = 0; i < len; i++) { int len2, j; struct fn_field *f; f = TYPE_FN_FIELDLIST1 (domain, i); len2 = TYPE_FN_FIELDLIST_LENGTH (domain, i); check_stub_method_group (domain, i); for (j = 0; j < len2; j++) if (TYPE_FN_FIELD_VOFFSET (f, j) == voffset) return TYPE_FN_FIELD_PHYSNAME (f, j); } } /* Next search non-virtual bases. If it's in a virtual base, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { int pos; struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) continue; pos = TYPE_BASECLASS_BITPOS (domain, i) / 8; basetype = TYPE_FIELD_TYPE (domain, i); /* Recurse with a modified adjustment. We don't need to adjust voffset. */ if (adjustment >= pos && adjustment < pos + TYPE_LENGTH (basetype)) return gnuv3_find_method_in (basetype, voffset, adjustment - pos); } return NULL; } /* Decode GNU v3 method pointer. */ static int gnuv3_decode_method_ptr (struct gdbarch *gdbarch, const gdb_byte *contents, CORE_ADDR *value_p, LONGEST *adjustment_p) { struct type *funcptr_type = builtin_type (gdbarch)->builtin_func_ptr; struct type *offset_type = vtable_ptrdiff_type (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR ptr_value; LONGEST voffset, adjustment; int vbit; /* Extract the pointer to member. The first element is either a pointer or a vtable offset. For pointers, we need to use extract_typed_address to allow the back-end to convert the pointer to a GDB address -- but vtable offsets we must handle as integers. At this point, we do not yet know which case we have, so we extract the value under both interpretations and choose the right one later on. */ ptr_value = extract_typed_address (contents, funcptr_type); voffset = extract_signed_integer (contents, TYPE_LENGTH (funcptr_type), byte_order); contents += TYPE_LENGTH (funcptr_type); adjustment = extract_signed_integer (contents, TYPE_LENGTH (offset_type), byte_order); if (!gdbarch_vbit_in_delta (gdbarch)) { vbit = voffset & 1; voffset = voffset ^ vbit; } else { vbit = adjustment & 1; adjustment = adjustment >> 1; } *value_p = vbit? voffset : ptr_value; *adjustment_p = adjustment; return vbit; } /* GNU v3 implementation of cplus_print_method_ptr. */ static void gnuv3_print_method_ptr (const gdb_byte *contents, struct type *type, struct ui_file *stream) { struct type *self_type = TYPE_SELF_TYPE (type); struct gdbarch *gdbarch = get_type_arch (self_type); CORE_ADDR ptr_value; LONGEST adjustment; int vbit; /* Extract the pointer to member. */ vbit = gnuv3_decode_method_ptr (gdbarch, contents, &ptr_value, &adjustment); /* Check for NULL. */ if (ptr_value == 0 && vbit == 0) { fprintf_filtered (stream, "NULL"); return; } /* Search for a virtual method. */ if (vbit) { CORE_ADDR voffset; const char *physname; /* It's a virtual table offset, maybe in this class. Search for a field with the correct vtable offset. First convert it to an index, as used in TYPE_FN_FIELD_VOFFSET. */ voffset = ptr_value / TYPE_LENGTH (vtable_ptrdiff_type (gdbarch)); physname = gnuv3_find_method_in (self_type, voffset, adjustment); /* If we found a method, print that. We don't bother to disambiguate possible paths to the method based on the adjustment. */ if (physname) { char *demangled_name = gdb_demangle (physname, DMGL_ANSI | DMGL_PARAMS); fprintf_filtered (stream, "&virtual "); if (demangled_name == NULL) fputs_filtered (physname, stream); else { fputs_filtered (demangled_name, stream); xfree (demangled_name); } return; } } else if (ptr_value != 0) { /* Found a non-virtual function: print out the type. */ fputs_filtered ("(", stream); c_print_type (type, "", stream, -1, 0, &type_print_raw_options); fputs_filtered (") ", stream); } /* We didn't find it; print the raw data. */ if (vbit) { fprintf_filtered (stream, "&virtual table offset "); print_longest (stream, 'd', 1, ptr_value); } else { struct value_print_options opts; get_user_print_options (&opts); print_address_demangle (&opts, gdbarch, ptr_value, stream, demangle); } if (adjustment) { fprintf_filtered (stream, ", this adjustment "); print_longest (stream, 'd', 1, adjustment); } } /* GNU v3 implementation of cplus_method_ptr_size. */ static int gnuv3_method_ptr_size (struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); return 2 * TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr); } /* GNU v3 implementation of cplus_make_method_ptr. */ static void gnuv3_make_method_ptr (struct type *type, gdb_byte *contents, CORE_ADDR value, int is_virtual) { struct gdbarch *gdbarch = get_type_arch (type); int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* FIXME drow/2006-12-24: The adjustment of "this" is currently always zero, since the method pointer is of the correct type. But if the method pointer came from a base class, this is incorrect - it should be the offset to the base. The best fix might be to create the pointer to member pointing at the base class and cast it to the derived class, but that requires support for adjusting pointers to members when casting them - not currently supported by GDB. */ if (!gdbarch_vbit_in_delta (gdbarch)) { store_unsigned_integer (contents, size, byte_order, value | is_virtual); store_unsigned_integer (contents + size, size, byte_order, 0); } else { store_unsigned_integer (contents, size, byte_order, value); store_unsigned_integer (contents + size, size, byte_order, is_virtual); } } /* GNU v3 implementation of cplus_method_ptr_to_value. */ static struct value * gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr) { struct gdbarch *gdbarch; const gdb_byte *contents = value_contents (method_ptr); CORE_ADDR ptr_value; struct type *self_type, *final_type, *method_type; LONGEST adjustment; int vbit; self_type = TYPE_SELF_TYPE (check_typedef (value_type (method_ptr))); final_type = lookup_pointer_type (self_type); method_type = TYPE_TARGET_TYPE (check_typedef (value_type (method_ptr))); /* Extract the pointer to member. */ gdbarch = get_type_arch (self_type); vbit = gnuv3_decode_method_ptr (gdbarch, contents, &ptr_value, &adjustment); /* First convert THIS to match the containing type of the pointer to member. This cast may adjust the value of THIS. */ *this_p = value_cast (final_type, *this_p); /* Then apply whatever adjustment is necessary. This creates a somewhat strange pointer: it claims to have type FINAL_TYPE, but in fact it might not be a valid FINAL_TYPE. For instance, it might be a base class of FINAL_TYPE. And if it's not the primary base class, then printing it out as a FINAL_TYPE object would produce some pretty garbage. But we don't really know the type of the first argument in METHOD_TYPE either, which is why this happens. We can't dereference this later as a FINAL_TYPE, but once we arrive in the called method we'll have debugging information for the type of "this" - and that'll match the value we produce here. You can provoke this case by casting a Base::* to a Derived::*, for instance. */ *this_p = value_cast (builtin_type (gdbarch)->builtin_data_ptr, *this_p); *this_p = value_ptradd (*this_p, adjustment); *this_p = value_cast (final_type, *this_p); if (vbit) { LONGEST voffset; voffset = ptr_value / TYPE_LENGTH (vtable_ptrdiff_type (gdbarch)); return gnuv3_get_virtual_fn (gdbarch, value_ind (*this_p), method_type, voffset); } else return value_from_pointer (lookup_pointer_type (method_type), ptr_value); } /* Objects of this type are stored in a hash table and a vector when printing the vtables for a class. */ struct value_and_voffset { /* The value representing the object. */ struct value *value; /* The maximum vtable offset we've found for any object at this offset in the outermost object. */ int max_voffset; }; /* Hash function for value_and_voffset. */ static hashval_t hash_value_and_voffset (const void *p) { const struct value_and_voffset *o = (const struct value_and_voffset *) p; return value_address (o->value) + value_embedded_offset (o->value); } /* Equality function for value_and_voffset. */ static int eq_value_and_voffset (const void *a, const void *b) { const struct value_and_voffset *ova = (const struct value_and_voffset *) a; const struct value_and_voffset *ovb = (const struct value_and_voffset *) b; return (value_address (ova->value) + value_embedded_offset (ova->value) == value_address (ovb->value) + value_embedded_offset (ovb->value)); } /* Comparison function for value_and_voffset. */ static bool compare_value_and_voffset (const struct value_and_voffset *va, const struct value_and_voffset *vb) { CORE_ADDR addra = (value_address (va->value) + value_embedded_offset (va->value)); CORE_ADDR addrb = (value_address (vb->value) + value_embedded_offset (vb->value)); return addra < addrb; } /* A helper function used when printing vtables. This determines the key (most derived) sub-object at each address and also computes the maximum vtable offset seen for the corresponding vtable. Updates OFFSET_HASH and OFFSET_VEC with a new value_and_voffset object, if needed. VALUE is the object to examine. */ static void compute_vtable_size (htab_t offset_hash, std::vector<value_and_voffset *> *offset_vec, struct value *value) { int i; struct type *type = check_typedef (value_type (value)); void **slot; struct value_and_voffset search_vo, *current_vo; gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT); /* If the object is not dynamic, then we are done; as it cannot have dynamic base types either. */ if (!gnuv3_dynamic_class (type)) return; /* Update the hash and the vec, if needed. */ search_vo.value = value; slot = htab_find_slot (offset_hash, &search_vo, INSERT); if (*slot) current_vo = (struct value_and_voffset *) *slot; else { current_vo = XNEW (struct value_and_voffset); current_vo->value = value; current_vo->max_voffset = -1; *slot = current_vo; offset_vec->push_back (current_vo); } /* Update the value_and_voffset object with the highest vtable offset from this class. */ for (i = 0; i < TYPE_NFN_FIELDS (type); ++i) { int j; struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, i); for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (type, i); ++j) { if (TYPE_FN_FIELD_VIRTUAL_P (fn, j)) { int voffset = TYPE_FN_FIELD_VOFFSET (fn, j); if (voffset > current_vo->max_voffset) current_vo->max_voffset = voffset; } } } /* Recurse into base classes. */ for (i = 0; i < TYPE_N_BASECLASSES (type); ++i) compute_vtable_size (offset_hash, offset_vec, value_field (value, i)); } /* Helper for gnuv3_print_vtable that prints a single vtable. */ static void print_one_vtable (struct gdbarch *gdbarch, struct value *value, int max_voffset, struct value_print_options *opts) { int i; struct type *type = check_typedef (value_type (value)); struct value *vtable; CORE_ADDR vt_addr; vtable = gnuv3_get_vtable (gdbarch, type, value_address (value) + value_embedded_offset (value)); vt_addr = value_address (value_field (vtable, vtable_field_virtual_functions)); printf_filtered (_("vtable for '%s' @ %s (subobject @ %s):\n"), TYPE_SAFE_NAME (type), paddress (gdbarch, vt_addr), paddress (gdbarch, (value_address (value) + value_embedded_offset (value)))); for (i = 0; i <= max_voffset; ++i) { /* Initialize it just to avoid a GCC false warning. */ CORE_ADDR addr = 0; int got_error = 0; struct value *vfn; printf_filtered ("[%d]: ", i); vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions), i); if (gdbarch_vtable_function_descriptors (gdbarch)) vfn = value_addr (vfn); TRY { addr = value_as_address (vfn); } CATCH (ex, RETURN_MASK_ERROR) { printf_filtered (_("<error: %s>"), ex.message); got_error = 1; } END_CATCH if (!got_error) print_function_pointer_address (opts, gdbarch, addr, gdb_stdout); printf_filtered ("\n"); } } /* Implementation of the print_vtable method. */ static void gnuv3_print_vtable (struct value *value) { struct gdbarch *gdbarch; struct type *type; struct value *vtable; struct value_print_options opts; int count; value = coerce_ref (value); type = check_typedef (value_type (value)); if (TYPE_CODE (type) == TYPE_CODE_PTR) { value = value_ind (value); type = check_typedef (value_type (value)); } get_user_print_options (&opts); /* Respect 'set print object'. */ if (opts.objectprint) { value = value_full_object (value, NULL, 0, 0, 0); type = check_typedef (value_type (value)); } gdbarch = get_type_arch (type); vtable = NULL; if (TYPE_CODE (type) == TYPE_CODE_STRUCT) vtable = gnuv3_get_vtable (gdbarch, type, value_as_address (value_addr (value))); if (!vtable) { printf_filtered (_("This object does not have a virtual function table\n")); return; } htab_up offset_hash (htab_create_alloc (1, hash_value_and_voffset, eq_value_and_voffset, xfree, xcalloc, xfree)); std::vector<value_and_voffset *> result_vec; compute_vtable_size (offset_hash.get (), &result_vec, value); std::sort (result_vec.begin (), result_vec.end (), compare_value_and_voffset); count = 0; for (value_and_voffset *iter : result_vec) { if (iter->max_voffset >= 0) { if (count > 0) printf_filtered ("\n"); print_one_vtable (gdbarch, iter->value, iter->max_voffset, &opts); ++count; } } } /* Return a GDB type representing `struct std::type_info', laid out appropriately for ARCH. We use this function as the gdbarch per-architecture data initialization function. */ static void * build_std_type_info_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; int offset; struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; struct type *char_type = builtin_type (arch)->builtin_char; struct type *char_ptr_type = make_pointer_type (make_cv_type (1, 0, char_type, NULL), NULL); field_list = XCNEWVEC (struct field, 2); field = &field_list[0]; offset = 0; /* The vtable. */ FIELD_NAME (*field) = "_vptr.type_info"; FIELD_TYPE (*field) = void_ptr_type; SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; /* The name. */ FIELD_NAME (*field) = "__name"; FIELD_TYPE (*field) = char_ptr_type; SET_FIELD_BITPOS (*field, offset * TARGET_CHAR_BIT); offset += TYPE_LENGTH (FIELD_TYPE (*field)); field++; gdb_assert (field == (field_list + 2)); t = arch_type (arch, TYPE_CODE_STRUCT, offset * TARGET_CHAR_BIT, NULL); TYPE_NFIELDS (t) = field - field_list; TYPE_FIELDS (t) = field_list; TYPE_NAME (t) = "gdb_gnu_v3_type_info"; INIT_CPLUS_SPECIFIC (t); return t; } /* Implement the 'get_typeid_type' method. */ static struct type * gnuv3_get_typeid_type (struct gdbarch *gdbarch) { struct symbol *typeinfo; struct type *typeinfo_type; typeinfo = lookup_symbol ("std::type_info", NULL, STRUCT_DOMAIN, NULL).symbol; if (typeinfo == NULL) typeinfo_type = (struct type *) gdbarch_data (gdbarch, std_type_info_gdbarch_data); else typeinfo_type = SYMBOL_TYPE (typeinfo); return typeinfo_type; } /* Implement the 'get_typeid' method. */ static struct value * gnuv3_get_typeid (struct value *value) { struct type *typeinfo_type; struct type *type; struct gdbarch *gdbarch; struct value *result; std::string type_name, canonical; /* We have to handle values a bit trickily here, to allow this code to work properly with non_lvalue values that are really just disguised types. */ if (value_lval_const (value) == lval_memory) value = coerce_ref (value); type = check_typedef (value_type (value)); /* In the non_lvalue case, a reference might have slipped through here. */ if (TYPE_CODE (type) == TYPE_CODE_REF) type = check_typedef (TYPE_TARGET_TYPE (type)); /* Ignore top-level cv-qualifiers. */ type = make_cv_type (0, 0, type, NULL); gdbarch = get_type_arch (type); type_name = type_to_string (type); if (type_name.empty ()) error (_("cannot find typeinfo for unnamed type")); /* We need to canonicalize the type name here, because we do lookups using the demangled name, and so we must match the format it uses. E.g., GDB tends to use "const char *" as a type name, but the demangler uses "char const *". */ canonical = cp_canonicalize_string (type_name.c_str ()); if (!canonical.empty ()) type_name = canonical; typeinfo_type = gnuv3_get_typeid_type (gdbarch); /* We check for lval_memory because in the "typeid (type-id)" case, the type is passed via a not_lval value object. */ if (TYPE_CODE (type) == TYPE_CODE_STRUCT && value_lval_const (value) == lval_memory && gnuv3_dynamic_class (type)) { struct value *vtable, *typeinfo_value; CORE_ADDR address = value_address (value) + value_embedded_offset (value); vtable = gnuv3_get_vtable (gdbarch, type, address); if (vtable == NULL) error (_("cannot find typeinfo for object of type '%s'"), type_name.c_str ()); typeinfo_value = value_field (vtable, vtable_field_type_info); result = value_ind (value_cast (make_pointer_type (typeinfo_type, NULL), typeinfo_value)); } else { std::string sym_name = std::string ("typeinfo for ") + type_name; bound_minimal_symbol minsym = lookup_minimal_symbol (sym_name.c_str (), NULL, NULL); if (minsym.minsym == NULL) error (_("could not find typeinfo symbol for '%s'"), type_name.c_str ()); result = value_at_lazy (typeinfo_type, BMSYMBOL_VALUE_ADDRESS (minsym)); } return result; } /* Implement the 'get_typename_from_type_info' method. */ static std::string gnuv3_get_typename_from_type_info (struct value *type_info_ptr) { struct gdbarch *gdbarch = get_type_arch (value_type (type_info_ptr)); struct bound_minimal_symbol typeinfo_sym; CORE_ADDR addr; const char *symname; const char *class_name; const char *atsign; addr = value_as_address (type_info_ptr); typeinfo_sym = lookup_minimal_symbol_by_pc (addr); if (typeinfo_sym.minsym == NULL) error (_("could not find minimal symbol for typeinfo address %s"), paddress (gdbarch, addr)); #define TYPEINFO_PREFIX "typeinfo for " #define TYPEINFO_PREFIX_LEN (sizeof (TYPEINFO_PREFIX) - 1) symname = MSYMBOL_DEMANGLED_NAME (typeinfo_sym.minsym); if (symname == NULL || strncmp (symname, TYPEINFO_PREFIX, TYPEINFO_PREFIX_LEN)) error (_("typeinfo symbol '%s' has unexpected name"), MSYMBOL_LINKAGE_NAME (typeinfo_sym.minsym)); class_name = symname + TYPEINFO_PREFIX_LEN; /* Strip off @plt and version suffixes. */ atsign = strchr (class_name, '@'); if (atsign != NULL) return std::string (class_name, atsign - class_name); return class_name; } /* Implement the 'get_type_from_type_info' method. */ static struct type * gnuv3_get_type_from_type_info (struct value *type_info_ptr) { /* We have to parse the type name, since in general there is not a symbol for a type. This is somewhat bogus since there may be a mis-parse. Another approach might be to re-use the demangler's internal form to reconstruct the type somehow. */ std::string type_name = gnuv3_get_typename_from_type_info (type_info_ptr); expression_up expr (parse_expression (type_name.c_str ())); struct value *type_val = evaluate_type (expr.get ()); return value_type (type_val); } /* Determine if we are currently in a C++ thunk. If so, get the address of the routine we are thunking to and continue to there instead. */ static CORE_ADDR gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc) { CORE_ADDR real_stop_pc, method_stop_pc, func_addr; struct gdbarch *gdbarch = get_frame_arch (frame); struct bound_minimal_symbol thunk_sym, fn_sym; struct obj_section *section; const char *thunk_name, *fn_name; real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc); if (real_stop_pc == 0) real_stop_pc = stop_pc; /* Find the linker symbol for this potential thunk. */ thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc); section = find_pc_section (real_stop_pc); if (thunk_sym.minsym == NULL || section == NULL) return 0; /* The symbol's demangled name should be something like "virtual thunk to FUNCTION", where FUNCTION is the name of the function being thunked to. */ thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym.minsym); if (thunk_name == NULL || strstr (thunk_name, " thunk to ") == NULL) return 0; fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to "); fn_sym = lookup_minimal_symbol (fn_name, NULL, section->objfile); if (fn_sym.minsym == NULL) return 0; method_stop_pc = BMSYMBOL_VALUE_ADDRESS (fn_sym); /* Some targets have minimal symbols pointing to function descriptors (powerpc 64 for example). Make sure to retrieve the address of the real function from the function descriptor before passing on the address to other layers of GDB. */ func_addr = gdbarch_convert_from_func_ptr_addr (gdbarch, method_stop_pc, current_top_target ()); if (func_addr != 0) method_stop_pc = func_addr; real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, method_stop_pc); if (real_stop_pc == 0) real_stop_pc = method_stop_pc; return real_stop_pc; } /* Return nonzero if a type should be passed by reference. The rule in the v3 ABI document comes from section 3.1.1. If the type has a non-trivial copy constructor or destructor, then the caller must make a copy (by calling the copy constructor if there is one or perform the copy itself otherwise), pass the address of the copy, and then destroy the temporary (if necessary). For return values with non-trivial copy constructors or destructors, space will be allocated in the caller, and a pointer will be passed as the first argument (preceding "this"). We don't have a bulletproof mechanism for determining whether a constructor or destructor is trivial. For GCC and DWARF2 debug information, we can check the artificial flag. We don't do anything with the constructors or destructors, but we have to get the argument passing right anyway. */ static int gnuv3_pass_by_reference (struct type *type) { int fieldnum, fieldelem; type = check_typedef (type); /* We're only interested in things that can have methods. */ if (TYPE_CODE (type) != TYPE_CODE_STRUCT && TYPE_CODE (type) != TYPE_CODE_UNION) return 0; /* A dynamic class has a non-trivial copy constructor. See c++98 section 12.8 Copying class objects [class.copy]. */ if (gnuv3_dynamic_class (type)) return 1; for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++) for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum); fieldelem++) { struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum); const char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum); struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem); /* If this function is marked as artificial, it is compiler-generated, and we assume it is trivial. */ if (TYPE_FN_FIELD_ARTIFICIAL (fn, fieldelem)) continue; /* If we've found a destructor, we must pass this by reference. */ if (name[0] == '~') return 1; /* If the mangled name of this method doesn't indicate that it is a constructor, we're not interested. FIXME drow/2007-09-23: We could do this using the name of the method and the name of the class instead of dealing with the mangled name. We don't have a convenient function to strip off both leading scope qualifiers and trailing template arguments yet. */ if (!is_constructor_name (TYPE_FN_FIELD_PHYSNAME (fn, fieldelem)) && !TYPE_FN_FIELD_CONSTRUCTOR (fn, fieldelem)) continue; /* If this method takes two arguments, and the second argument is a reference to this class, then it is a copy constructor. */ if (TYPE_NFIELDS (fieldtype) == 2) { struct type *arg_type = TYPE_FIELD_TYPE (fieldtype, 1); if (TYPE_CODE (arg_type) == TYPE_CODE_REF) { struct type *arg_target_type; arg_target_type = check_typedef (TYPE_TARGET_TYPE (arg_type)); if (class_types_same_p (arg_target_type, type)) return 1; } } } /* Even if all the constructors and destructors were artificial, one of them may have invoked a non-artificial constructor or destructor in a base class. If any base class needs to be passed by reference, so does this class. Similarly for members, which are constructed whenever this class is. We do not need to worry about recursive loops here, since we are only looking at members of complete class type. Also ignore any static members. */ for (fieldnum = 0; fieldnum < TYPE_NFIELDS (type); fieldnum++) if (! field_is_static (&TYPE_FIELD (type, fieldnum)) && gnuv3_pass_by_reference (TYPE_FIELD_TYPE (type, fieldnum))) return 1; return 0; } static void init_gnuv3_ops (void) { vtable_type_gdbarch_data = gdbarch_data_register_post_init (build_gdb_vtable_type); std_type_info_gdbarch_data = gdbarch_data_register_post_init (build_std_type_info_type); gnu_v3_abi_ops.shortname = "gnu-v3"; gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI"; gnu_v3_abi_ops.doc = "G++ Version 3 ABI"; gnu_v3_abi_ops.is_destructor_name = (enum dtor_kinds (*) (const char *))is_gnu_v3_mangled_dtor; gnu_v3_abi_ops.is_constructor_name = (enum ctor_kinds (*) (const char *))is_gnu_v3_mangled_ctor; gnu_v3_abi_ops.is_vtable_name = gnuv3_is_vtable_name; gnu_v3_abi_ops.is_operator_name = gnuv3_is_operator_name; gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type; gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field; gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset; gnu_v3_abi_ops.print_method_ptr = gnuv3_print_method_ptr; gnu_v3_abi_ops.method_ptr_size = gnuv3_method_ptr_size; gnu_v3_abi_ops.make_method_ptr = gnuv3_make_method_ptr; gnu_v3_abi_ops.method_ptr_to_value = gnuv3_method_ptr_to_value; gnu_v3_abi_ops.print_vtable = gnuv3_print_vtable; gnu_v3_abi_ops.get_typeid = gnuv3_get_typeid; gnu_v3_abi_ops.get_typeid_type = gnuv3_get_typeid_type; gnu_v3_abi_ops.get_type_from_type_info = gnuv3_get_type_from_type_info; gnu_v3_abi_ops.get_typename_from_type_info = gnuv3_get_typename_from_type_info; gnu_v3_abi_ops.skip_trampoline = gnuv3_skip_trampoline; gnu_v3_abi_ops.pass_by_reference = gnuv3_pass_by_reference; } void _initialize_gnu_v3_abi (void) { init_gnuv3_ops (); register_cp_abi (&gnu_v3_abi_ops); set_cp_abi_as_auto_default (gnu_v3_abi_ops.shortname); }
afa2e22586c21301174dbeb68511d02ba231f7c8
6e4b6c7e783b099e63f465bdad1ef47c448c0f66
/TinyCompiler/globals.h
223392c71d53e61e686f510f8586f853f0ccc2ca
[]
no_license
LiPengfei/TinyCompiler
798deeac1415d00dd62217c80c10ba515e8e1c55
86d1398614b073de3a941aff85717294f50fb7d5
refs/heads/master
2021-01-02T22:59:23.408529
2015-02-07T15:41:38
2015-02-07T15:44:21
29,178,757
0
0
null
null
null
null
UTF-8
C
false
false
1,497
h
globals.h
#ifndef _GLOBALS_H_ #define _GLOBALS_H_ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #define MAXRESERVED 8 typedef enum { ENDFILE, ERROR, IF, THEN, ELSE, END, REPEAT, UNTIL, READ, WRITE, ID, NUM, ASSIGN, EQ, LT, PLUS, MINUS, TIMES, OVER, LPAREN, RPAREN, SEMI } TokenType; extern FILE *source; extern FILE *listing; extern FILE *code; extern int lineno; /***************************************************/ /**************syntax tree for parsing**************/ /***************************************************/ typedef enum {StmtK, ExpK} NodeKind; typedef enum {IfK, RepeatK, AssignK, ReadK, WriteK} StmtKind; typedef enum {OpK, ConstK, IdK} ExpKind; /* ExpType is used for type checking */ typedef enum {Void, Interger, Boolean} ExpType; #define MAXCHILDREN 3 typedef struct treeNode { struct treeNode *child[MAXCHILDREN]; struct treeNode *sibling; int lineno; NodeKind nodekind; union {StmtKind stmt; ExpKind exp;} kind; union {TokenType op; int val; char *name;} attr; ExpType type; /* for type checking of exps*/ } TreeNode; /***************************************************/ /***************Flags for tracing*******************/ /***************************************************/ extern int EchoSource; extern int TraceScan; extern int TraceParse; extern int TraceAnalyze; extern int TraceCode; extern int Error; #endif
7b66a86298f713e0b68564577936601553a9d8a7
c827bfebbde82906e6b14a3f77d8f17830ea35da
/Development3.0/TeevraNative/eurex12_Headers/EurexTestHarness/EurexTestHarness/EurexTestHarness/DelUsrSecuProf.h
08ed8232470bd45d3c62a5e55b9b5c89252dfbbd
[]
no_license
GiovanniPucariello/TeevraCore
13ccf7995c116267de5c403b962f1dc524ac1af7
9d755cc9ca91fb3ebc5b227d9de6bcf98a02c7b7
refs/heads/master
2021-05-29T18:12:29.174279
2013-04-22T07:44:28
2013-04-22T07:44:28
null
0
0
null
null
null
null
UTF-8
C
false
false
2,714
h
DelUsrSecuProf.h
#include <DelUsrSecuProf.hxx> #define BUFFER_SIZE 1000 /** * @Generated get<<InnerStruct>>() * **/ bscDelUsrSecuProfRequestT getBscDelUsrSecuProfRequestT(char* testCaseNum , const char *root) { bscDelUsrSecuProfRequestT vbscDelUsrSecuProfRequestT; int i; vbscDelUsrSecuProfRequestT.trdrIdGrp = getTrdrIdGrpT(testCaseNum, "bscDelUsrSecuProfRequestT"); for(i=0;i<DRIV_TIMESTAMP_LEN;i++) { vbscDelUsrSecuProfRequestT.dateLstUpdDat[i]= ' '; } char ldateLstUpdDat[DRIV_TIMESTAMP_LEN] = {""}; getStrProperty("DelUsrSecuProf.bscDelUsrSecuProfRequestT.dateLstUpdDat", ldateLstUpdDat); memcpy(vbscDelUsrSecuProfRequestT.dateLstUpdDat, ldateLstUpdDat, DRIV_TIMESTAMP_LEN); return vbscDelUsrSecuProfRequestT; } /** * @Generated get<<InnerStruct>>() * **/ delUsrSecuProfRequestT getDelUsrSecuProfRequestT(char* testCaseNum , const char *root) { delUsrSecuProfRequestT vdelUsrSecuProfRequestT; int i; vdelUsrSecuProfRequestT.header = getDataHeaderT(testCaseNum, "delUsrSecuProfRequestT"); vdelUsrSecuProfRequestT.basic = getBscDelUsrSecuProfRequestT(testCaseNum, "delUsrSecuProfRequestT"); return vdelUsrSecuProfRequestT; } /** * @Generated get<<InnerStruct>>() * **/ delUsrSecuProfResponseT getDelUsrSecuProfResponseT(char* testCaseNum , const char *root) { delUsrSecuProfResponseT vdelUsrSecuProfResponseT; int i; vdelUsrSecuProfResponseT.header = getDataHeaderT(testCaseNum, "delUsrSecuProfResponseT"); return vdelUsrSecuProfResponseT; } /** * @Generated compare<<InnerStruct>>() * **/ void compareBscDelUsrSecuProfRequestT(bscDelUsrSecuProfRequestT actual, bscDelUsrSecuProfRequestT expected, char* logMsg) { char tempLogMsg[BUFFER_SIZE]; tempLogMsg[0] = '\0'; int i; compareTrdrIdGrpT (actual.trdrIdGrp,expected.trdrIdGrp, logMsg); if ( memcmp(actual.dateLstUpdDat, expected.dateLstUpdDat, DRIV_TIMESTAMP_LEN)) { sprintf_s(tempLogMsg, BUFFER_SIZE, "In bscDelUsrSecuProfRequestT, dateLstUpdDat not matching. Actual %s but Expected %s", actual.dateLstUpdDat, expected.dateLstUpdDat); strcat_s(logMsg, BUFFER_SIZE, tempLogMsg); } } /** * @Generated compare<<InnerStruct>>() * **/ void compareDelUsrSecuProfRequestT(delUsrSecuProfRequestT actual, delUsrSecuProfRequestT expected, char* logMsg) { char tempLogMsg[BUFFER_SIZE]; tempLogMsg[0] = '\0'; int i; compareDataHeaderT (actual.header,expected.header, logMsg); compareBscDelUsrSecuProfRequestT (actual.basic,expected.basic, logMsg); } /** * @Generated compare<<InnerStruct>>() * **/ void compareDelUsrSecuProfResponseT(delUsrSecuProfResponseT actual, delUsrSecuProfResponseT expected, char* logMsg) { char tempLogMsg[BUFFER_SIZE]; tempLogMsg[0] = '\0'; int i; compareDataHeaderT (actual.header,expected.header, logMsg); }
a1011f32efe61de58423d690bc9efc3afccc1f7c
3c5b3b208d70db4f251c801b6126e3e9ec283061
/m3-loaders/drivers/jpegdec/source/common/workaround.h
b2ffea42128dd4ab6ff5279c954410ef7e606f31
[]
no_license
Rabit-scy/m3-loader
cd4e240deab8787aee02ce53e50b5d0e5b41230c
ef65392a9a46159679ccdd57c2ed4df934299d87
refs/heads/master
2020-06-02T22:02:30.866004
2019-06-11T08:56:12
2019-06-11T08:56:12
191,322,640
2
1
null
null
null
null
UTF-8
C
false
false
2,088
h
workaround.h
/* * (C) COPYRIGHT 2011 HANTRO PRODUCTS * * Please contact: hantro-support@verisilicon.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ /*------------------------------------------------------------------------------ -- -- Abstract : Header file for stream decoding utilities -- ------------------------------------------------------------------------------*/ #ifndef WORKAROUND_H_DEFINED #define WORKAROUND_H_DEFINED #include "basetype.h" /* Union containing structures to hold different formats' workarounds. */ typedef union workaround_s { struct { u32 stuffing; u32 startCode; } mpeg; struct { u32 multibuffer; } rv; struct { u32 frameNum; } h264; } workaround_t; #ifndef HANTRO_TRUE #define HANTRO_TRUE (1) #endif /* HANTRO_TRUE */ #ifndef HANTRO_FALSE #define HANTRO_FALSE (0) #endif /* HANTRO_FALSE*/ void InitWorkarounds(u32 decMode, workaround_t *pWorkarounds ); void PrepareStuffingWorkaround( u8 *pDecOut, u32 vopWidth, u32 vopHeight ); u32 ProcessStuffingWorkaround( u8 * pDecOut, u8 * pRefPic, u32 vopWidth, u32 vopHeight ); void PrepareStartCodeWorkaround( u8 *pDecOut, u32 vopWidth, u32 vopHeight, u32 topField, u32 dpbMode ); u32 ProcessStartCodeWorkaround( u8 *pDecOut, u32 vopWidth, u32 vopHeight, u32 topField, u32 dpbMode ); #endif /* WORKAROUND_H_DEFINED */
5b10e9870e92db516c84d19e2a27e221e7760bc9
ebc3b735872a294b7d3ce3ed97a623ceacb0906f
/include/ftl-port.h
1fcbbd6ba30c348e9c6cb5dcba85271f013312bd
[]
no_license
SigrandLLC/sg_boot
2a04709dacb396d2567124e9fd07a32e1eaff18a
7eda2c6d185b020825e7fa65279430e3e5180fc4
refs/heads/master
2021-04-28T02:44:31.288782
2017-08-10T09:45:58
2017-08-10T09:45:58
122,121,365
0
0
null
null
null
null
UTF-8
C
false
false
2,522
h
ftl-port.h
/* * ftl-port.h -- defines to support the NAND Flash Translation Layer * * (C) Copyright 2003, Pro Chao (proc@admtek.com.tw) * * $Id: ftl-port.h,v 1.1.1.1 2003/10/8 10:22:53 pro Exp $ */ #ifndef __MTD_FTL_H__ #define __MTD_FTL_H__ #include <stdlib.h> #include <stdint.h> #include <errno.h> typedef unsigned char u_char; typedef long loff_t; #define min_t(type,x,y) \ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) #define max_t(type,x,y) \ ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) // struct nand_oobinfo { int useecc; int eccpos[6]; }; // #define SECTORSIZE 512 #define FTL_PARTN_BITS 4 // #define NAND_CTL_SETNCE 1 #define NAND_CTL_CLRNCE 2 #define NAND_CTL_SETCLE 3 #define NAND_CTL_CLRCLE 4 #define NAND_CTL_SETALE 5 #define NAND_CTL_CLRALE 6 #define NAND_CTL_SETWP 7 #define NAND_CTL_CLRWP 8 // control signal //#define NAND_RW_REG 0x0 //data register #define NAND_SET_CEn 0x1 //CE# low #define NAND_CLR_CEn 0x2 //CE# high #define NAND_CLR_CLE 0x3 //CLE low #define NAND_SET_CLE 0x4 //CLE high #define NAND_CLR_ALE 0x5 //ALE low #define NAND_SET_ALE 0x6 //ALE high #define NAND_SET_SPn 0x7 //SP# low (use spare area) #define NAND_CLR_SPn 0x8 //SP# high (do not use spare area) #define NAND_SET_WPn 0x9 //WP# low #define NAND_CLR_WPn 0xA //WP# high #define NAND_STS_REG 0xB //Status register // #define NAND_ECC_NONE 0 #define NAND_ECC_SOFT 1 #define NAND_ECC_HW3_256 2 #define NAND_ECC_HW3_512 3 #define NAND_ECC_HW6_512 4 #define NAND_ECC_DISKONCHIP 5 // page-shift #define NAND_PAGE_SHIFT 9 //512 bytes //#define NULL ((void *) 0) /* Block Control Information */ #define SECTOR_FREE 0xff // macros for Status & Status1 fields #define SECTOR_USED 0x55 #define SECTOR_IGNORED 0x11 #define SECTOR_DELETED 0x00 #define ERASE_MARK 0x3c69 struct ftl_bci { __u8 ECCsig[6]; __u8 Status; __u8 Status1; } __attribute__ ((packed)); struct ftl_unithead1 { __u16 virtualUnitNo; __u16 prevUnitNo; __u8 ANAC; __u8 NACs; __u8 parityPerField; __u8 discarded; } __attribute__ ((packed)); struct ftl_unithead2 { __u8 parityPerField; __u8 ANAC; __u16 prevUnitNo; __u16 virtualUnitNo; __u8 NACs; __u8 discarded; } __attribute__ ((packed)); struct ftl_unittail { __u8 Reserved[4]; __u16 EraseMark; __u16 EraseMark1; } __attribute__ ((packed)); union ftl_uci { struct ftl_unithead1 a; struct ftl_unithead2 b; struct ftl_unittail c; }; struct ftl_oob { struct ftl_bci b; union ftl_uci u; }; #endif /* __MTD_FTL_H__ */
3e414ebb7967d5b1c42a13b270f712e76be06bdc
4c132cab4194e1c382aab4149ea793a32d39f83f
/USER/esp01.c
7b61f099f6f9f591dde15c31e4fd8fc81748652e
[]
no_license
Williamrjw/YuGang
b54007058c04714a1f3f136bce9c8701c4fd96b3
49e2bddeccde19adb7efa3c6d7a459f6d529413a
refs/heads/main
2023-07-04T12:12:58.138099
2021-08-10T12:07:00
2021-08-10T12:07:00
383,314,044
0
0
null
null
null
null
GB18030
C
false
false
6,139
c
esp01.c
#include "def.h" #include "esp01.h" #include "watchdog.h" #include "stdio.h" #include "string.h" #include "stm32f10x.h" #include "stm32f10x_usart.h" volatile CHAR RX_FLAG_END_LINE = 0; volatile BYTE RXi; //index volatile CHAR RXc; //char CHAR RX_BUF[RX_BUF_SIZE] = {'\0'};//接收buffer CHAR TIME_CMD[48] = {0xE3, 0x0, 0x6, 0xEC, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x31, 0x4E, 0x31, 0x34, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; VOID clear_RXBuffer(VOID) { for (RXi=0; RXi<RX_BUF_SIZE; RXi++) RX_BUF[RXi] = '\0'; RXi = 0; } VOID USART_Configuration(VOID){ /* Configure the USART1 */ USART_InitTypeDef USART_InitStructure; /* USART1 configuration ------------------------------------------------------*/ /* USART1 configured as follow: - BaudRate = 115200 baud - Word Length = 8 Bits - One Stop Bit - No parity - Hardware flow control disabled (RTS and CTS signals) - Receive and transmit enabled - USART Clock disabled - USART CPOL: Clock is active low - USART CPHA: Data is captured on the middle - USART LastBit: The clock pulse of the last data bit is not output to the SCLK pin */ USART_InitStructure.USART_BaudRate = 115200; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(USART1, &USART_InitStructure); /* Enable USART1 */ USART_Cmd(USART1, ENABLE); /* Enable the USART1 Receive interrupt: this interrupt is generated when the USART1 receive data register is not empty */ USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); } VOID USART1_IRQHandler(VOID) { if ((USART1->SR & USART_FLAG_RXNE) != (u16)RESET) { //GPIO_ResetBits(GPIOC, GPIO_Pin_13); RXc = USART_ReceiveData(USART1); //GPIO_SetBits(GPIOC, GPIO_Pin_13); RX_BUF[RXi] = RXc; RXi++; if (RXc != 13) { if (RXi > RX_BUF_SIZE-1) { clear_RXBuffer(); } } else { RX_FLAG_END_LINE = 1; } } } VOID USARTSend(CHAR *pucBuffer) { while (*pucBuffer) { USART_SendData(USART1, *pucBuffer++); while(USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); } } VOID USARTSendLen(CHAR pucBuffer [] ,INT len){ INT i = 0; for (i =0 ;i < len;i++) { USART_SendData(USART1, pucBuffer[i]); while(USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET); } } VOID USARTRead(VOID){ while(TRUE){ if (RX_FLAG_END_LINE == 1) { // Reset END_LINE Flag RX_FLAG_END_LINE = 0; break; } } } VOID SEND_CMD(STATUS* status,CHAR * cmd,CHAR * reply,DELAY_TIME delay_time){ clear_RXBuffer(); USARTSend(cmd); USARTSend("\r\n"); sleep(delay_time); USARTRead(); if(strstr(RX_BUF,reply)){ return; } else if(strstr(RX_BUF,"ALREADY CONNECTED")){ return; } else if(strstr(RX_BUF,"WIFI CONNECTED")){ return; } else *status = NETWORK_CONNECT_ERROR; } VOID SEND_DATA(STATUS* status,DATA *data,CHAR * reply,DELAY_TIME delay_time){ CHAR tmp[50]={0}; INT i = 0; clear_RXBuffer(); /************************* DATA{ TIME timeStamp; //时间戳 TEMP temp[TEMP_SENSOR_NUMS]; //温度 LIGHT light; //光照度 PH ph; //pH值 FLOW flow; //水流状态 STATUS *status; //状态 }; *************************/ I_WD_Feed(status); sprintf(tmp,"TIMESTAMP:\t%ld",data->timeStamp); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); for(i=0;i<TEMP_SENSOR_NUMS;i++){ I_WD_Feed(status); sprintf(tmp,"TEMP[%d]:\t%.2f degree(C)",i,data->temp[i]); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); } I_WD_Feed(status); sprintf(tmp,"LIGHT:\t%.2f lx",data->light); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); I_WD_Feed(status); sprintf(tmp,"PH:\t%.1f",data->ph); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); I_WD_Feed(status); sprintf(tmp,"FLOW:\t%d",data->flow); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); I_WD_Feed(status); sprintf(tmp,"STAT:\t%d",(INT) *status); SEND_MESSAGE(status,tmp,strlen(tmp),"OK",delay_time); I_WD_Feed(status); } VOID SEND_MESSAGE(STATUS* status,CHAR * msg,INT len, CHAR *reply,DELAY_TIME delay_time) { CHAR cmd[20] = {0}; sprintf(cmd," AT+CIPSEND=%d",len); clear_RXBuffer(); USARTSend(cmd); USARTSend("\r\n"); sleep(delay_time); USARTRead(); I_WD_Feed(status); clear_RXBuffer(); USARTSendLen(msg,len); //USARTSend("\r\n"); sleep(delay_time); USARTRead(); if(strstr(RX_BUF,reply)){ return; } else if(strstr(RX_BUF,"busy")){ *status = SERVER_BUSY_ERROR; } else if(strstr(RX_BUF,"FAIL")){ *status = SERVER_CONNECT_ERROR; } else *status = NETWORK_CONNECT_ERROR; } TIME getTimestamp(STATUS* status){ CHAR cmd[RX_BUF_SIZE] = {0}; TIME time = 0ll ; //检查是否正常 SEND_CMD(status," AT","OK",5000); //设置模式 SEND_CMD(status," AT+CWMODE=1","OK",5000); if(checkWIFIconnected(status) == FALSE){ //连接WIFI strcpy(cmd," AT+CWJAP="); strcat(cmd,LOCAL_SSID); strcat(cmd,","); strcat(cmd,LOCAL_PWD); I_WD_Feed(status); SEND_CMD(status,cmd,"OK",5000000); I_WD_Feed(status); } //查看IP与mac地址 SEND_CMD(status," AT+CIFSR","OK",10000); //设置UDP服务器参数 strcpy(cmd," AT+CIPSTART=\"UDP\","); strcat(cmd,TIME_SERVER_URL); strcat(cmd,","); strcat(cmd,TIME_SERVER_PORT); I_WD_Feed(status); SEND_CMD(status, cmd,"OK",2000000); I_WD_Feed(status); SEND_MESSAGE(status, TIME_CMD ,48 ,"OK" ,5000000); I_WD_Feed(status); time = (TIME) RX_BUF[78]<<24|(TIME) RX_BUF[79]<<16|(TIME)RX_BUF[80]<<8|RX_BUF[81]; if(time == 0){ *status = SERVER_TIME_ERROR; return 0;} time = time - 2208988800u; SEND_CMD(status," AT+CIPCLOSE","OK",5000); return time; } BYTE checkWIFIconnected(STATUS* status) { I_WD_Feed(status); SEND_CMD(status," AT+CWJAP?","OK",8000); I_WD_Feed(status); if(strstr(RX_BUF,LOCAL_SSID)) return TRUE; return FALSE; }
5b43298cd545b31847ff1cb3cb980995fb40a822
33ad62d02ae6e5421c20e857a88e88fd23d6edd1
/pacman1/pacman1/Temp/il2cppOutput/il2cppOutput/UnityEngine_UnityEngine_AnimationCurveMethodDeclarations.h
24f7111069522f75aa8786a7c31cae61357ad46f
[]
no_license
akshayadav/pacmanVRAR
ae18e540da85038d2d14d5df614dfb63f9f40330
97922200890739f9c837eb65f593149623b0c5a7
refs/heads/master
2016-08-12T06:53:23.396650
2016-03-29T21:04:24
2016-03-29T21:04:24
55,010,111
0
0
null
null
null
null
UTF-8
C
false
false
1,689
h
UnityEngine_UnityEngine_AnimationCurveMethodDeclarations.h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // UnityEngine.AnimationCurve struct AnimationCurve_t285; struct AnimationCurve_t285_marshaled; // UnityEngine.Keyframe[] struct KeyframeU5BU5D_t445; #include "codegen/il2cpp-codegen.h" // System.Void UnityEngine.AnimationCurve::.ctor(UnityEngine.Keyframe[]) extern "C" void AnimationCurve__ctor_m1600 (AnimationCurve_t285 * __this, KeyframeU5BU5D_t445* ___keys, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::.ctor() extern "C" void AnimationCurve__ctor_m1601 (AnimationCurve_t285 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::Cleanup() extern "C" void AnimationCurve_Cleanup_m1602 (AnimationCurve_t285 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::Finalize() extern "C" void AnimationCurve_Finalize_m1603 (AnimationCurve_t285 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::Init(UnityEngine.Keyframe[]) extern "C" void AnimationCurve_Init_m1604 (AnimationCurve_t285 * __this, KeyframeU5BU5D_t445* ___keys, const MethodInfo* method) IL2CPP_METHOD_ATTR; extern "C" void AnimationCurve_t285_marshal(const AnimationCurve_t285& unmarshaled, AnimationCurve_t285_marshaled& marshaled); extern "C" void AnimationCurve_t285_marshal_back(const AnimationCurve_t285_marshaled& marshaled, AnimationCurve_t285& unmarshaled); extern "C" void AnimationCurve_t285_marshal_cleanup(AnimationCurve_t285_marshaled& marshaled);
b8ae02ead42b63c114282e754642bd7f3f60dc73
3d4607825a21a0c135843367cbd4cbe4ffda999e
/Stratego/Libs/Jugadas.h
54c3b7db3d1e6228de838db9855f72b8dd341990
[]
no_license
ESAT-jimenezur/Programacion
52f0049f92490d8c15a6d3bf0d2e8ca7b0d90713
4429bda40e4fd4b2aa5f3d8628e9391d61dca66b
refs/heads/master
2021-01-01T18:12:43.997893
2014-03-31T16:24:42
2014-03-31T16:24:42
null
0
0
null
null
null
null
UTF-8
C
false
false
362
h
Jugadas.h
int j_Defensiva[4][10] = { 2,6,5,9,2,6,2,10,6,2, 7,2,11,1,8,4,2,7,8,4, //11 = Bomba 5,4,11,2,7,3,5,6,5,11, //11 = Bomba 3,11,4,2,3,11,3,3,11,12 //12 = Bandera }; int j_Agresiva[4][10] = { 6,2,4,9,6,2,2,10,2,6, 5,2,7,5,11,2,7,7,8,3, //11 = Bomba 4,8,1,3,11,2,6,5,5,11, //11 = Bomba 3,11,4,11,4,2,3,3,11,12 //12 = Bandera };
ad69bfa5d441d2fc5f22fdc7a5666ee55b07b7bc
e22e53fe6f5912e6ae5a7a46f16a4f78534c540b
/develop/toolchains/T-TDT/toolchain_mips24ke_nfp_be/target/testsuite/gcc/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
34e805156f1be935c22c0f40f48cb3095a62db77
[]
no_license
metalsky/SamyGO
78354e3addd116e6821f727cee61333fbdbfd27d
494064acbf5451de530e1e953a4c943eb1581fd5
refs/heads/master
2020-03-19T20:34:02.065750
2014-09-08T04:07:08
2014-09-08T04:07:08
null
0
0
null
null
null
null
UTF-8
C
false
false
340
c
_Pragma6.c
/* PR c/27747 */ /* This is supposed to succeed only if the target defines HANDLE_PRAGMA_PACK_PUSH_POP and doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION. */ /* { dg-do compile { target { ! { *-*-solaris2* fido-*-* m68k-*-* sh*-[us]*-elf } } } } */ #define push bar #define foo _Pragma ("pack(push)") foo int i; #pragma pack(pop)
e067e3b7218d6fe7f34c818448030f31d25f773f
566c98ecdc46c68d2592c21eeb2de19fde6d68c7
/Intersection.c
2fb7ea0ea81a4a258d16bd263d48edce1827b537
[]
no_license
deepti15992/Practice
a3351f75afa6bdc2482593802c8e80ca8efef67e
8d34ad837c54e05fc5d1cce5d45f458261e1bc4c
refs/heads/master
2021-06-28T23:52:37.809558
2018-07-16T06:36:51
2018-07-16T06:36:51
96,702,120
0
0
null
null
null
null
UTF-8
C
false
false
796
c
Intersection.c
/** * Given two singly linked lists, determine if they intersect. Return the intersecting node. * a -> b -> c -> d * \ * f -> g -> i -> e -> k -> l. */ struct node { int val; struct node *next; }; int listlen(struct node *head) { int len = 1; if (!head) return 0; while (head->next != NULL) { head = head->next; len++; } return len; } struct node *IntersectionNode(struct node *head1, struct node *head2) { struct node *tmp = head1; uint64_t *table = NULL; int i = 0; if (!head1 || !head2) return NULL; table = malloc(sizeof(uint64_t) * listlen(head1)); while (tmp->next != NULL) { table[i] = tmp; tmp = tmp->next; i++; } tmp = head2; while (tmp->next != NULL) { if (contains (table, tmp)) return tmp; tmp = tmp->next; } return NULL; }
5f036592c0a31d37bbe165a3442d88d006cf93b2
cabdb6cd21833396428e3a8e95248cbd9dee66e8
/18F4520 BackPlane I2C/main_AE_MF_1.0.c
74b4c1cf93dca5d70b382f545b92f2505d19fe69
[]
no_license
gunnerfeldt/firmware
797a1d9398202354354acd44a167233a71fce8d6
59ea7ad6b6eb037c3656af1b669e2fca559812a9
refs/heads/master
2021-03-12T20:10:24.882902
2015-01-05T01:02:36
2015-01-05T01:02:36
28,789,370
0
2
null
null
null
null
UTF-8
C
false
false
8,611
c
main_AE_MF_1.0.c
/* Compile options: -ml (Large code model) */ //#include <stdio.h> #include <p18f4520.h> #include <timers.h> #include "typedefs.h" #include <math.h> #include <i2c.h> // #pragma config WDT = ON /* * IO_card.h * Test * * Created by Pelle Gunnerfeldt on 2011-04-12. * Copyright 2011 __MyCompanyName__. All rights reserved. * */ // allocate some resources in ACCESS RAM for speedy access in interrupt routines // all locations in this section are volatile #define LED PORTAbits.RA1 #define SSP_en !PORTBbits.RB0 #define SSP_clk PORTBbits.RB1 #define STROBE PORTBbits.RB2 #define SSP_write() TRISD = 0; #define SSP_read() TRISD = 255; #define STATUS_MASK 0x0C; #define MUTE_MASK 0x10; #define IO_CARD_ID 0x01 // bits 0b00110000 is free for check bits. 00 or 11 could be scrap data. // 01 or 10 is suitable #define STOP_TMR_0 INTCONbits.TMR0IE=0 #define START_TMR_0 INTCONbits.TMR0IF=0;INTCONbits.TMR0IE=1 #define bit_set(var,bitno) ((var) |= 1 << (bitno)) #define bit_clr(var,bitno) ((var) &= ~(1 << (bitno))) #define testbit_on(data,bitno) ((data>>bitno)&0x01) #define testbitmask(data,bitmask) ((data&bitmask)==bitmask) #define bits_on(var,mask) var |= mask #define bits_off(var,mask) var &= ~0 ^ mask #define hibyte(x) (unsigned char)(x>>8) #define lobyte(x) (unsigned char)(x & 0xFF) #define EX08_ID 0x12; #define EX08MF_ID 0x22; #define MAJOR 0; #define MINOR 9; #define SLOW 103 #define FAST 130 #pragma udata access volatile_access union INdataUnion { unsigned char data[16]; unsigned int word[8]; struct{ unsigned vca_lo:8; unsigned vca_hi:2; unsigned status:2; unsigned id_change_flag:1; unsigned blink_flag:1; unsigned touchsense:1; unsigned mute:1; }channel[8]; struct{ unsigned :8; unsigned cmd:4; unsigned flag:1; unsigned :3; }cmd[8]; struct{ unsigned lo_byte:8; unsigned :6; unsigned hi_byte:2; }vcaGroup[8]; }; union OUTdataUnion { unsigned char data[16]; unsigned int word[8]; struct{ unsigned vca_lo:8; unsigned vca_hi:2; unsigned status_press:1; unsigned status_release:1; unsigned card_id:2; unsigned mute_press:1; unsigned mute_release:1; }channel[8]; struct{ unsigned vca_lo:8; unsigned vca_hi:2; unsigned status:2; unsigned touch_press:1; unsigned touch_release:1; unsigned mute_press:1; unsigned mute_release:1; }mf[8]; }; ram near union INdataUnion INdata; ram near union INdataUnion INbuffer; ram near union OUTdataUnion OUTdata; ram near unsigned char cueTableCntr; ram near unsigned char cueTableFlag; #pragma udata unsigned char MOTORFADERS = 0; unsigned char HANDSHAKE = 0; unsigned int BlinkCnt = 0; unsigned int status_bits; unsigned char fpsCntr; unsigned char fpsTmr = FAST; byte BlinkLED = 1; byte LEDtoggle = 1; unsigned char statusFlag = 0; int adc; // ADC int byte adcMSB; // ADC byte byte adcLSB; // ADC byte byte adcchn = 0; byte error; const byte MANUAL = 0x00; const byte AUTO = 0x04; const byte TOUCH = 0x08; const byte WRITE = 0x0C; const unsigned char TICK_RATE = 8; BOOL clk_flg = FALSE; unsigned long Ltimer; unsigned char clk_flag = 0; unsigned long blinkcnt; unsigned long cnt; unsigned long Wcnt; unsigned long wCntr; unsigned long cnt1; unsigned long cnt2; unsigned long cnt3; byte LEDword; unsigned char doOnce=0; unsigned char MFtimerTick; byte LED_byte; unsigned char ParallelPortflag = 0; unsigned char Q_Frame = 0; unsigned char Q_Frame_Flag = 1; unsigned char Timer_Flag = 1; unsigned char MFtimer = 0; unsigned char MFtimerIndex=0; // *********************************** Prototypes **************************************** void Init(void); void Motor_Faders(unsigned char); #pragma code // *********************************** Interrupts **************************************** #pragma interrupt YourHighPriorityISRCode void YourHighPriorityISRCode() { unsigned char n, chn, i; if (INTCONbits.INT0IF) // Interrupt flag for RB0 { cnt=0; SSP_write(); if (!ParallelPortflag) // Interrupt flag for RB0 { LATD = OUTdata.data[0]; // start with first byte on parallel port while(cnt<16) { while(SSP_clk==0){;} // Wait for fisrt clock cnt++; // count index LATD = OUTdata.data[(cnt)]; // Put byte on parallel port while(SSP_clk==1){;} // Data must remain on the port until clock falls if(!SSP_en)break; // if CS pin releases, abort } // loop 16 times SSP_read(); // Then read while(cnt<32) { while(SSP_clk==0){;} // Wait until clock rises INbuffer.data[cnt-16]=PORTD; // read and store port in a buffer cnt++; // count index while(SSP_clk==1){;} // hold until clock falls if(!SSP_en)break; // if CS pin releases, abort } if(cnt==32)ParallelPortflag=1; // Flag for new data in cueTableCntr=0; fpsCntr=0; } INTCONbits.INT0IF=0; // clear int flag } if (INTCON3bits.INT2IF) // Interrupt flag for RB1 { Q_Frame_Flag = 1; // Strobe every Q frame INTCON3bits.INT2IF = 0; // Clear interrupt on port RB1 } /* Fires with a 2ms interval Builds a cue table for operations 16 slots per cycle each slot must not exceed 2ms Motor Fader Index reset on every busComm The other circulate freely Cue Table (0-15): Odd - MUX ADC Update DAC + Mute Read Switches Even - Read ADC + Mute Update DAC + Mute Update LEDs */ // I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! I2C IN !!! if (PIR1bits.SSPIF == 1) { PIR1bits.SSPIF = 0; // clear interrupt flag } if (INTCONbits.TMR0IF) // Timer base for creating slots in between transfers { cueTableCntr++; cueTableFlag=1; BlinkCnt++; // BlinkLED=(BlinkCnt&0x0040)!=0; // BlinkTouchStatusLED=(BlinkCnt&0x0380)!=0; INTCONbits.TMR0IF = 0; TMR0L=130; } } #pragma interruptlow YourLowPriorityISRCode void YourLowPriorityISRCode() { } //This return will be a "retfie", since this is in a #pragma interruptlow section #pragma code // *********************************** Init **************************************** void Init(void) { int n; T1CONbits.T1OSCEN=0; // Turn off OSC Timer 1 thing. Didn't effect anything after all.� TRISA = 0x0D; // Port A: RA0=ADC, RA1=LED, RA2=VREF-, RA3=VREF+, RA5=MUTE_DATA, RA6=OSC; TRISB = 0x07; // Port B: RB0, RB1, RB2=P.Port TRISC = 0x09; // Port C: RC0=SW_DATA, RC1=SW_LOAD, RC2=Clock, RC3=MUTE_IN TRISD = 0xFF; TRISE = 0x00; // Set buffers to zero. Just in case for(n=0;n<16;n++) { OUTdata.data[n]=0; INdata.data[n]=0; } INTCONbits.GIE = 1; // Enables Low Prio interrupts INTCONbits.PEIE = 1; // Enables High Prio // RCONbits.IPEN = 1; // Enables Priorites INTCONbits.GIEL = 1; // Enables Low Prio interrupts INTCONbits.GIEH = 1; // Enables High Prio PIE1bits.ADIE=1; PIR1bits.ADIF=0; INTCON2bits.INTEDG0 = 0; // Chip Select is inverted INTCON2bits.INTEDG2 = 0; // Strobe too INTCONbits.INT0IE = 1; // Bank Select RB0 interrupt - Bank Select INTCON3bits.INT2IE = 1; ; // Clock RB2 interrupt - Strobe OpenTimer0( TIMER_INT_ON & T0_8BIT & T0_SOURCE_INT & T0_PS_1_256 ); // Frequency for writing to ADC/DAC cueTableCntr=0; cueTableFlag=0; fpsCntr=0; OpenI2C (MASTER, SLEW_ON); SSPADD = 0x18; // 0x18 for 400Khz // ( (Fosc/Bitrate)/4 ) - 1. 0x63 for 100khz (0x0D) PIE1bits.SSPIE = 1; // SSP interrupt enable } // *********************************** MAIN **************************************** void main (void) { unsigned int loopCnt = 0; unsigned int word; unsigned char chn,n, i; Init(); SSP_read(); for(wCntr=0;wCntr<100000;wCntr++) { ; } LED=0; while(1) { if(ParallelPortflag) // New Data arrived { ParallelPortflag=0; // Clear transfer flag. Buffer is safe to write to LED=!LED; } if(cueTableFlag) { switch (cueTableCntr) // stretch the 3 bytes over the whole frame { case 2: Motor_Faders(0); break; case 4: Motor_Faders(1); break; case 6: Motor_Faders(2); break; } if((cueTableCntr&1)==0) // even { } cueTableFlag=0; } } } // *********************************** Motor Fader Communication **************************************** void Motor_Faders(unsigned char byteSwitch) { unsigned char i,j,n,m; unsigned char OutByte; }
a65af88f405d58e9936a165e230bfec9fba3258c
305d8c76ec7d15e8e554c11c588c5f006d793de9
/gameboy/src/Cliente.h
dced1587ea0991855ab862794fa65422c8fbb6bf
[]
no_license
tomifrongi/tp-2020-1c-probasteReiniciando
8c186cbc9a254ffee5faaf82208ad3dd6e25a3ce
db2b78386b3d66614411b28a2ed38c3cb59f0f83
refs/heads/master
2022-11-29T21:03:12.617741
2020-08-08T02:24:04
2020-08-08T02:24:04
287,276,799
0
0
null
null
null
null
UTF-8
C
false
false
384
h
Cliente.h
#ifndef CLIENTE_H_ #define CLIENTE_H_ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket.h> #include <string.h> #include <arpa/inet.h> int connect_to_server(char* host, int port, void*(*callback)()); int create_socket(); #endif /* CLIENTE_H_ */
3db74ae93e9f5f85e3d4981346242be206b2fde9
805666a84218be543410ff5089588f1572dd20ec
/d/emei/treeup.c
32ed3db52335a52a00cd503adc7715706ae1711c
[]
no_license
mudchina/xkx2001
d47a9caca686ab7c89fe0b9140fbaf9d3601e1f5
4e8f8a13a72884d5dbe4b589542eb34e29e89d70
refs/heads/master
2021-01-10T06:50:29.517433
2016-02-20T14:09:12
2016-02-20T14:09:12
52,156,038
24
23
null
null
null
null
GB18030
C
false
false
453
c
treeup.c
//Cracked by Roath // treeup.c inherit ROOM; void create() { set("short", "树上"); set("long", @LONG 一股腥臭之气扑面而来。你抬头一看,顿时毛骨悚然,一条碗口粗细的巨 蟒倒悬在树干上,张开大口,正要向你扑来! LONG ); set("exits", ([ "down" : __DIR__"dao9"+(random(4)+6), ])); set("objects", ([ __DIR__"npc/jumang" : 1, ])); set("cost", 3); setup(); replace_program(ROOM); }
c4bd32b11b17689cbcf25936ba7df63fc517eb9d
6b40e9dccf2edc767c44df3acd9b626fcd586b4d
/NT/sdktools/remote/remoteds.c
bef8f682f255f023538ff76689898be8f1e09970
[]
no_license
jjzhang166/WinNT5_src_20201004
712894fcf94fb82c49e5cd09d719da00740e0436
b2db264153b80fbb91ef5fc9f57b387e223dbfc2
refs/heads/Win2K3
2023-08-12T01:31:59.670176
2021-10-14T15:14:37
2021-10-14T15:14:37
586,134,273
1
0
null
2023-01-07T03:47:45
2023-01-07T03:47:44
null
UTF-8
C
false
false
15,686
c
remoteds.c
/******************************************************************************\ * This is a part of the Microsoft Source Code Samples. * Copyright 1995 - 1997 Microsoft Corporation. * All rights reserved. * This source code is only intended as a supplement to * Microsoft Development Tools and/or WinHelp documentation. * See these sources for detailed information regarding the * Microsoft samples programs. \******************************************************************************/ // // remoteds.c, a "directory service" for the limited job of // finding remote.exe servers on the same domain/workgroup. // // Dave Hart written summer 1997. // // Copyright 1997 Microsoft Corp. // // // A handy way to use this program is under remote on a single // or a few machines: // // remote /s remoteds FindRemote // // Clients connect with remote /c machinename FindRemote // // Only remote.exe's running debuggers or with /V+ are visible // via remoteds, as with remote /q. // // Remote clients notify remoteds using mailslots, see srvad.c. // // #include <precomp.h> typedef char RECEIVEBUF[1024]; typedef struct tagSERVERENTRY { int nPID; // zero PID means unused slot union { FILETIME FileTime; LARGE_INTEGER liTime; }; char *pszMachine; char *pszPipe; char *pszChildCmd; } SERVERENTRY; #define TABLE_INITIAL_ALLOC 1 // 128 // beginning table size #define TABLE_ALLOC_DELTA 1 // 16 // grows by this many units HANDLE hTableHeap; SERVERENTRY *Table; int nTableSize; int nTableHiWater; // highest used slot so far CRITICAL_SECTION csTable; const char szPrompt[] = "remote server search> "; unsigned WINAPI InteractThread(void * UnusedParm); unsigned WINAPI CleanupThread(void * UnusedParm); VOID __fastcall UpdateTimeStamp(LPFILETIME lpFileTime); VOID __fastcall ReallocTable(int nNewTableSize); int __cdecl main( int argc, char **argv ) { char * pszMailslot = "\\\\.\\MAILSLOT\\REMOTE\\DEBUGGERS"; HANDLE hMailslot; BOOL b; HANDLE hThread; DWORD dwTID; char * pszMachine; int cchMachine; char * pszPID; int nPID; char * pszPipe; int cchPipe; char * pszChildCmd; int i; int nFirstAvailable; BOOL fStopping; BOOL fFound; int cb; char * pchStrings; char * pch; DWORD cbRead; DWORD iBuf; DWORD rgcbBuf[2]; RECEIVEBUF rgBuf[2]; RECEIVEBUF szBuf; char szRemoteCmd[512]; InitializeCriticalSection(&csTable); ReallocTable(TABLE_INITIAL_ALLOC); hMailslot = CreateMailslot( pszMailslot, 0, MAILSLOT_WAIT_FOREVER, NULL ); if (INVALID_HANDLE_VALUE == hMailslot) { DWORD dwErr = GetLastError(); if (ERROR_ALREADY_EXISTS == dwErr) { printf("Cannot receive on %s,\n" "is remoteds or rdsrelay already running on this machine?\n", pszMailslot); } else { printf("CreateMailslot(%s) failed error %d\n", pszMailslot, dwErr); } return 2; } hThread = (HANDLE) _beginthreadex( NULL, 0, InteractThread, NULL, 0, &dwTID ); if ( ! hThread) { printf("Can't start InteractThread %d\n", GetLastError()); return 3; } CloseHandle(hThread); hThread = (HANDLE) _beginthreadex( NULL, 0, CleanupThread, NULL, 0, &dwTID ); if ( ! hThread) { printf("Can't start CleanupThread %d\n", GetLastError()); return 3; } CloseHandle(hThread); // // loop reading and processing mailslot messsages // iBuf = 0; ZeroMemory(rgcbBuf, sizeof(rgcbBuf)); ZeroMemory(rgBuf, sizeof(rgBuf)); while(TRUE) { b = ReadFile( hMailslot, rgBuf[ iBuf ], sizeof(rgBuf[ iBuf ]) - 1, // so I can null terminate if needed &rgcbBuf[ iBuf ], NULL ); if ( ! b) { printf("ReadFile(hMailslot) failed error %d\n", GetLastError()); return 4; } // // It's the nature of mailslots and multiple transports // that we'll get the identical message several times in // quick succession. Don't waste time searching the table // for these duplicates. // if ( rgcbBuf[0] == rgcbBuf[1] && ! memcmp(rgBuf[0], rgBuf[1], rgcbBuf[0])) { continue; // duplicate } // // Make a working copy into szBuf/cbRead that we can // modify so the original buffer is available for // detecting received duplicates. // cbRead = rgcbBuf[ iBuf ]; CopyMemory(szBuf, rgBuf[ iBuf ], cbRead); // // Toggle buffers for the next read. // iBuf = !iBuf; if (szBuf[ cbRead - 1 ]) { fputs("Received string not null terminated.\n", stdout); szBuf[cbRead] = 0; } pszMachine = szBuf; pch = strchr(szBuf, '\t'); if (!pch) { fputs("Received string no 1st tab\n", stdout); continue; } *pch = '\0'; pszPID = ++pch; pch = strchr(pch, '\t'); if (!pch) { fputs("Received string no 2nd tab\n", stdout); continue; } *pch = '\0'; pszPipe = ++pch; pch = strchr(pch, '\t'); if (!pch) { fputs("Received string no 3nd tab\n", stdout); continue; } *pch = '\0'; pszChildCmd = ++pch; // // If it ends with ^B it's going away. // pch = strchr(pch, '\x2'); if (pch) { *pch = 0; fStopping = TRUE; } else { fStopping = FALSE; } nPID = strtol(pszPID, NULL, 10); _strlwr(pszMachine); _strlwr(pszPipe); if (fStopping) { // // display the ending remote's info // ZeroMemory(szRemoteCmd, sizeof(szRemoteCmd)); _snprintf(szRemoteCmd, sizeof(szRemoteCmd), "remote /c %s %s", pszMachine, pszPipe); printf("\r%-36s %-20s [stop]\n%s", szRemoteCmd, pszChildCmd, szPrompt); fflush(stdout); } EnterCriticalSection(&csTable); nFirstAvailable = -1; for (i = 0, fFound = FALSE; i <= nTableHiWater; i++) { if (-1 == nFirstAvailable && 0 == Table[i].nPID) { nFirstAvailable = i; } if (Table[i].nPID == nPID && ! strcmp(Table[i].pszMachine, pszMachine) && ! strcmp(Table[i].pszPipe, pszPipe)) { fFound = TRUE; break; } } if (fFound) { if (fStopping) { // // Remove it from the table // free(Table[i].pszMachine); ZeroMemory(&Table[i], sizeof(Table[i])); if (nTableHiWater == i) { nTableHiWater--; } } else { // starting // printf("Found at slot %d\n", i); // timestamp is updated below } } else if ( ! fStopping) { // // we have a new entry, display it // ZeroMemory(szRemoteCmd, sizeof(szRemoteCmd)); _snprintf(szRemoteCmd, sizeof(szRemoteCmd), "remote /c %s %s", pszMachine, pszPipe); printf("\r%-36s %-20s [start]\n%s", szRemoteCmd, pszChildCmd, szPrompt); fflush(stdout); // // Does it fit in the table or do we need to grow it? // if (-1 == nFirstAvailable) { if (++nTableHiWater >= nTableSize) { ReallocTable(nTableSize + TABLE_ALLOC_DELTA); } i = nTableHiWater; } else { i = nFirstAvailable; } // // Fill in a server entry in table, if we can // allocate memory for the strings. // cb = (cchMachine = strlen(pszMachine) + 1) + (cchPipe = strlen(pszPipe) + 1) + ( strlen(pszChildCmd) + 1); pchStrings = malloc(cb); if (pchStrings) { Table[i].nPID = nPID; UpdateTimeStamp(&Table[i].FileTime); Table[i].pszMachine = pchStrings; strcpy(Table[i].pszMachine, pszMachine); Table[i].pszPipe = Table[i].pszMachine + cchMachine; strcpy(Table[i].pszPipe, pszPipe); Table[i].pszChildCmd = Table[i].pszPipe + cchPipe; strcpy(Table[i].pszChildCmd, pszChildCmd); } } UpdateTimeStamp(&Table[i].FileTime); LeaveCriticalSection(&csTable); } // while (TRUE) return 0; // never executed } // // InteractThread lets the user query the list of remote servers. // unsigned WINAPI InteractThread(void * UnusedParm) { char szQuery[1024] = {0}; char szLowerQuery[1024] = {0}; char szRemoteCmd[400]; int i; BOOL fAll; while (TRUE) { fputs(szPrompt, stdout); fflush(stdout); if (!fgets(szQuery, sizeof(szQuery), stdin)) continue; _strlwr( strcpy(szLowerQuery, szQuery) ); if (!strlen(szLowerQuery) || !strcmp(szLowerQuery, "?") || !strcmp(szLowerQuery, "h") || !strcmp(szLowerQuery, "help")) { fputs("Enter a string to search for, a machine or pipe name or command.\n" "Enter * to list all remote servers.\n" "Exit with ^B.\n", stdout); continue; } if (2 == szLowerQuery[0]) { // ^B ExitProcess(0); } fAll = ! strcmp(szLowerQuery, "*"); EnterCriticalSection(&csTable); for (i = 0; i <= nTableHiWater; i++) { if (Table[i].nPID) { if (fAll || strstr(Table[i].pszMachine, szLowerQuery) || strstr(Table[i].pszPipe, szLowerQuery) || strstr(Table[i].pszChildCmd, szLowerQuery)) { ZeroMemory(szRemoteCmd, sizeof(szRemoteCmd)); _snprintf(szRemoteCmd, sizeof(szRemoteCmd), "remote /c %s %s", Table[i].pszMachine, Table[i].pszPipe); printf("%-40s %s\n", szRemoteCmd, Table[i].pszChildCmd); } } } LeaveCriticalSection(&csTable); } return 0; // never executed } #if _MSC_FULL_VER >= 13008827 #pragma warning(push) #pragma warning(disable:4715) // Not all control paths return (due to infinite loop) #endif // // CleanupThread scavenges for old entries and frees them. // remote /s sends a broadcast at least every 2 hours. // We get some of them. Age out entries after 12 hours. // unsigned WINAPI CleanupThread(void * UnusedParm) { LARGE_INTEGER liNow; LARGE_INTEGER liTimeout; int i; char szRemoteCmd[400]; liTimeout.QuadPart = (LONGLONG)10000000 * 60 * 60 * 12; // 12 hours while (TRUE) { Sleep(15 * 60 * 1000); // 10 minutes UpdateTimeStamp((LPFILETIME)&liNow); EnterCriticalSection(&csTable); for (i = nTableHiWater; i >= 0; i--) { if (Table[i].nPID) { if (liNow.QuadPart - Table[i].liTime.QuadPart > liTimeout.QuadPart) { // // display the ending remote's info // ZeroMemory(szRemoteCmd, sizeof(szRemoteCmd)); _snprintf(szRemoteCmd, sizeof(szRemoteCmd), "remote /c %s %s", Table[i].pszMachine, Table[i].pszPipe); printf("\r%-36s %-20s [aged out]\n%s", szRemoteCmd, Table[i].pszChildCmd, szPrompt); fflush(stdout); free(Table[i].pszMachine); ZeroMemory(&Table[i], sizeof(Table[i])); if (nTableHiWater == i) { nTableHiWater--; } } } } LeaveCriticalSection(&csTable); } return 0; // never executed } #if _MSC_FULL_VER >= 13008827 #pragma warning(pop) #endif VOID __fastcall UpdateTimeStamp(LPFILETIME lpFileTime) { SYSTEMTIME SystemTime; GetSystemTime(&SystemTime); SystemTimeToFileTime(&SystemTime, lpFileTime); } VOID __fastcall ReallocTable(int nNewTableSize) { SERVERENTRY *pTableSave = Table; EnterCriticalSection(&csTable); nTableSize = nNewTableSize; if ( ! hTableHeap) { hTableHeap = HeapCreate( HEAP_NO_SERIALIZE, (TABLE_INITIAL_ALLOC + 1) * sizeof(Table[0]), // size 50000 * sizeof(Table[0]) // max ); if (hTableHeap) Table = HeapAlloc( hTableHeap, HEAP_ZERO_MEMORY, nTableSize * sizeof(Table[0]) ); else Table = NULL; if (!Table) { fputs("\nremoteds: Out of memory allocating remote server table\n", stdout); exit(ERROR_NOT_ENOUGH_MEMORY); } } else { void *pv = HeapReAlloc( hTableHeap, HEAP_ZERO_MEMORY, Table, nTableSize * sizeof(Table[0]) ); if (!pv) { fputs("\nremoteds: Out of memory allocating remote server table\n", stdout); exit(ERROR_NOT_ENOUGH_MEMORY); } else { Table = pv; } } LeaveCriticalSection(&csTable); if (Table != pTableSave && pTableSave) { printf("\nremoteds: remote server table moved in HeapRealloc from %p to %p.\n", pTableSave, Table); fflush(stdout); } }
28081cbe9543fe195cca4b9355b3c6b037cf788a
03a480e6af5f64846cc07272cf91cdc0684b62b9
/main.c
e073ff3fab64ba69bbefe3ec6ecc2cd6fa2399ca
[]
no_license
danielchk/monty
a3361312da795664edf5cc8615977ad91710036f
7f8ed1dd9231bb767eb2761881b6fdc26e15280b
refs/heads/master
2022-07-07T12:56:11.256000
2020-05-15T00:45:40
2020-05-15T00:45:40
263,455,368
0
0
null
null
null
null
UTF-8
C
false
false
273
c
main.c
#include "monty.h" /** * main - readthe file and put it in stack_it * @argc: counter * @argv: files name * Return: 0 */ int main(int argc, char **argv) { if (argc != 2) { printf("USAGE: monty file\n"); exit(EXIT_FAILURE); } lkdlist(argv[1]); return (0); }
fc8ab817bef5cca954e7f1f1b7942c6dd852a248
155763749478d017294eb62dbe0c13a1ed222e10
/libwine/c_10006.c
07a43a418f0b89525f06e74a396d141cd90e2d90
[]
no_license
staalmannen/owmc
2ce04b346349384c7ea9295cf0ab6bf94688caee
7f1a750425893f880e544bf81e182d8aa10724c9
refs/heads/master
2020-06-04T02:52:06.635335
2014-09-07T18:59:34
2014-09-07T18:59:34
16,879,587
4
0
null
null
null
null
UTF-8
C
false
false
36,933
c
c_10006.c
/* code page 10006 (Mac Greek) */ /* generated from http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/GREEK.TXT */ /* DO NOT EDIT!! */ #include "wine/unicode.h" static const WCHAR cp2uni[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x00c4, 0x00b9, 0x00b2, 0x00c9, 0x00b3, 0x00d6, 0x00dc, 0x0385, 0x00e0, 0x00e2, 0x00e4, 0x0384, 0x00a8, 0x00e7, 0x00e9, 0x00e8, 0x00ea, 0x00eb, 0x00a3, 0x2122, 0x00ee, 0x00ef, 0x2022, 0x00bd, 0x2030, 0x00f4, 0x00f6, 0x00a6, 0x00ad, 0x00f9, 0x00fb, 0x00fc, 0x2020, 0x0393, 0x0394, 0x0398, 0x039b, 0x039e, 0x03a0, 0x00df, 0x00ae, 0x00a9, 0x03a3, 0x03aa, 0x00a7, 0x2260, 0x00b0, 0x0387, 0x0391, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x0392, 0x0395, 0x0396, 0x0397, 0x0399, 0x039a, 0x039c, 0x03a6, 0x03ab, 0x03a8, 0x03a9, 0x03ac, 0x039d, 0x00ac, 0x039f, 0x03a1, 0x2248, 0x03a4, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x03a5, 0x03a7, 0x0386, 0x0388, 0x0153, 0x2013, 0x2015, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0389, 0x038a, 0x038c, 0x038e, 0x03ad, 0x03ae, 0x03af, 0x03cc, 0x038f, 0x03cd, 0x03b1, 0x03b2, 0x03c8, 0x03b4, 0x03b5, 0x03c6, 0x03b3, 0x03b7, 0x03b9, 0x03be, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, 0x03c0, 0x03ce, 0x03c1, 0x03c3, 0x03c4, 0x03b8, 0x03c9, 0x03c2, 0x03c7, 0x03c5, 0x03b6, 0x03ca, 0x03cb, 0x0390, 0x03b0, 0x003f }; static const unsigned char uni2cp_low[4864] = { /* 0x0000 .. 0x00ff */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xca, 0x21, 0x63, 0x92, 0x3f, 0xb4, 0x9b, 0xac, 0x8c, 0xa9, 0x61, 0xc7, 0xc2, 0x9c, 0xa8, 0xd0, 0xae, 0xb1, 0x82, 0x84, 0x27, 0xed, 0x3f, 0x3f, 0x2c, 0x81, 0x6f, 0xc8, 0x3f, 0x97, 0x3f, 0x3f, 0x41, 0x41, 0x41, 0x41, 0x80, 0x41, 0x41, 0x43, 0x45, 0x83, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49, 0x44, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x85, 0x78, 0x4f, 0x55, 0x55, 0x55, 0x86, 0x59, 0x3f, 0xa7, 0x88, 0x61, 0x89, 0x61, 0x8a, 0x61, 0x61, 0x8d, 0x8f, 0x8e, 0x90, 0x91, 0x69, 0x69, 0x94, 0x95, 0x64, 0x6e, 0x6f, 0x6f, 0x99, 0x6f, 0x9a, 0xd6, 0x6f, 0x9d, 0x75, 0x9e, 0x9f, 0x79, 0x3f, 0x79, /* 0x0100 .. 0x01ff */ 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x43, 0x63, 0x43, 0x63, 0x43, 0x63, 0x43, 0x63, 0x44, 0x64, 0x44, 0x64, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x48, 0x68, 0x48, 0x68, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x49, 0x69, 0x3f, 0x3f, 0x4a, 0x6a, 0x4b, 0x6b, 0x3f, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x3f, 0x3f, 0x4c, 0x6c, 0x4e, 0x6e, 0x4e, 0x6e, 0x4e, 0x6e, 0x3f, 0x3f, 0x3f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0xcf, 0x52, 0x72, 0x52, 0x72, 0x52, 0x72, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x54, 0x74, 0x54, 0x74, 0x54, 0x74, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x57, 0x77, 0x59, 0x79, 0x59, 0x5a, 0x7a, 0x5a, 0x7a, 0x5a, 0x7a, 0x73, 0x62, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x44, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x45, 0x46, 0x66, 0x3f, 0x3f, 0x3f, 0x3f, 0x49, 0x3f, 0x3f, 0x6c, 0x3f, 0x3f, 0x3f, 0x3f, 0x4f, 0x4f, 0x6f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x74, 0x3f, 0x3f, 0x54, 0x55, 0x75, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7a, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7c, 0x3f, 0x3f, 0x21, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x41, 0x61, 0x49, 0x69, 0x4f, 0x6f, 0x55, 0x75, 0x86, 0x9f, 0x86, 0x9f, 0x86, 0x9f, 0x86, 0x9f, 0x3f, 0x80, 0x8a, 0x41, 0x61, 0x41, 0x61, 0x47, 0x67, 0x47, 0x67, 0x4b, 0x6b, 0x4f, 0x6f, 0x4f, 0x6f, 0x3f, 0x3f, 0x6a, 0x3f, 0x3f, 0x3f, 0x47, 0x67, 0x3f, 0x3f, 0x4e, 0x6e, 0x41, 0x61, 0x41, 0x61, 0x4f, 0x6f, /* 0x0200 .. 0x02ff */ 0x41, 0x61, 0x41, 0x61, 0x45, 0x65, 0x45, 0x65, 0x49, 0x69, 0x49, 0x69, 0x4f, 0x6f, 0x4f, 0x6f, 0x52, 0x72, 0x52, 0x72, 0x55, 0x75, 0x55, 0x75, 0x53, 0x73, 0x54, 0x74, 0x3f, 0x3f, 0x48, 0x68, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x41, 0x61, 0x45, 0x65, 0x85, 0x9a, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x59, 0x79, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x67, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x68, 0x3f, 0x6a, 0x72, 0x3f, 0x3f, 0x3f, 0x77, 0x79, 0x27, 0x22, 0xd4, 0xd5, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x5e, 0x3f, 0x5e, 0x76, 0x27, 0xd0, 0x27, 0x60, 0x3f, 0x5f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xae, 0x3f, 0x7e, 0x22, 0x3f, 0x3f, 0x3f, 0x6c, 0x73, 0x78, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x0300 .. 0x03ff */ 0x60, 0x27, 0x5e, 0x7e, 0xd0, 0xd0, 0x3f, 0x3f, 0x8c, 0x3f, 0xae, 0x22, 0x76, 0x3f, 0x22, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x5f, 0x5f, 0x5f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x60, 0x27, 0x3f, 0x3f, 0x8c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x27, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x8b, 0x87, 0xcd, 0xaf, 0xce, 0xd7, 0xd8, 0x3f, 0xd9, 0x3f, 0xda, 0xdf, 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, 0xb7, 0xb8, 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, 0xa5, 0xc3, 0xa6, 0xc4, 0x3f, 0xaa, 0xc6, 0xcb, 0xbc, 0xcc, 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, 0xdd, 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, 0xe8, 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, 0xef, 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, 0xf8, 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, 0x3f, 0xe2, 0xf5, 0xcb, 0xcb, 0xcb, 0xe6, 0xf0, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xeb, 0xf2, 0xf7, 0x3f, 0xa3, 0xe5, 0x3f, 0x3f, 0x3f, 0xaa, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x1d00 .. 0x1dff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x41, 0x41, 0x42, 0x3f, 0x44, 0x45, 0x3f, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x3f, 0x4f, 0x3f, 0x50, 0x52, 0x54, 0x55, 0x57, 0x61, 0x3f, 0x3f, 0x3f, 0x62, 0x64, 0x65, 0x3f, 0x3f, 0x3f, 0x67, 0x3f, 0x6b, 0x6d, 0x3f, 0x6f, 0x3f, 0x3f, 0x3f, 0x70, 0x74, 0x75, 0x3f, 0x3f, 0x76, 0x3f, 0xe2, 0xe7, 0xe4, 0xe6, 0xf8, 0x69, 0x72, 0x75, 0x76, 0xe2, 0xe7, 0xf2, 0xe6, 0xf8, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x63, 0x3f, 0x64, 0x3f, 0x66, 0x3f, 0x67, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x74, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7a, 0x3f, 0x3f, 0x3f, 0xf5, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x1e00 .. 0x1eff */ 0x41, 0x61, 0x42, 0x62, 0x42, 0x62, 0x42, 0x62, 0x43, 0x8d, 0x44, 0x64, 0x44, 0x64, 0x44, 0x64, 0x44, 0x64, 0x44, 0x64, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x46, 0x66, 0x47, 0x67, 0x48, 0x68, 0x48, 0x68, 0x48, 0x68, 0x48, 0x68, 0x48, 0x68, 0x49, 0x69, 0x49, 0x95, 0x4b, 0x6b, 0x4b, 0x6b, 0x4b, 0x6b, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x4c, 0x6c, 0x4d, 0x6d, 0x4d, 0x6d, 0x4d, 0x6d, 0x4e, 0x6e, 0x4e, 0x6e, 0x4e, 0x6e, 0x4e, 0x6e, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x50, 0x70, 0x50, 0x70, 0x52, 0x72, 0x52, 0x72, 0x52, 0x72, 0x52, 0x72, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x54, 0x74, 0x54, 0x74, 0x54, 0x74, 0x54, 0x74, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x56, 0x76, 0x56, 0x76, 0x57, 0x77, 0x57, 0x77, 0x57, 0x77, 0x57, 0x77, 0x57, 0x77, 0x58, 0x78, 0x58, 0x78, 0x59, 0x79, 0x5a, 0x7a, 0x5a, 0x7a, 0x5a, 0x7a, 0x68, 0x74, 0x77, 0x79, 0x3f, 0x73, 0x3f, 0x3f, 0x3f, 0x3f, 0x41, 0x61, 0x41, 0x61, 0x41, 0x89, 0x41, 0x89, 0x41, 0x89, 0x41, 0x89, 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x45, 0x65, 0x45, 0x65, 0x45, 0x65, 0x45, 0x90, 0x45, 0x90, 0x45, 0x90, 0x45, 0x90, 0x45, 0x65, 0x49, 0x69, 0x49, 0x69, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x99, 0x4f, 0x99, 0x4f, 0x99, 0x4f, 0x99, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x4f, 0x6f, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x55, 0x75, 0x59, 0x79, 0x59, 0x79, 0x59, 0x79, 0x59, 0x79, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x1f00 .. 0x1fff */ 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0xe5, 0x3f, 0x3f, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0x3f, 0x3f, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xe9, 0xe9, 0xe9, 0xe9, 0xe9, 0xe9, 0xe9, 0xe9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0x3f, 0x3f, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x3f, 0x3f, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0x3f, 0xcb, 0x3f, 0xcb, 0x3f, 0xcb, 0x3f, 0xcb, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xe1, 0xc0, 0xe5, 0xdb, 0xe8, 0xdc, 0xe9, 0xdd, 0xef, 0xde, 0xf9, 0xe0, 0xf6, 0xf1, 0x3f, 0x3f, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xe1, 0xe1, 0xe1, 0xe1, 0xc0, 0x3f, 0xe1, 0xe1, 0xb0, 0xb0, 0xb0, 0xcd, 0xb0, 0x3f, 0xe9, 0x3f, 0x3f, 0x8c, 0xe8, 0xe8, 0xdc, 0x3f, 0xe8, 0xe8, 0xb6, 0xce, 0xb8, 0xd7, 0xb8, 0x3f, 0x3f, 0x3f, 0xe9, 0xe9, 0xfb, 0xfd, 0x3f, 0x3f, 0xe9, 0xfb, 0xb9, 0xb9, 0xb9, 0xd8, 0x3f, 0x3f, 0x3f, 0x3f, 0xf9, 0xf9, 0xfc, 0xfe, 0xf2, 0xf2, 0xf9, 0xfc, 0xcb, 0xcb, 0xcb, 0xda, 0xc4, 0x8c, 0x87, 0x60, 0x3f, 0x3f, 0xf6, 0xf6, 0xf1, 0x3f, 0xf6, 0xf6, 0xc3, 0xd9, 0xbf, 0xdf, 0xbf, 0x27, 0x3f, 0x3f, /* 0x2000 .. 0x20ff */ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2d, 0x2d, 0x3f, 0xd0, 0xd0, 0xd1, 0x3f, 0x5f, 0xd4, 0xd5, 0x2c, 0xd4, 0xd2, 0xd3, 0x2c, 0x3f, 0xa0, 0x3f, 0x96, 0x3f, 0x2e, 0x3f, 0xc9, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x20, 0x98, 0x3f, 0x27, 0x22, 0x3f, 0xd4, 0x3f, 0x3f, 0x3f, 0x3c, 0x3e, 0x3f, 0x21, 0x3f, 0xd0, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xae, 0x69, 0x3f, 0x3f, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2b, 0x2d, 0x3d, 0x28, 0x29, 0x6e, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2b, 0x2d, 0x3d, 0x28, 0x29, 0x3f, 0x61, 0x65, 0x6f, 0x78, 0x3f, 0x68, 0x6b, 0x6c, 0x6d, 0x6e, 0x70, 0x73, 0x74, 0x3f, 0x3f, 0x3f, 0x3f, 0x63, 0x3f, 0x3f, 0x92, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2100 .. 0x21ff */ 0x3f, 0x3f, 0x43, 0x3f, 0x3f, 0x3f, 0x3f, 0x45, 0x3f, 0x3f, 0x67, 0x48, 0x48, 0x48, 0x68, 0x68, 0x49, 0x49, 0x4c, 0x6c, 0x3f, 0x4e, 0x3f, 0x3f, 0x50, 0x50, 0x51, 0x52, 0x52, 0x52, 0x3f, 0x3f, 0x3f, 0x3f, 0x93, 0x3f, 0x5a, 0x3f, 0xbf, 0x3f, 0x5a, 0x3f, 0x4b, 0x41, 0x42, 0x43, 0x65, 0x65, 0x45, 0x46, 0x3f, 0x4d, 0x6f, 0x3f, 0x3f, 0x3f, 0x3f, 0x69, 0x3f, 0x3f, 0xf0, 0xe7, 0xa1, 0xa6, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x44, 0x64, 0x65, 0x69, 0x6a, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x49, 0x3f, 0x3f, 0x3f, 0x56, 0x3f, 0x3f, 0x3f, 0x3f, 0x58, 0x3f, 0x3f, 0x4c, 0x43, 0x44, 0x4d, 0x69, 0x3f, 0x3f, 0x3f, 0x76, 0x3f, 0x3f, 0x3f, 0x3f, 0x78, 0x3f, 0x3f, 0x6c, 0x63, 0x64, 0x6d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3c, 0x5e, 0x3e, 0x76, 0x2d, 0x7c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3c, 0x3e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2200 .. 0x22ff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x4f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2d, 0xb1, 0x3f, 0x2f, 0x5c, 0x2a, 0xae, 0x96, 0x56, 0x3f, 0x3f, 0x3f, 0x3f, 0x4c, 0x3f, 0x3f, 0x3f, 0x7c, 0x7c, 0x3f, 0x3f, 0x3f, 0x3f, 0x6e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3a, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7e, 0x3f, 0x3f, 0x3f, 0x3f, 0x7e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xc5, 0xc5, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xad, 0x3d, 0x3d, 0x3d, 0xb2, 0xb3, 0x3f, 0x3f, 0x3f, 0x3f, 0xc7, 0xc8, 0x3f, 0x3f, 0x3c, 0x3e, 0xb2, 0xb3, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2300 .. 0x23ff */ 0x3f, 0x3f, 0x3f, 0x5e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3c, 0x3e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2400 .. 0x24ff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x30, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2500 .. 0x25ff */ 0x2d, 0x2d, 0x7c, 0x7c, 0x2d, 0x2d, 0x9b, 0x9b, 0x2d, 0x2d, 0x9b, 0x9b, 0x2b, 0x2b, 0x2b, 0x2b, 0xc2, 0xc2, 0xc2, 0xc2, 0x4c, 0x4c, 0x4c, 0x4c, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2d, 0x2d, 0x9b, 0x9b, 0x3d, 0x7c, 0x2b, 0x2b, 0x2b, 0xc2, 0xc2, 0xc2, 0x4c, 0x4c, 0x4c, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x54, 0x54, 0x54, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3f, 0x3f, 0x3f, 0x3f, 0x2f, 0x5c, 0x58, 0x2d, 0x7c, 0x2d, 0x7c, 0x2d, 0x7c, 0x2d, 0x7c, 0x2d, 0x7c, 0x2d, 0x7c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x4f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x4f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x2c00 .. 0x2cff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x6a, 0x56, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0x3000 .. 0x30ff */ 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3c, 0x3e, 0xc7, 0xc8, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x5b, 0x5d, 0x3f, 0xd2, 0xd3, 0x2c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0xfb00 .. 0xfbff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x2b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0xfe00 .. 0xfeff */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xd0, 0xd0, 0xd0, 0xd0, 0x5f, 0x5f, 0x5f, 0x2c, 0x3f, 0x2e, 0x3f, 0x3b, 0x3a, 0x3f, 0x21, 0xd0, 0x28, 0x29, 0x7b, 0x7d, 0x3f, 0x3f, 0x23, 0x26, 0x2a, 0x2b, 0x2d, 0x3c, 0x3e, 0x3d, 0x3f, 0x5c, 0x24, 0x25, 0x40, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* 0xff00 .. 0xffff */ 0x3f, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x63, 0x92, 0xc2, 0xd0, 0x9b, 0xb4, 0x3f, 0x3f, 0x7c, 0x3c, 0x5e, 0x3e, 0x76, 0x3f, 0x4f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, /* defaults */ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }; static const unsigned short uni2cp_high[256] = { 0x0000, 0x0100, 0x0200, 0x0300, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0a00, 0x0b00, 0x0c00, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0d00, 0x1200, 0x1200, 0x1200, 0x0e00, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0f00, 0x1200, 0x1200, 0x1000, 0x1100 }; const struct sbcs_table cptable_10006 = { { 10006, 1, 0x003f, 0x003f, "Mac Greek" }, cp2uni, cp2uni, uni2cp_low, uni2cp_high };
6a3a6c7059f78a9ae0bc7117442218c6e92d38b4
cd6afe5c7962f4d5ac60ed4531f92bfbbd04ca4a
/ex_6_0_fibinacci/main.c
8cb9a6be4b037df4daa7679297113221b6614fee
[]
no_license
anders2nasman/C-source
286b067e36f0f155002063007b2fd2c7c3646888
e718e561a35a27f12c347b4f8665a486fb4e903b
refs/heads/master
2021-01-11T05:21:25.234666
2016-12-08T15:44:53
2016-12-08T15:44:53
71,907,131
0
0
null
null
null
null
UTF-8
C
false
false
4,694
c
main.c
#include <stdio.h> #include <stdlib.h> const unsigned long long int fib_c[] = { 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657, 46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465, 14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733, 1134903170,1836311903,2971215073,512559680,3483774753,3996334433,3185141890,2886509027, 1776683621,368225352,2144908973,2513134325,363076002,2876210327,3239286329,1820529360, 764848393,2585377753,3350226146,1640636603,695895453,2336532056,3032427509,1073992269, 4106419778,885444751,696897233,1582341984,2279239217,3861581201,1845853122,1412467027, 3258320149,375819880,3634140029,4009959909,3349132642,3064125255,2118290601,887448560, 3005739161,3893187721,2603959586, 2202180011,511172301,2713352312,3224524613,1642909629,572466946,2215376575,2787843521 }; unsigned long long int fib(unsigned long int x) { int i=0; unsigned long long int n[2]= {1,1}, sum=1; for (i=2; i<=x; i++) { sum=n[0]+n[1]; n[0]=n[1]; n[1]=sum; } return( sum ); } double fib_d(unsigned int x) { int i=0; double n[2]= {1,1}, sum=1; for (i=2; i<=x; i++) { sum=n[0]+n[1]; n[0]=n[1]; n[1]=sum; } return( sum / (double) n[0] ); } unsigned long long int fib_r(unsigned int n) { if ( n <= 1 ) { return(1); } else if ( n < sizeof(fib_c) ) { return( fib_c[n] ); } else { return fib_r(n-2)+fib_r(n-1); } } unsigned long long int fib_y(unsigned int n) { static unsigned long long fib_c[4096]={0}; if ( n <= 1 ) { return(1); } else if ( n < sizeof(fib_c) && fib_c[n]!=0 ) { return( fib_c[n] ); } else if ( n < sizeof(fib_c) ) { fib_c[n] = fib_r(n-2)+fib_r(n-1); return( fib_c[n] ); } else { return( fib_r(n-2)+fib_r(n-1) ); } } int main() { int i=0; printf("Fibonacci!\n"); for (i=0; i<1000; i++) { printf("fib(%d) = %llu %llu %0.12f \n",i,fib(i),fib_r(i),fib_d(i)); } return 0; } /* fib(0) = 1 1 fib(1) = 1 1 fib(2) = 2 2 fib(3) = 3 3 fib(4) = 5 5 fib(5) = 8 8 fib(6) = 13 13 fib(7) = 21 21 fib(8) = 34 34 fib(9) = 55 55 fib(10) = 89 89 fib(11) = 144 144 fib(12) = 233 233 fib(13) = 377 377 fib(14) = 610 610 fib(15) = 987 987 fib(16) = 1597 1597 fib(17) = 2584 2584 fib(18) = 4181 4181 fib(19) = 6765 6765 fib(20) = 10946 10946 fib(21) = 17711 17711 fib(22) = 28657 28657 fib(23) = 46368 46368 fib(24) = 75025 75025 fib(25) = 121393 121393 fib(26) = 196418 196418 fib(27) = 317811 317811 fib(28) = 514229 514229 fib(29) = 832040 832040 fib(30) = 1346269 1346269 fib(31) = 2178309 2178309 fib(32) = 3524578 3524578 fib(33) = 5702887 5702887 fib(34) = 9227465 9227465 fib(35) = 14930352 14930352 fib(36) = 24157817 24157817 fib(37) = 39088169 39088169 fib(38) = 63245986 63245986 fib(39) = 102334155 102334155 fib(40) = 165580141 165580141 fib(41) = 267914296 267914296 fib(42) = 433494437 433494437 fib(43) = 701408733 701408733 fib(44) = 1134903170 1134903170 fib(45) = 1836311903 1836311903 fib(46) = 2971215073 2971215073 fib(47) = 512559680 512559680 fib(48) = 3483774753 3483774753 fib(49) = 3996334433 3996334433 fib(50) = 3185141890 3185141890 fib(51) = 2886509027 2886509027 fib(52) = 1776683621 1776683621 fib(53) = 368225352 368225352 fib(54) = 2144908973 2144908973 fib(55) = 2513134325 2513134325 fib(56) = 363076002 363076002 fib(57) = 2876210327 2876210327 fib(58) = 3239286329 3239286329 fib(59) = 1820529360 1820529360 fib(60) = 764848393 764848393 fib(61) = 2585377753 2585377753 fib(62) = 3350226146 3350226146 fib(63) = 1640636603 1640636603 fib(64) = 695895453 695895453 fib(65) = 2336532056 2336532056 fib(66) = 3032427509 3032427509 fib(67) = 1073992269 1073992269 fib(68) = 4106419778 4106419778 fib(69) = 885444751 885444751 fib(70) = 696897233 696897233 fib(71) = 1582341984 1582341984 fib(72) = 2279239217 2279239217 fib(73) = 3861581201 3861581201 fib(74) = 1845853122 1845853122 fib(75) = 1412467027 1412467027 fib(76) = 3258320149 3258320149 fib(77) = 375819880 375819880 fib(78) = 3634140029 3634140029 fib(79) = 4009959909 4009959909 fib(80) = 3349132642 3349132642 fib(81) = 3064125255 3064125255 fib(82) = 2118290601 2118290601 fib(83) = 887448560 887448560 fib(84) = 3005739161 3005739161 fib(85) = 3893187721 3893187721 fib(86) = 2603959586 2603959586 fib(87) = 2202180011 2202180011 fib(88) = 511172301 511172301 fib(89) = 2713352312 2713352312 fib(90) = 3224524613 3224524613 fib(91) = 1642909629 1642909629 fib(92) = 572466946 572466946 fib(93) = 2215376575 2215376575 fib(94) = 2787843521 2787843521 */
a9a733530dbf8db3801c82e534ca285f34cad452
c723dfc41c61d54dbfd1bd44f0a0d332f55ea7b1
/src/rpg/combat/gauge.c
4abc2fdcc47a6f9917654cecd5eea31390b309a3
[]
no_license
jimmyagulla/RPG
43cbd70f152ab8bc1027449b28569370034497ae
8657feeb91bca5b4a18ca3c2096bba1ee67f367a
refs/heads/master
2023-04-19T19:13:14.987904
2021-05-11T17:03:08
2021-05-11T17:03:08
366,455,922
1
0
null
null
null
null
UTF-8
C
false
false
1,544
c
gauge.c
/* ** EPITECH PROJECT, 2020 ** my_rpg ** File description: ** gauge.c */ #include <rpg.h> #include <struct.h> #include "combat.h" void create_gauge(gauge_t *gauge, int value, sfVector2f pos) { sfVector2u dim; gauge->pos = pos; gauge->back_t = create_texture("assets/combat/back_hp.png", NULL); gauge->back_s = create_sprite(); gauge->t = create_texture("assets/combat/front_hp.png", NULL); gauge->s = create_sprite(); gauge->value = value; sfSprite_setPosition(gauge->back_s, gauge->pos); sfSprite_setTexture(gauge->back_s, gauge->back_t, sfTrue); gauge->pos.x += 4; gauge->pos.y += 4; sfSprite_setPosition(gauge->s, gauge->pos); sfSprite_setTexture(gauge->s, gauge->t, sfTrue); dim = sfTexture_getSize(gauge->t); gauge->rect = (sfIntRect){0, 0, dim.x, dim.y}; sfSprite_setTextureRect(gauge->s, gauge->rect); } void update_gauge_hp(gauge_t *gauge, enemy_t *enemy) { sfVector2u dim = sfTexture_getSize(gauge->t); int hp_lost = enemy->p->stat.max_hp - enemy->p->stat.hp; sfVector2f new_pos = gauge->pos; gauge->value = enemy->p->stat.hp; gauge->rect.left = dim.x * hp_lost / enemy->p->stat.max_hp; new_pos.x += gauge->rect.left; gauge->rect.width = dim.x - gauge->rect.left; sfSprite_setTextureRect(gauge->s, gauge->rect); sfSprite_setPosition(gauge->s, new_pos); } void draw_gauge(sfRenderWindow *window, gauge_t *gauge) { sfRenderWindow_drawSprite(window, gauge->back_s, NULL); sfRenderWindow_drawSprite(window, gauge->s, NULL); }
97d042f55a9df143d19265ec520c2015a15e817c
03dc0a095b8d365b8e2e1f078c55b9ada5a37442
/subversion_techniques/mas_remapping_and_pte_subversions/linux/user_space_tool/mal-proc.c
a22fddc704766359d65e1944e323f09c114bccca
[]
no_license
pudii/DFRWS-USA-2020
19d53f348e39804785f7e35554bc05a0f63a6a57
b755e5adf7d7e12f78c3cfd3e1ac1e191fecbaf8
refs/heads/master
2023-03-01T13:28:32.280779
2020-08-05T13:00:52
2020-08-05T13:00:52
null
0
0
null
null
null
null
UTF-8
C
false
false
172
c
mal-proc.c
#include <stdio.h> void malicious_print() { printf("The malicious action .....\n"); } void malicious_print2() { printf("The second malicious action.....\n"); }
10680977758addc89fab33a2895e81ffeeaec48e
87b88cd804f74732c09cb74a102f9919f499929e
/include/log.h
5b75ca67c8f4907562cf0709edb063bf46dec930
[]
no_license
yipstar/zumo
964d163e2b3b97865ede62e699f2b4d2b75ca9d6
d93d1e32bd02ccdb4285369687f5342463bfdf85
refs/heads/master
2021-10-25T19:55:12.386135
2019-04-06T17:27:55
2019-04-06T17:27:55
173,516,001
0
0
null
null
null
null
UTF-8
C
false
false
330
h
log.h
// // Created by yipstar on 2019-03-02. // #ifndef ZUMOSM_LOG_H #define ZUMOSM_LOG_H #ifdef __cplusplus extern "C" { #endif #ifdef RC_DEBUG #define RC_PRINT(x) Serial.print(x) #define RC_PRINTLN(x) Serial.println(x) #else #define RC_PRINT(x) #define RC_PRINTLN(x) #endif #ifdef __cplusplus } #endif #endif //ZUMOSM_APP_H
9ad330c97f611b27a511996661fe040089763655
3b4526683fa34820c239f61fa2689646220edddb
/gsl_test/rangauss.c
d407a9f36eb99e7ab9cc4e848b92f3f8abce1c2e
[]
no_license
quadpixels/resilience_gsl
8584990588f738e79960b1bc88724f4086a70e40
5cd0eabc5fd9d1766af32efc9abf7e50a6672295
refs/heads/master
2021-01-23T13:49:43.749583
2012-09-16T02:27:06
2012-09-16T02:27:06
null
0
0
null
null
null
null
UTF-8
C
false
false
1,526
c
rangauss.c
#include <stdio.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> #include <gsl/gsl_vector.h> #define NUM 100000 int main() { const gsl_rng_type* T; gsl_rng* r; gsl_vector* v; v = gsl_vector_alloc(NUM); gsl_rng_env_setup(); T = gsl_rng_mt19937; r = gsl_rng_alloc(T); int i; for(i=0; i<NUM; i++) { // double tmp = gsl_rng_uniform(r); double tmp = gsl_ran_gaussian(r, 2); gsl_vector_set(v, i, tmp); } FILE* f = fopen("./vecV", "w"); gsl_vector_fprintf(f, v, "%f"); fclose(f); printf("Done.\n"); gsl_rng_free(r); } void Print_Matrix(CBLAS_TRANSPOSE_t Trans, const gsl_matrix* M, const char* info) { int i,j; printf("Print_Matrix"); if(Trans==CblasNoTrans) { printf(">> Matrix [%s] (%d x %d)\n", info, (int)M->size1, (int)M->size2); for(i=0; i<M->size1; i++) { for(j=0; j<M->size2; j++) { printf("%g ", gsl_matrix_get(M, i, j)); } printf("\n"); } } else { printf(">> Matrix [%s] (%d x %d)\n", info, (int)M->size2, (int)M->size1); for(j=0; j<M->size2; j++) { for(i=0; i<M->size1; i++) { printf("%g ", gsl_matrix_get(M, i, j)); } printf("\n"); } } } void Print_Vector(const gsl_vector* V, const char* info) { printf(">> Vector [%s] (%lu x 1)\n", info, V->size); int i; for(i=0; i<V->size; i++) printf("%g ", gsl_vector_get(V,i)); printf("\n"); return; }
e2dd938ce62d5e13d4b7e4c59ba1f6d5f8462b9c
247cc3bd1e63ef7e14fb759b0cda63d50a4c6b8f
/assignment5/sfrob_works.c
b5b1c0afd0de347d301228ac76256acc8bf7b794
[]
no_license
gurbthebruin/CS-35L
e03233ca9d9c4cfc19de3ed7f8f4b98fda55229f
e2b78f224b14d6e2db4772d66b481c9b0893a4f5
refs/heads/master
2022-12-15T18:12:29.436702
2020-09-09T06:45:41
2020-09-09T06:45:41
288,018,743
0
0
null
null
null
null
UTF-8
C
false
false
2,765
c
sfrob_works.c
#include <stdlib.h> #include <stdio.h> #include <string.h> int frobcmp(char const *a, char const *b); int frobcmp(char const *a, char const *b){ size_t i = 0; int len_a, len_b; int len_a2, len_b2; for(len_a2=0; a[len_a2] != ' '; len_a2++){} for(len_b2=0; b[len_b2] != ' '; len_b2++){} for(; a[i] != ' ' && b[i] != ' '; i++){ if((a[i] ^ 42) < (b[i] ^ 42)){ return -1; } if((a[i] ^ 42) > (b[i] ^ 42)){ return 1; } } if(len_a2 < len_b2) return -1; else if(len_a2 > len_b2) return 1; return 0; } int compare(const void *a, const void *b) { return frobcmp(*(char**)(a), *(char**)(b)); } char ** extract(unsigned int *count, size_t *size) { char ** cast = (char **) malloc(sizeof(char*)); char * word = (char *) malloc(sizeof(char)); size_t cast_i=0; size_t word_i=0; *count = 0; *size = 0; if(cast == NULL || word == NULL){ fprintf(stderr, "Error: Malloc\n"); exit(1); } while(1){ int x = getchar(); if(ferror(stdin) != 0) { fprintf(stderr, "Input failed with error code %d\n", ferror(stdin)); exit(1); } if(feof(stdin)) break; word = (char *) realloc(word, (cast_i + 1) * sizeof(char)); if(word == NULL){ fprintf(stderr, "Error: Malloc\n"); exit(1); } word[word_i] = x; if(x == ' ') { *size = (word_i + 1) > *size ? (word_i + 1) : *size; cast = (char **) realloc(cast, (cast_i + 1) * sizeof(char *)); if (cast == NULL) { fprintf(stderr, "Error: Malloc\n"); exit(1); } cast[cast_i] = word; cast_i++; word_i = 0; word = (char *) malloc(sizeof(char)); } else word_i++; } if(word_i > 0) { *size = (word_i + 1) > *size ? (word_i + 1) : *size; word = (char *) realloc(word, (word_i + 1) * sizeof(char)); cast = (char **) realloc(cast, (cast_i + 1) * sizeof(char*)); if(word == NULL || cast == NULL) { fprintf(stderr, "Error: Mallocn"); exit(1); } word[word_i] = ' '; cast[cast_i] = word; cast_i++; } *count = cast_i; if(*count == 0) free(word); return cast; } int main(){ unsigned int * count = malloc(sizeof(unsigned int)); size_t * size = malloc(sizeof(size_t)); if(count == NULL || size == NULL) { fprintf(stderr, "Error: Malloc\n"); exit(1); } char ** buf = extract(count, size); qsort(buf, *count, sizeof(char *), compare); for(size_t word_i = 0; word_i < *count; word_i++) { for(size_t char_index = 0; buf[word_i][char_index] != ' '; char_index++) if(fprintf(stdout, "%c", buf[word_i][char_index]) < 0) { fprintf(stderr, "Error: Output Failure\n"); exit(1); } if(fprintf(stdout, " ") < 0) { fprintf(stderr, "Error: Output Failure\n"); exit(1); } free(buf[word_i]); } free(count); free(size); free(buf); return 0; }
dbd151ddc59e987c89a11385c4a8420c1bcb8be1
b2d48aac47dc3a3050f9cb562808f0e6f19a36e4
/prasad/messagequeue/msgquestructure1.c
53f0591c7ab4b4557a1392ba2c73b435c2758739
[]
no_license
bhagavansprasad/students
7f7df2f4c2350025d58406794a7d94d9c8a9d7be
2822fb81cfb6714d48dea1e4957d6011ffa6198b
refs/heads/master
2023-08-04T04:44:11.346963
2023-07-24T06:09:00
2023-07-24T06:09:00
193,177,404
0
0
null
2022-11-30T23:33:00
2019-06-22T01:21:59
C
UTF-8
C
false
false
1,266
c
msgquestructure1.c
#include"stdio.h" #include"stdlib.h" #include"string.h" int i; struct node { char *name; struct node *next; }; struct node *h=NULL,*new,*temp,*prev; add_node(char *str) { int len; new=(struct node *)malloc(sizeof(struct node)); new->name=(char *)malloc(sizeof(len=strlen(str))); strcpy((new->name),str); new->next=NULL; if(h==NULL) { h=new; return 0; } for(temp=h;temp->next!=NULL;temp=temp->next); temp->next=new; return 0; } delete_node(char *str) { if(h==NULL) { printf("There are no messages in mesg queue\n"); return 0; } for(temp=prev=h;temp!=NULL;prev=temp,temp=temp->next) { i=strcmp((temp->name),str); if(i==0) { if(temp==h) { h=temp->next; free(temp->name); free(temp); return 0; } prev->next=temp->next; free(temp->name); free(temp); return 0; } } } display() { for(temp=h;temp!=NULL;temp=temp->next) printf("--->%s \n",temp->name); } main() { char str1[]="prasad"; char str2[]="manikanta"; char str3[]="harsha"; char str4[]="pavan"; char str5[]="manju"; char str6[]="vamsi"; add_node(str1); add_node(str2); add_node(str3); add_node(str4); add_node(str5); add_node(str6); display(); printf("\n"); delete_node(str1); delete_node(str4); delete_node(str6); display(); }
2c43a98ffd34a49ef5c342c554f7b50fcda4fdd1
590e8a440bbe4aabccaf67399151eed052330181
/code/src/PROC.c
f7eb63880631671ba01f172d61febd3fa0314e1e
[]
no_license
ausef-collab/ece_200_project_2_base
3cf0b0622cfe84527f6e3e96ece9ba9e72b67d8e
96841c5b97db144c3db40f02c86b47e644ad4f6e
refs/heads/master
2021-05-24T15:54:36.955004
2020-04-19T02:08:19
2020-04-19T02:08:19
253,643,329
0
0
null
2020-04-14T23:40:26
2020-04-06T23:58:41
C
UTF-8
C
false
false
20,150
c
PROC.c
#include <stdio.h> /* fprintf(), printf() * #include <stdlib.h> /* atoi() */ #include <stdint.h> /* uint32_t */ #include "RegFile.h" #include "Syscall.h" #include "utils/heap.h" #include "elf_reader/elf_reader.h" int main(int argc, char * argv[]) { //hi there this is a comment //MAKE A CHANGE /* * This variable will store the maximum * number of instructions to run before * forcibly terminating the program. It * is set via a command line argument. */ uint32_t MaxInstructions; /* * This variable will store the address * of the next instruction to be fetched * from the instruction memory. */ uint32_t ProgramCounter; /* * This variable will store the instruction * once it is fetched from instruction memory. */ uint32_t CurrentInstruction; //IF THE USER HAS NOT SPECIFIED ENOUGH COMMAND LINE ARUGMENTS if(argc < 3){ //PRINT ERROR AND TERMINATE fprintf(stderr, "ERROR: Input argument missing!\n"); fprintf(stderr, "Expected: file-name, max-instructions\n"); return -1; } //CONVERT MAX INSTRUCTIONS FROM STRING TO INTEGER MaxInstructions = atoi(argv[2]); //Open file pointers & initialize Heap & Regsiters initHeap(); initFDT(); initRegFile(0); //LOAD ELF FILE INTO MEMORY AND STORE EXIT STATUS int status = LoadOSMemory(argv[1]); //IF LOADING FILE RETURNED NEGATIVE EXIT STATUS if(status < 0){ //PRINT ERROR AND TERMINATE fprintf(stderr, "ERROR: Unable to open file at %s!\n", argv[1]); return status; } printf("\n ----- BOOT Sequence ----- \n"); printf("Initializing sp=0x%08x; gp=0x%08x; start=0x%08x\n", exec.GSP, exec.GP, exec.GPC_START); RegFile[28] = exec.GP; RegFile[29] = exec.GSP; RegFile[31] = exec.GPC_START; printRegFile(); printf("\n ----- Execute Program ----- \n"); printf("Max Instruction to run = %d \n",MaxInstructions); fflush(stdout); ProgramCounter = exec.GPC_START; /***************************/ /* ADD YOUR VARIABLES HERE */ /***************************/ uint8_t opcode; uint8_t source_register;//should we use int instead of uint uint8_t target_register; uint8_t destination_register; uint8_t shift_ammount; uint8_t function_bits; int16_t immediate; uint16_t unsinged_immediate; int32_t address; int16_t singed_address; int32_t rsValue; uint32_t unsigned_rsValue; int32_t rtValue; uint32_t unsigned_rtValue; int32_t word; uint32_t uword; int32_t data; uint32_t udata; int8_t byte; uint8_t ubyte; int8_t bflag=0; //branch flag int8_t dflag=0; //delay flag uint32_t DelayCounter; //brnaching or jumbing new counter int32_t temp_pc;// temp pc for delay slot int i; for(i = 0; i < MaxInstructions; i++) { RegFile[0]=0; //FETCH THE INSTRUCTION AT 'ProgramCounter' int count=0; // A counter for LWL if((bflag==1)&&(dflag==0)){ ProgramCounter=DelayCounter; bflag=0; } if(dflag==1){ CurrentInstruction = readWord(temp_pc,false); dflag=0; }else{ CurrentInstruction = readWord(ProgramCounter,false); } //PRINT CONTENTS OF THE REGISTER FILE printRegFile(); /********************************/ /* ADD YOUR IMPLEMENTATION HERE */ /********************************/ printf("currentInstruction: %08x\n", CurrentInstruction); opcode = (CurrentInstruction & 0xFC000000) >>26; source_register =(CurrentInstruction & 0x03E00000) >> 21; target_register =(CurrentInstruction & 0x001F0000) >> 16; destination_register =(CurrentInstruction & 0x0000F800) >> 11; shift_ammount =(CurrentInstruction & 0x000007C0) >> 6; function_bits =(CurrentInstruction & 0x0000003F); rsValue =RegFile[source_register]; rtValue =RegFile[target_register]; immediate =(CurrentInstruction & 0x0000FFFF); unsinged_immediate =(CurrentInstruction & 0x0000FFFF);//unsigned immidiate address =(CurrentInstruction & 0x03FFFFFF); rsValue =RegFile[source_register]; rtValue =RegFile[target_register]; printf("opcode: %u\n", opcode); printf("target_register: %d\n", RegFile[target_register]); if(opcode == 0){ switch (function_bits){ case 32:{//ADD if(destination_register==0){ break; } printf("ADD\n"); RegFile[destination_register]= rsValue + rtValue; printf("%d\n",RegFile[destination_register]); break; } case 33:{//addu if(destination_register==0){ break; } printf("ADDU\n"); unsigned_rtValue =(uint32_t)rtValue;//casting the rs and rt values to unsiged unsigned_rsValue =(uint32_t)rsValue; RegFile[destination_register]= unsigned_rsValue + unsigned_rtValue; printf("%d\n",RegFile[destination_register]); break; } case 34:{//SUB if(destination_register==0){ break; } printf("SUB\n"); RegFile[destination_register]= rsValue - rtValue; printf("%d\n",RegFile[destination_register]); break; } case 35:{//subu if(destination_register==0){ break; } printf("SUBU\n"); unsigned_rtValue =(uint32_t)rtValue;//casting the rs and rt values to unsiged unsigned_rsValue =(uint32_t)rsValue; RegFile[destination_register]= unsigned_rsValue - unsigned_rtValue; printf("%d\n",RegFile[destination_register]); break; } case 36:{//AND if(destination_register==0){ break; } printf("AND\n"); RegFile[destination_register]= rsValue & rtValue; printf("%d\n",RegFile[destination_register]); break; } case 37:{//OR if(destination_register==0){ break; } printf("OR\n"); RegFile[destination_register]= rsValue | rtValue; printf("%d\n",RegFile[destination_register]); break; } case 38:{//XOR if(destination_register==0){ break; } printf("XOR\n"); RegFile[destination_register]= rsValue ^ rtValue; printf("%d\n",RegFile[destination_register]); break; } case 39:{//NOR if(destination_register==0){ break; } printf("NOR\n"); RegFile[destination_register]= !(rsValue | rtValue); printf("%d\n",RegFile[destination_register]); break; } case 42:{//SLT printf("SLT\n"); if(destination_register==0){ break; } if(rsValue<rtValue){ RegFile[destination_register]= true; printf("%d\n",RegFile[destination_register]); } else{ RegFile[destination_register]= false; printf("%d\n",RegFile[destination_register]); } break; } case 43:{//SLTU printf("SLTU\n"); if(destination_register==0){ break; } unsigned_rtValue =(uint32_t)rtValue;//casting the rs and rt values to unsiged unsigned_rsValue =(uint32_t)rsValue; if(unsigned_rsValue<unsigned_rtValue){ RegFile[destination_register]= true; printf("%d\n",RegFile[destination_register]); } else{ RegFile[destination_register]= false; printf("%d\n",RegFile[destination_register]); } break; } case 0:{//SLL if((rsValue!=0)&&(rtValue!=0)&&(shift_ammount!=0)){ printf("SLL\n"); if(destination_register==0){ break; } RegFile[destination_register]= rtValue <<shift_ammount; printf("5d\n", RegFile[destination_register]); break; } else{ printf("NOP\n"); break; } } case 2:{//SRL printf("SRL\n"); if(destination_register==0){ break; } unsigned_rtValue =(uint32_t)rtValue; RegFile[destination_register]= unsigned_rtValue >> shift_ammount; printf("5d\n", RegFile[destination_register]); break; } case 3:{//SRA printf("SRA\n"); if(destination_register==0){ break; } RegFile[destination_register]=(signed)rtValue>>shift_ammount; printf("%x\n",RegFile[destination_register]); break; } case 4:{//SLLV printf("SLLV\n"); if(destination_register==0){ break; } RegFile[destination_register]=rtValue<<rsValue; printf("%x\n",RegFile[destination_register]); break; } case 6:{//SRLV printf("SRLV\n"); if(destination_register==0){ break; } RegFile[destination_register]=rtValue>>rsValue; printf("%x\n",RegFile[destination_register]); break; } case 7:{//SRAV printf("SRAV\n"); if(destination_register==0){ break; } RegFile[destination_register]=(signed)rtValue>>rsValue; printf("%x\n",RegFile[destination_register]); break; } case 12:{ printf("SYSCALL inst\n"); SyscallExe(RegFile[2]); } case 16:{//MFHI printf("MFHI\n"); RegFile[destination_register]=RegFile[32]; printf("%d\n",RegFile[destination_register]); break; } case 17:{//MTHI printf("MTHI\n"); RegFile[32]=rsValue; printf("%d\n",RegFile[32]); break; } case 18:{//MFLO printf("MFLO\n"); RegFile[destination_register]=RegFile[33]; printf("%d\n",RegFile[destination_register]); break; } case 19:{//MTLO printf("MTLO\n"); RegFile[33]=rsValue; printf("%d\n",RegFile[33]); break; } case 24:{//MULT printf("MULT\n"); int64_t result = rsValue*rtValue; RegFile[32]= result >>32; RegFile[33]=(int32_t)result; printf("%d\n",RegFile[32]); printf("%d\n",RegFile[33]); break; } case 25:{//MULTU printf("MULTU\n"); unsigned_rtValue =(uint32_t)rtValue;//casting the rs and rt values to unsiged unsigned_rsValue =(uint32_t)rsValue; int64_t result = unsigned_rsValue*unsigned_rtValue; RegFile[32]= result >>32; RegFile[33]=(int32_t)result; printf("%d\n",RegFile[32]); printf("%d\n",RegFile[33]); break; } case 26:{//DIV printf("DIV\n"); RegFile[32]=rsValue%rtValue; RegFile[33]=rsValue/rtValue; printf("%d\n",RegFile[32]); printf("%d\n",RegFile[33]); break; } case 27:{//DIVU printf("DIVU\n"); unsigned_rtValue =(uint32_t)rtValue;//casting the rs and rt values to unsiged unsigned_rsValue =(uint32_t)rsValue; RegFile[32]=unsigned_rsValue%unsigned_rtValue; RegFile[33]=unsigned_rsValue/unsigned_rtValue; printf("%d\n",RegFile[32]); printf("%d\n",RegFile[33]); break; } case 8:{ //delay slot? //JR printf("JR\n"); bflag =1; dflag =1; temp_pc= ProgramCounter +4; DelayCounter = RegFile[source_register];//DelayCounter is the PC that the Jumb reigster goes to. break; } case 9:{ //JALR printf("JALR\n"); bflag =1; dflag =1; temp_pc= ProgramCounter +4; DelayCounter = RegFile[source_register]; //Place the return address link in GPR rd RegFile[31] = ProgramCounter+8; //ProgramCounter = RegFile[destination_register]; break; } } } else if(opcode==8){//ADDI printf("ADDI\n"); int32_t cas_immediate =(int32_t)immediate ; RegFile[target_register]= rsValue + cas_immediate; printf("%d\n",RegFile[target_register]); } else if(opcode==9){//ADDUI printf("ADDUI\n"); unsigned_rsValue =(uint32_t)rsValue; int32_t cas_immediate =(int32_t)immediate; RegFile[target_register]= rsValue + cas_immediate; printf("%d\n",RegFile[target_register]); } else if (opcode==10){//SLTI printf("SLTI\n"); int32_t cas_immediate =(int32_t)immediate ; if(rsValue<cas_immediate){ RegFile[destination_register]= true; printf("%d\n",RegFile[destination_register]); } else{ RegFile[destination_register]= false; printf("%d\n",RegFile[destination_register]); } } else if (opcode==11){//SLTIU printf("SLTIU\n"); uint32_t cas_immediate =(uint32_t)unsinged_immediate; if(rsValue<cas_immediate){ RegFile[destination_register]= true; printf("%d\n",RegFile[destination_register]); } else{ RegFile[destination_register]= false; printf("%d\n",RegFile[destination_register]); } }else if (opcode == 12){//ANDI printf("ANDI\n"); int32_t cas_immediate =(int32_t)immediate; RegFile[target_register]= rsValue & cas_immediate; printf("%d\n",RegFile[target_register]); } else if(opcode==13){//ORI printf("ORI\n"); int32_t cas_immediate =(int32_t)immediate; RegFile[target_register]= rsValue | cas_immediate; printf("%d\n",RegFile[target_register]); } else if(opcode==14){//XORI printf("XORI\n"); int32_t cas_immediate =(int32_t)immediate; RegFile[target_register]= rsValue ^ cas_immediate; printf("%d\n",RegFile[target_register]); } else if (opcode==15){//LUI printf("LUI\n"); int32_t cas_immediate =(int32_t)immediate; RegFile[target_register]= cas_immediate <<16; } else if (opcode==1){ switch(RegFile[target_register]){ case 0:{//BLTZ printf("BLTZ\n"); printf("opcode:%x target_register:%x \n",opcode,RegFile[target_register]); if((signed)RegFile[source_register]<0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; printf("cas_immediate\n"); DelayCounter= ProgramCounter+(cas_immediate); bflag=1; break; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; printf("HERE\n"); break; } } case 1:{//BGEZ printf("BGEZ\n"); if((signed)RegFile[source_register]>=0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; DelayCounter= ProgramCounter+(cas_immediate+4); bflag=1; break; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; break; } } case 16:{//BLTZAL printf("BLTZAL\n"); if((signed)RegFile[source_register]<0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2;//casting RegFile[31]= ProgramCounter+(cas_immediate+4); bflag=1; break; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; break; } } case 17:{//BGEZAL printf("BGEZAL\n"); if((signed)RegFile[source_register]>=0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2;//casting RegFile[31]= ProgramCounter+(cas_immediate+4); bflag=1; break; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; break; } } } } else if (opcode == 4){//BEQ printf("BEQ\n"); if((signed)RegFile[source_register]==(signed)RegFile[target_register]){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; DelayCounter= ProgramCounter+(cas_immediate+4); bflag=1; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; } } else if (opcode == 5){//BNE printf("BNE\n"); if((signed)RegFile[source_register]!=(signed)RegFile[target_register]){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; DelayCounter= ProgramCounter+(cas_immediate+4); bflag=1; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; } } else if (opcode == 6){//BLEZ printf("BLEZ\n"); if((signed)rsValue<=0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; DelayCounter= ProgramCounter+(cas_immediate+4); bflag=1; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; } } else if (opcode == 7){//BGTZ printf("BGTZ\n"); if((signed)rsValue>0){ dflag =1; temp_pc= ProgramCounter +4; int32_t cas_immediate= immediate<<2; DelayCounter= ProgramCounter+(cas_immediate+4); bflag=1; }else{ bflag=0; dflag=1; temp_pc= ProgramCounter +4; } } else if(opcode==2){//J printf("J\n"); bflag =1; dflag =1; temp_pc= ProgramCounter +4; uint32_t temp=(CurrentInstruction& 0xF0000000) | (immediate); int32_t cas_address= temp<<2; DelayCounter= ProgramCounter+(cas_address); printf("x\n", DelayCounter); } else if(opcode==3){//JAL printf("JAL\n"); bflag =1; dflag =1; temp_pc= ProgramCounter +4; uint32_t temp=(CurrentInstruction& 0x03FFFFFF); int32_t cas_address= temp<<2; DelayCounter= ProgramCounter+(cas_address); RegFile[31] = ProgramCounter+8; } else if(opcode==32){//LB printf("LB\n"); address= RegFile[source_register] + immediate; byte= readByte(address, false); RegFile[target_register]=byte; byte=0; } else if(opcode==33){//LH printf("LH\n"); address= RegFile[source_register] + immediate; byte= readByte(address, false); RegFile[target_register]=byte << 8; byte= readByte((address+1), false); RegFile[target_register]= RegFile[target_register] | byte; byte=0; } else if(opcode==34){//LWL printf("LWL\n"); address = RegFile[source_register] + immediate; count = 4 - (address%4); if (count==4){ word= readWord(address, false); RegFile[target_register]=byte; } else{ int k; for(k=0; k<count; k++){ word= word | readByte((address+k), false); word= word << 8; } word = word << (3-k)*8; RegFile[target_register]= (RegFile[target_register] & word) | word; } word=0; } else if(opcode==35){//LW printf("LW\n"); address= RegFile[source_register] + immediate; word= readWord(address, false); RegFile[target_register]=word; word=0; printf("%d",immediate); } else if(opcode==36){//LBU printf("LBU\n"); address= RegFile[source_register] + immediate; ubyte= readByte(address, false); RegFile[target_register]=ubyte; ubyte=0; } else if(opcode==37){//LHU printf("LHU\n"); address= RegFile[source_register] + immediate; ubyte= readByte(address, false); RegFile[target_register]=ubyte << 8; ubyte= readByte((address+1), false); RegFile[target_register]= RegFile[target_register] | ubyte; ubyte=0; } else if(opcode==38){//LWR printf("LWR\n"); address = RegFile[source_register] + immediate; count = address%4; if (count!=0){ for(int k=4; k>count; k--){ data= data | readByte((address+k), false); data= data << 8; } data = data>>8; RegFile[target_register]= (RegFile[target_register] & data) | data; }else{ data =readByte(address,false); } } else if(opcode==40){//SB printf("SB\n"); address= RegFile[source_register] + immediate; ubyte= RegFile[target_register]; writeByte(address,ubyte,false); ubyte=0; } else if(opcode==41){//SH printf("SH\n"); address= RegFile[source_register] + immediate; ubyte= RegFile[target_register]; writeByte(address+1,ubyte,false); ubyte = RegFile[target_register]>>8; writeByte(address,ubyte,false); ubyte=0; } else if(opcode==42){//SWL printf("SWL\n"); address= RegFile[source_register] + immediate; count=4- (address%4); uword=RegFile[target_register]; if(count!=0){ for(int j=0;j<count;j++){ ubyte = uword; writeByte((address+j),ubyte,false); uword = uword >>8; } } writeByte(address,uword,false); uword =0; } else if(opcode == 43){//SW printf("SW\n"); address= RegFile[source_register] + immediate; uword=RegFile[target_register]; writeByte(address,uword,false); uword=0; } else if(opcode==46){//SWR printf("SWR\n"); address= RegFile[source_register] + immediate; count=address%4; uword=RegFile[target_register]; if(count!=0){ for(int k=4; k>count; k--){ ubyte=uword; writeByte((address+k),ubyte,false); uword=uword<<8; } } writeByte(address,uword,false); uword =0; } if(bflag!=1){ ProgramCounter+=4; } RegFile[0]=0; } //Close file pointers & free allocated Memory closeFDT(); CleanUp(); return 0; //testing }
43d26b7efafa6e8dbe0018ff917ed01773ac4980
2e9f9b0dd6e85000fb8c350fd15d87503309a916
/Desktop/fb/pointer.c
597ff7000b6aba21bcb10c3734642fc6bac598ae
[]
no_license
ashishcodekul777/C-progrmms-
d3d85a2874d1456a84bd3c3611b37ce5ec19ea18
1ba004d7bb341a1a7441edd5f83fcd9a7de83ca2
refs/heads/master
2020-05-04T15:07:27.352530
2019-04-05T05:26:33
2019-04-05T05:26:33
179,225,969
0
0
null
null
null
null
UTF-8
C
false
false
281
c
pointer.c
#include<stdio.h> #include<stdlib.h> int main() { int age=30; int *pAge=&age; double gpa=4.5; double *pGpa=&gpa; char grade='A'; char *aGrade=&grade; printf("\n Age=%d",age); printf("\n GPA=%lf",gpa); printf("\n Grade=%c",grade); return 0; }
c8859cdd9749ad815fd39505608ce88a46553364
12d1b99bc6418a46a11eaf7d320782892106a2e8
/Programming_C/Assignment_4/MSViscon.h
5c7569b316979a7bb2f57de293628455a4cd89f5
[]
no_license
ozzieem/Uni
0793f341dd643f05d371f79faece453272d5d6fb
89844b21051a16667f4d8e6af7023fbd7672ed15
refs/heads/master
2021-03-22T05:00:34.518732
2019-09-17T15:52:22
2019-09-17T15:52:22
42,077,664
0
1
null
null
null
null
ISO-8859-2
C
false
false
1,377
h
MSViscon.h
/* MSViscon.h -- 041012 */ /* Funktioner för hantering av Console-fönstret */ #include <windows.h> void gotoxy(int x, int y) { COORD coordScreen; HANDLE hGlobStdOut; hGlobStdOut = GetStdHandle(STD_OUTPUT_HANDLE); coordScreen.X = x; coordScreen.Y = y; SetConsoleCursorPosition(hGlobStdOut, coordScreen); } void clrscr(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD chWritten; HANDLE hGlobStdOut; COORD coordScreen; hGlobStdOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hGlobStdOut, &csbi); coordScreen.X = 0; coordScreen.Y = 0; FillConsoleOutputCharacter(hGlobStdOut, ' ', csbi.dwSize.Y*csbi.dwSize.X, coordScreen, &chWritten); SetConsoleCursorPosition(hGlobStdOut, coordScreen); } int wherex(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE hGlobStdOut; hGlobStdOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hGlobStdOut, &csbi); return csbi.dwCursorPosition.X; } int wherey(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE hGlobStdOut; hGlobStdOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hGlobStdOut, &csbi); return csbi.dwCursorPosition.Y; } void setcursor(int on, int size) { CONSOLE_CURSOR_INFO ccurinfo; HANDLE hGlobStdOut; hGlobStdOut = GetStdHandle(STD_OUTPUT_HANDLE); ccurinfo.bVisible = on; ccurinfo.dwSize = size; SetConsoleCursorInfo(hGlobStdOut, &ccurinfo); }
5f25e41583793c272fd7e8d09497d3643f85c2a5
c2aa8c186955de291f5ef817841cbb535604881d
/main.c
d9273790361e5988a779aa6b387c8a040cff9fbf
[]
no_license
bjornspockeli/nRF52_ppi_timper_gpiote_example
fc1b7434ad2e8c62da4ab052473f5f593167f86a
3b13dd09c5cc592653c09727f5a4fc12e7581928
refs/heads/master
2021-01-21T21:00:44.664065
2017-06-16T07:33:09
2017-06-16T07:33:09
92,299,625
3
0
null
null
null
null
UTF-8
C
false
false
10,417
c
main.c
/** * Copyright (c) 2009 - 2017, Nordic Semiconductor ASA * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, 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. * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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. * */ /** @file * @brief Example template project. * @defgroup nrf_templates_example Example Template * */ #include <stdbool.h> #include <stdint.h> #include "nrf.h" #include "nordic_common.h" #include "boards.h" // Header file that needs to be included for PPI/GPIOTE/TIMER/TWI example. #include "nrf_drv_ppi.h" #include "nrf_drv_timer.h" #include "nrf_drv_gpiote.h" #include "nrf_drv_twi.h" // Headers and defines needed by the logging interface #define NRF_LOG_MODULE_NAME "APP" #include "nrf_log.h" #include "nrf_log_ctrl.h" // Map LED pins on the nRF52 DK. #define LED1 17 #define LED2 20 #define LED3 19 /* TWI instance ID. */ #define TWI_INSTANCE_ID 0 /* Common addresses definition for temperature sensor. */ #define LM75B_ADDR (0x90U >> 1) #define LM75B_REG_TEMP 0x00U #define LM75B_REG_CONF 0x01U /* TWI instance. */ static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID); /* Indicates if operation on TWI has ended. */ static volatile bool m_xfer_done = false; /* Buffer for samples read from temperature sensor. */ static uint8_t m_sample; // Timer instance const nrf_drv_timer_t timer0 = NRF_DRV_TIMER_INSTANCE(0); // PPI channel nrf_ppi_channel_t ppi_channel; // Forward decleration LM75B_read_temp_data static void LM75B_read_temp_data(void); // Dummy timer event handler that will be used for step 2 and 4, but not step 3. void timer_event_handler(nrf_timer_event_t event_type, void * p_context) { switch(event_type) { case NRF_TIMER_EVENT_COMPARE0: nrf_drv_gpiote_out_task_trigger(LED3); LM75B_read_temp_data(); break; default: // Do nothing. break; } } /** @brief Function for initializing the Timer peripheral. */ static void timer_init(void) { ret_code_t err_code; // Configure the timer to use the default configuration set in sdk_config.h nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG; //Initializing the Timer driver err_code = nrf_drv_timer_init(&timer0, &timer_cfg, timer_event_handler); APP_ERROR_CHECK(err_code); /*Configure the timer to generate the COMPARE event after 200*1000UL ticks and enable the shortcut that triggers the CLEAR task on every COMPARE event. This will */ nrf_drv_timer_extended_compare(&timer0, NRF_TIMER_CC_CHANNEL0, nrf_drv_timer_ms_to_ticks(&timer0, 500), NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true); // Set last argument to false for Task 3 // Turning on the Timer. nrf_drv_timer_enable(&timer0); } /** @brief Function for initializing the GPIOTE peripheral. */ static void gpiote_init(void) { ret_code_t err_code; // Initialize the GPIOTE driver err_code = nrf_drv_gpiote_init(); APP_ERROR_CHECK(err_code); // Configure the GPIO pin so that its toggled every time the OUT task is triggerd nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(false); // Apply the configuration above to the LED_1 GPIO pin. err_code = nrf_drv_gpiote_out_init(LED1, &config); APP_ERROR_CHECK(err_code); // Apply the configuration above to the LED_2 GPIO pin. err_code = nrf_drv_gpiote_out_init(LED2, &config); APP_ERROR_CHECK(err_code); // Apply the configuration above to the LED_2 GPIO pin. err_code = nrf_drv_gpiote_out_init(LED3, &config); APP_ERROR_CHECK(err_code); // Enabling the OUT task for the LED_1 GPIO pin. nrf_drv_gpiote_out_task_enable(LED1); // Enabling the OUT task for the LED_2 GPIO pin. nrf_drv_gpiote_out_task_enable(LED2); // Enabling the OUT task for the LED_3 GPIO pin. nrf_drv_gpiote_out_task_enable(LED3); } /** @brief Function for initializing the PPI peripheral. */ static void ppi_init(void) { uint32_t err_code = NRF_SUCCESS; //Initialize the PPI driver err_code = nrf_drv_ppi_init(); APP_ERROR_CHECK(err_code); // Allocate the first unused PPI channel err_code = nrf_drv_ppi_channel_alloc(&ppi_channel); APP_ERROR_CHECK(err_code); // Assigning task and event endpoints so that the PPI channel triggers the OUT task of the LED_1 GPIO pin on TIMER0 COMPARE[0] match. err_code = nrf_drv_ppi_channel_assign(ppi_channel, nrf_drv_timer_event_address_get(&timer0, NRF_TIMER_EVENT_COMPARE0), nrf_drv_gpiote_out_task_addr_get(LED1)); APP_ERROR_CHECK(err_code); // Fork the PPI channel, so that OUT task of the LED_2 GPIO pin is also triggered by the TIMER compare event. err_code = nrf_drv_ppi_channel_fork_assign(ppi_channel, nrf_drv_gpiote_out_task_addr_get(LED2)); APP_ERROR_CHECK(err_code); // Enable the PPI channel err_code = nrf_drv_ppi_channel_enable(ppi_channel); APP_ERROR_CHECK(err_code); } /** * @brief TWI events handler. */ void twi_handler(nrf_drv_twi_evt_t const * p_event, void * p_context) { switch (p_event->type) { case NRF_DRV_TWI_EVT_DONE: if (p_event->xfer_desc.type == NRF_DRV_TWI_XFER_RX) { NRF_LOG_INFO("Temperature: %d Celsius degrees.\r\n", m_sample); } m_xfer_done = true; break; default: break; } } /** * @brief TWI initialization. */ void twi_init (void) { ret_code_t err_code; const nrf_drv_twi_config_t twi_lm75b_config = { .scl = ARDUINO_SCL_PIN, //27 .sda = ARDUINO_SDA_PIN, // .frequency = NRF_TWI_FREQ_100K, .interrupt_priority = TWI_DEFAULT_CONFIG_IRQ_PRIORITY, .clear_bus_init = false }; err_code = nrf_drv_twi_init(&m_twi, &twi_lm75b_config, twi_handler, NULL); APP_ERROR_CHECK(err_code); nrf_drv_twi_enable(&m_twi); } /** * @brief Function for setting the LM75B temperature sensor in Normal mode. */ void LM75B_set_mode(void) { ret_code_t err_code; /* Writing to LM75B_REG_CONF "0" set temperature sensor in NORMAL mode. */ uint8_t reg[2] = {LM75B_REG_CONF, 0U}; err_code = nrf_drv_twi_tx(&m_twi, LM75B_ADDR, reg, sizeof(reg), false); APP_ERROR_CHECK(err_code); while (m_xfer_done == false); } /** * @brief Function for reading data from temperature sensor. */ static void LM75B_read_temp_data() { ret_code_t err_code; // Writing to pointer byte. uint8_t reg = LM75B_REG_TEMP; m_xfer_done = false; err_code = nrf_drv_twi_tx(&m_twi, LM75B_ADDR, &reg, 1, false); APP_ERROR_CHECK(err_code); while (m_xfer_done == false); m_xfer_done = false; /* Read 1 byte from the specified address - skip 3 bits dedicated for fractional part of temperature. */ err_code = nrf_drv_twi_rx(&m_twi, LM75B_ADDR, &m_sample, sizeof(m_sample)); APP_ERROR_CHECK(err_code); } static void power_manage() { /* WFE - If the Event Register is not set, WFE suspends execution until one of the following events occurs: * an IRQ interrupt, unless masked by the CPSR I-bit * an FIQ interrupt, unless masked by the CPSR F-bit * an Imprecise Data abort, unless masked by the CPSR A-bit * a Debug Entry request, if Debug is enabled * an Event signaled by another processor using the SEV instruction. If the Event Register is set, WFE clears it and returns immediately. If WFE is implemented, SEV must also be implemented. SEV - SEV causes an event to be signaled to all cores within a multiprocessor system. If SEV is implemented, WFE must also be implemented. */ // Wait for an event. __WFE(); // Clear any pending events. __SEV(); __WFE(); } /** * @brief Function for application main entry. */ int main(void) { ret_code_t err_code; err_code = NRF_LOG_INIT(NULL); APP_ERROR_CHECK(err_code); NRF_LOG_INFO("GPIOTE/TIMER/PPI/TWI Handson \r\n"); // The GPIOTE peripheral must be initialized first, so that the correct Task Endpoint addresses are returned by nrf_drv_gpiote_xxx_task_addr_get() gpiote_init(); ppi_init(); timer_init(); twi_init(); LM75B_set_mode(); while (true) { power_manage(); // Do nothing. } } /** @} */
c6bbe239650aa1bc0f7278b5e605a03b820248b5
346e86b9291ce2469ba7407148b4e97bbde0a085
/labo4/threads.c
26b6bb239d17efc631924f844aafe369d31c370a
[]
no_license
feveraer/BS-II
df3eca804bd4c8704c56f2b26d359829a2406545
1cf693d4d7c4c7a664cdf0ed6c3a4e6e793a0f99
refs/heads/master
2021-03-22T04:03:08.901087
2017-03-23T12:09:25
2017-03-23T12:09:25
84,097,139
0
0
null
null
null
null
UTF-8
C
false
false
960
c
threads.c
#include <stdio.h> #include <string.h> #include <pthread.h> #include <stdlib.h> #include <unistd.h> #define N_THREADS 4 pthread_t tid[N_THREADS]; // container for 4 threads void *handle_thread(void *arg) { pthread_t id = pthread_self(); int i = 0; int number = *(int*)arg; // every thread does the same, so just print a number 100 times, else check on thread id with a case! for (i = 0; i < 100; i++) { printf("%d\n", number); } return NULL; } int main(int argc, char** argv) { srand(time(NULL)); int i, err; int rand_number = rand() % 100; for (i = 0; i < N_THREADS; i++) { err = pthread_create(&tid[i], NULL, &handle_thread, &rand_number); if (err != 0) { printf("Can't create thread\n"); exit(1); } } // wait until all created threads are terminated, before // continuing in calling thread (main thread) for (i = 0; i < N_THREADS; i++) { pthread_join(tid[i], NULL); } return 0; }