file
stringlengths 18
26
| data
stringlengths 3
1.04M
|
---|---|
the_stack_data/135922.c | // Biblioteca
#include <stdio.h>
//Funcao principal
int main(int argc, char const *argv[])
{
// Escreve na tela
puts("Hola mundo");
return 0;
} |
the_stack_data/98574183.c | // (C) Copyright 2016-2021 Xilinx, Inc.
// All Rights Reserved.
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
int g_idx0;
int g_idx1;
int g_idx2;
int g_idx3;
void set_global_id(int dim, int val) {
if (0 == dim)
g_idx0 = val;
if (1 == dim)
g_idx1 = val;
if (2 == dim)
g_idx2 = val;
if (3 == dim)
g_idx3 = val;
}
int get_global_id(int dim) {
if (0 == dim)
return g_idx0;
if (1 == dim)
return g_idx1;
if (2 == dim)
return g_idx2;
if (3 == dim)
return g_idx3;
}
|
the_stack_data/1067093.c | /* $OpenBSD: rfc5280time.c,v 1.3 2015/10/22 14:01:19 jsing Exp $ */
/*
* Copyright (c) 2015 Joel Sing <[email protected]>
* Copyright (c) 2015 Bob Beck <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <openssl/asn1.h>
#include <openssl/x509.h>
#include <err.h>
#include <stdio.h>
#include <string.h>
struct rfc5280_time_test {
const char *str;
const char *data;
time_t time;
};
struct rfc5280_time_test rfc5280_invtime_tests[] = {
{
.str = "",
},
{
.str = "2015",
},
{
.str = "201509",
},
{
.str = "20150923",
},
{
.str = "20150923032700",
},
{
/* UTC time must have seconds */
.str = "7001010000Z",
},
{
.str = "201509230327Z",
},
{
.str = "20150923032700.Z",
},
{
.str = "20150923032700.123",
},
{
.str = "20150923032700+1100Z",
},
{
.str = "20150923032700-11001",
},
{
/* UTC time cannot have fractional seconds. */
.str = "150923032700.123Z",
},
{
/* Gen time cannot have +- TZ. */
.str = "20150923032712+1115",
},
{
/* Gen time cannot have fractional seconds */
.str = "20150923032712.123Z",
},
{
.str = "aaaaaaaaaaaaaaZ",
},
{
/* Must be a UTC time per RFC 5280 */
.str = "19700101000000Z",
.data = "19700101000000Z",
.time = 0,
},
{
/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
.str = "20150923032700Z",
.data = "20150923032700Z",
.time = 1442978820,
},
#if SIZEOF_TIME_T == 8
{
/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
.str = "00000101000000Z",
.data = "00000101000000Z",
.time = -62167219200LL,
},
{
/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
.str = "20491231235959Z",
.data = "20491231235959Z",
.time = 2524607999LL,
},
#endif
{
/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
.str = "19500101000000Z",
.data = "19500101000000Z",
.time = -631152000LL,
},
};
struct rfc5280_time_test rfc5280_gentime_tests[] = {
#if SIZEOF_TIME_T == 8
{
/* Biggest RFC 5280 time */
.str = "99991231235959Z",
.data = "99991231235959Z",
.time = 253402300799LL,
},
{
.str = "21600218104000Z",
.data = "21600218104000Z",
.time = 6000000000LL,
},
{
/* Smallest RFC 5280 gen time */
.str = "20500101000000Z",
.data = "20500101000000Z",
.time = 2524608000LL,
},
#endif
};
struct rfc5280_time_test rfc5280_utctime_tests[] = {
{
.str = "500101000000Z",
.data = "500101000000Z",
.time = -631152000,
},
{
.str = "540226230640Z",
.data = "540226230640Z",
.time = -500000000,
},
#if SIZEOF_TIME_T == 8
{
.str = "491231235959Z",
.data = "491231235959Z",
.time = 2524607999LL,
},
#endif
{
.str = "700101000000Z",
.data = "700101000000Z",
.time = 0,
},
{
.str = "150923032700Z",
.data = "150923032700Z",
.time = 1442978820,
},
{
.str = "150923102700Z",
.data = "150923102700Z",
.time = 1443004020,
},
{
.str = "150922162712Z",
.data = "150922162712Z",
.time = 1442939232,
},
{
.str = "140524144512Z",
.data = "140524144512Z",
.time = 1400942712,
},
{
.str = "240401144512Z",
.data = "240401144512Z",
.time = 1711982712,
},
};
#define N_INVTIME_TESTS \
(sizeof(rfc5280_invtime_tests) / sizeof(*rfc5280_invtime_tests))
#define N_GENTIME_TESTS \
(sizeof(rfc5280_gentime_tests) / sizeof(*rfc5280_gentime_tests))
#define N_UTCTIME_TESTS \
(sizeof(rfc5280_utctime_tests) / sizeof(*rfc5280_utctime_tests))
static int
asn1_compare_str(int test_no, struct asn1_string_st *asn1str, const char *str)
{
int length = strlen(str);
if (asn1str->length != length) {
fprintf(stderr, "FAIL: test %i - string lengths differ "
"(%i != %i)\n", test_no, asn1str->length, length);
return (1);
}
if (strncmp(asn1str->data, str, length) != 0) {
fprintf(stderr, "FAIL: test %i - strings differ "
"('%s' != '%s')\n", test_no, asn1str->data, str);
return (1);
}
return (0);
}
static int
rfc5280_invtime_test(int test_no, struct rfc5280_time_test *att)
{
ASN1_GENERALIZEDTIME *gt = NULL;
ASN1_UTCTIME *ut = NULL;
ASN1_TIME *t = NULL;
int failure = 1;
time_t now = time(NULL);
if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
goto done;
if ((ut = ASN1_UTCTIME_new()) == NULL)
goto done;
if ((t = ASN1_TIME_new()) == NULL)
goto done;
if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 0) {
if (X509_cmp_time(gt, &now) != 0) {
fprintf(stderr, "FAIL: test %i - successfully parsed as GENTIME "
"string '%s'\n", test_no, att->str);
goto done;
}
}
if (ASN1_UTCTIME_set_string(ut, att->str) != 0) {
if (X509_cmp_time(ut, &now) != 0) {
fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME "
"string '%s'\n", test_no, att->str);
goto done;
}
}
if (ASN1_TIME_set_string(t, att->str) != 0) {
if (X509_cmp_time(t, &now) != 0) {
fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME "
"string '%s'\n", test_no, att->str);
goto done;
}
}
failure = 0;
done:
ASN1_GENERALIZEDTIME_free(gt);
ASN1_UTCTIME_free(ut);
ASN1_TIME_free(t);
return (failure);
}
static int
rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att)
{
unsigned char *p = NULL;
ASN1_GENERALIZEDTIME *gt;
int failure = 1;
int i;
if ((gt = ASN1_GENERALIZEDTIME_new()) == NULL)
goto done;
if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 1) {
fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n",
test_no, att->str);
goto done;
}
if (asn1_compare_str(test_no, gt, att->str) != 0)
goto done;
if ((i = X509_cmp_time(gt, &att->time)) != -1) {
fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
test_no, i, (long long)att->time);
goto done;
}
att->time--;
if ((i = X509_cmp_time(gt, &att->time)) != 1) {
fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
test_no, i, (long long)att->time);
goto done;
}
att->time++;
ASN1_GENERALIZEDTIME_free(gt);
if ((gt = ASN1_GENERALIZEDTIME_set(NULL, att->time)) == NULL) {
fprintf(stderr, "FAIL: test %i - failed to set time %lli\n",
test_no, (long long)att->time);
goto done;
}
if (asn1_compare_str(test_no, gt, att->data) != 0)
goto done;
failure = 0;
done:
ASN1_GENERALIZEDTIME_free(gt);
free(p);
return (failure);
}
static int
rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att)
{
unsigned char *p = NULL;
ASN1_UTCTIME *ut;
int failure = 1;
int i;
if ((ut = ASN1_UTCTIME_new()) == NULL)
goto done;
if (ASN1_UTCTIME_set_string(ut, att->str) != 1) {
fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n",
test_no, att->str);
goto done;
}
if (asn1_compare_str(test_no, ut, att->str) != 0)
goto done;
if ((i = X509_cmp_time(ut, &att->time)) != -1) {
fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
test_no, i, (long long)att->time);
goto done;
}
att->time--;
if ((i = X509_cmp_time(ut, &att->time)) != 1) {
fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
test_no, i, (long long)att->time);
goto done;
}
att->time++;
ASN1_UTCTIME_free(ut);
if ((ut = ASN1_UTCTIME_set(NULL, att->time)) == NULL) {
fprintf(stderr, "FAIL: test %i - failed to set time %lli\n",
test_no, (long long)att->time);
goto done;
}
if (asn1_compare_str(test_no, ut, att->data) != 0)
goto done;
failure = 0;
done:
ASN1_UTCTIME_free(ut);
free(p);
return (failure);
}
int
main(int argc, char **argv)
{
struct rfc5280_time_test *att;
int failed = 0;
size_t i;
fprintf(stderr, "RFC5280 Invalid time tests...\n");
for (i = 0; i < N_INVTIME_TESTS; i++) {
att = &rfc5280_invtime_tests[i];
failed |= rfc5280_invtime_test(i, att);
}
fprintf(stderr, "RFC5280 GENERALIZEDTIME tests...\n");
for (i = 0; i < N_GENTIME_TESTS; i++) {
att = &rfc5280_gentime_tests[i];
failed |= rfc5280_gentime_test(i, att);
}
fprintf(stderr, "RFC5280 UTCTIME tests...\n");
for (i = 0; i < N_UTCTIME_TESTS; i++) {
att = &rfc5280_utctime_tests[i];
failed |= rfc5280_utctime_test(i, att);
}
return (failed);
}
|
the_stack_data/14201260.c |
#ifdef __cplusplus
extern "C" {
#endif
char *names7 [] =
{
"flatten_when_closing",
"keep_calls_records",
"recording_values",
"maximum_record_count",
};
char *names10 [] =
{
"s1",
"s1_2",
"s1_3",
"s1_4",
"s2",
"s3",
"s4",
"s5",
"s6",
"s7",
"s8",
"s8_2",
"s8_3",
"s8_4",
};
char *names11 [] =
{
"old_version",
"new_version",
"mismatches_by_name",
"mismatches_by_stored_position",
"has_version_mismatch",
"has_new_attribute",
"has_new_attached_attribute",
"type_id",
"old_count",
"new_count",
};
char *names14 [] =
{
"message",
};
char *names15 [] =
{
"default_output",
};
char *names17 [] =
{
"version",
};
char *names30 [] =
{
"sign_string",
"fill_character",
"separator",
"trailing_sign",
"bracketted_negative",
"width",
"justification",
"sign_format",
};
char *names34 [] =
{
"action",
};
char *names36 [] =
{
"last_index",
};
char *names37 [] =
{
"retrieved_errors",
};
char *names39 [] =
{
"is_pointer_value_stored",
};
char *names40 [] =
{
"buffer",
"medium",
"is_pointer_value_stored",
"is_for_reading",
"is_little_endian_storable",
"buffer_size",
"buffer_position",
"stored_pointer_bytes",
};
char *names41 [] =
{
"buffer",
"medium",
"is_pointer_value_stored",
"is_for_reading",
"is_little_endian_storable",
"buffer_size",
"buffer_position",
"stored_pointer_bytes",
};
char *names48 [] =
{
"managed_pointer",
"shared",
"internal_item",
};
char *names49 [] =
{
"root_object",
"on_processing_object_action",
"on_processing_reference_action",
"object_action",
"visited_objects",
"visited_types",
"has_failed",
"has_reference_with_copy_semantics",
"is_skip_transient",
"is_skip_copy_semantics_reference",
"is_exception_on_copy_suppressed",
"is_exception_propagated",
};
char *names50 [] =
{
"root_object",
"on_processing_object_action",
"on_processing_reference_action",
"object_action",
"visited_objects",
"visited_types",
"has_failed",
"has_reference_with_copy_semantics",
"is_skip_transient",
"is_skip_copy_semantics_reference",
"is_exception_on_copy_suppressed",
"is_exception_propagated",
};
char *names51 [] =
{
"root_object",
"on_processing_object_action",
"on_processing_reference_action",
"object_action",
"visited_objects",
"visited_types",
"has_failed",
"has_reference_with_copy_semantics",
"is_skip_transient",
"is_skip_copy_semantics_reference",
"is_exception_on_copy_suppressed",
"is_exception_propagated",
};
char *names57 [] =
{
"integer_overflow_state1",
"integer_overflow_state2",
"natural_overflow_state1",
"natural_overflow_state2",
};
char *names58 [] =
{
"leading_separators",
"trailing_separators",
"trailing_separators_acceptable",
"leading_separators_acceptable",
"conversion_type",
"last_state",
"sign",
};
char *names59 [] =
{
"leading_separators",
"trailing_separators",
"internal_lookahead",
"trailing_separators_acceptable",
"leading_separators_acceptable",
"internal_overflowed",
"conversion_type",
"last_state",
"sign",
"part1",
"part2",
};
char *names60 [] =
{
"leading_separators",
"trailing_separators",
"trailing_separators_acceptable",
"leading_separators_acceptable",
"is_negative",
"has_negative_exponent",
"has_fractional_part",
"needs_digit",
"conversion_type",
"last_state",
"sign",
"exponent",
"natural_part",
"fractional_part",
"fractional_divider",
};
char *names61 [] =
{
"leading_separators",
"trailing_separators",
"trailing_separators_acceptable",
"leading_separators_acceptable",
"internal_overflowed",
"conversion_type",
"last_state",
"sign",
"part1",
"part2",
};
char *names65 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names66 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names67 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names68 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names69 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names70 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names71 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"exception_information",
"internal_is_ignorable",
"line_number",
"hresult",
"hresult_code",
};
char *names72 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
"error_code",
};
char *names73 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
"signal_code",
};
char *names74 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names75 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names76 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names77 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names78 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names79 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
"internal_code",
};
char *names80 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names81 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names82 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names83 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names84 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
"internal_code",
};
char *names85 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names86 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names87 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names88 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
"error_code",
"internal_code",
};
char *names89 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names90 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names91 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names92 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"routine_name",
"class_name",
"internal_is_ignorable",
"line_number",
};
char *names93 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names94 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names95 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names96 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names97 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names98 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names99 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names100 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names101 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names102 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"line_number",
};
char *names103 [] =
{
"recipient_name",
"type_name",
"throwing_exception",
"c_description",
"internal_trace",
"internal_is_ignorable",
"is_entry",
"line_number",
};
char *names104 [] =
{
"deltas",
"deltas_array",
};
char *names105 [] =
{
"deltas",
"deltas_array",
};
char *names106 [] =
{
"deltas",
"deltas_array",
};
char *names110 [] =
{
"serializer",
"reflector",
"reflected_object",
"traversable",
"object_indexes",
"is_root_object_set",
"has_reference_with_copy_semantics",
"version",
};
char *names111 [] =
{
"serializer",
"reflector",
"reflected_object",
"traversable",
"object_indexes",
"is_root_object_set",
"has_reference_with_copy_semantics",
"version",
};
char *names112 [] =
{
"serializer",
"reflector",
"reflected_object",
"traversable",
"object_indexes",
"is_root_object_set",
"has_reference_with_copy_semantics",
"version",
};
char *names113 [] =
{
"serializer",
"reflector",
"reflected_object",
"traversable",
"object_indexes",
"is_root_object_set",
"has_reference_with_copy_semantics",
"version",
};
char *names114 [] =
{
"deserializer",
"last_decoded_object",
"errors",
"reflector",
"reflected_object",
"object_references",
"dynamic_type_table",
"has_reference_with_copy_semantics",
"version",
};
char *names115 [] =
{
"deserializer",
"last_decoded_object",
"errors",
"reflector",
"reflected_object",
"object_references",
"dynamic_type_table",
"has_reference_with_copy_semantics",
"version",
};
char *names116 [] =
{
"deserializer",
"last_decoded_object",
"errors",
"reflector",
"reflected_object",
"object_references",
"dynamic_type_table",
"attributes_mapping",
"has_reference_with_copy_semantics",
"version",
};
char *names120 [] =
{
"sign_string",
"fill_character",
"separator",
"decimal",
"trailing_sign",
"bracketted_negative",
"after_decimal_separate",
"zero_not_shown",
"trailing_zeros_shown",
"width",
"justification",
"sign_format",
"decimals",
};
char *names122 [] =
{
"managed_pointer",
"shared",
"type",
"internal_item",
};
char *names123 [] =
{
"managed_pointer",
"shared",
"type",
"internal_item",
};
char *names125 [] =
{
"buffer",
"medium",
"is_pointer_value_stored",
"is_for_reading",
"is_little_endian_storable",
"buffer_size",
"buffer_position",
"stored_pointer_bytes",
};
char *names126 [] =
{
"buffer",
"medium",
"is_pointer_value_stored",
"is_for_reading",
"is_little_endian_storable",
"is_last_chunk",
"buffer_size",
"buffer_position",
"stored_pointer_bytes",
};
char *names128 [] =
{
"managed_data",
"count",
};
char *names133 [] =
{
"dynamic_type",
};
char *names135 [] =
{
"top_callstack_record",
"bottom_callstack_record",
"replayed_call",
"replay_stack",
"flatten_when_closing",
"keep_calls_records",
"recording_values",
"is_replaying",
"last_replay_operation_failed",
"record_count",
"maximum_record_count",
};
char *names136 [] =
{
"referring_object",
"dynamic_type",
"physical_offset",
"referring_physical_offset",
};
char *names137 [] =
{
"enclosing_object",
"dynamic_type",
"physical_offset",
};
char *names139 [] =
{
"recorder",
"object",
"breakable_info",
"parent",
"steps",
"call_records",
"value_records",
"last_position",
"rt_information_available",
"is_expanded",
"is_flat",
"is_closed",
"class_type_id",
"feature_rout_id",
"depth",
};
char *names141 [] =
{
"breakable_info",
"position",
"type",
};
char *names144 [] =
{
"cursor",
"internal_exhausted",
"starter",
};
char *names145 [] =
{
"position",
};
char *names146 [] =
{
"index",
};
char *names149 [] =
{
"object_comparison",
"upper",
"lower",
};
char *names150 [] =
{
"opo_change_actions",
"object_comparison",
"upper",
"lower",
};
char *names152 [] =
{
"managed_data",
"unit_count",
};
char *names154 [] =
{
"return_code",
};
char *names155 [] =
{
"buffered_file_info",
"internal_file_name",
"internal_name_pointer",
"exists",
"is_following_symlinks",
};
char *names156 [] =
{
"buffered_file_info",
"internal_file_name",
"internal_name_pointer",
"exists",
"is_following_symlinks",
};
char *names158 [] =
{
"deserializer",
"last_decoded_object",
"errors",
"reflector",
"reflected_object",
"object_references",
"dynamic_type_table",
"attributes_mapping",
"class_type_translator",
"attribute_name_translator",
"mismatches",
"mismatched_object",
"has_reference_with_copy_semantics",
"is_conforming_mismatch_allowed",
"is_attribute_removal_allowed",
"is_stopping_on_data_retrieval_error",
"is_checking_data_consistency",
"version",
};
char *names159 [] =
{
"found_item",
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_item",
"ht_deleted_key",
"stored_version",
"current_version",
"object_comparison",
"hash_table_version_64",
"has_default",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"count",
};
char *names160 [] =
{
"found_item",
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_item",
"ht_deleted_key",
"object_comparison",
"hash_table_version_64",
"has_default",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"count",
};
char *names161 [] =
{
"content",
"keys",
"indexes_map",
"deleted_marks",
"object_comparison",
"hash_table_version_64",
"has_default",
"last_index",
"found_item",
"ht_deleted_item",
"table_capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"capacity",
"ht_deleted_key",
};
char *names162 [] =
{
"object_comparison",
"index",
"seed",
"last_item",
"last_result",
};
char *names163 [] =
{
"target",
"target_index",
"start_index",
"end_index",
};
char *names164 [] =
{
"object_comparison",
"index",
};
char *names165 [] =
{
"object_comparison",
"index",
};
char *names167 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"area_first_index",
};
char *names168 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"area_first_index",
};
char *names170 [] =
{
"byte",
"file_pointer",
};
char *names171 [] =
{
"item",
};
char *names172 [] =
{
"is_shared",
"count",
"item",
"counter",
};
char *names173 [] =
{
"internal_area",
"is_resizable",
};
char *names175 [] =
{
"cond_pointer",
};
char *names176 [] =
{
"lastentry",
"internal_name",
"internal_detachable_name_pointer",
"mode",
"directory_pointer",
"last_entry_pointer",
};
char *names177 [] =
{
"sem_pointer",
};
char *names178 [] =
{
"owner_thread_id",
"mutex_pointer",
};
char *names179 [] =
{
"internal_id",
};
char *names180 [] =
{
"last_string",
"last_character",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"last_real",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names181 [] =
{
"last_string",
"last_character",
"is_closed",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"buffer_size",
"object_stored_size",
"last_real",
"internal_buffer_access",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names182 [] =
{
"last_string",
"internal_name",
"internal_detachable_name_pointer",
"last_character",
"separator",
"object_comparison",
"descriptor_available",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"mode",
"last_real",
"file_pointer",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names183 [] =
{
"last_string",
"internal_name",
"internal_detachable_name_pointer",
"internal_integer_buffer",
"last_character",
"separator",
"object_comparison",
"descriptor_available",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"mode",
"last_real",
"file_pointer",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names184 [] =
{
"last_string",
"internal_name",
"internal_detachable_name_pointer",
"last_character",
"separator",
"object_comparison",
"descriptor_available",
"is_sequence_an_expected_numeric",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"mode",
"last_real",
"file_pointer",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names186 [] =
{
"storage",
"internal_name",
"is_normalized",
};
char *names188 [] =
{
"item",
};
char *names189 [] =
{
"item",
};
char *names190 [] =
{
"item",
};
char *names191 [] =
{
"item",
};
char *names192 [] =
{
"item",
};
char *names193 [] =
{
"item",
};
char *names194 [] =
{
"item",
};
char *names195 [] =
{
"item",
};
char *names196 [] =
{
"item",
};
char *names197 [] =
{
"item",
};
char *names198 [] =
{
"item",
};
char *names199 [] =
{
"item",
};
char *names200 [] =
{
"item",
};
char *names201 [] =
{
"item",
};
char *names202 [] =
{
"item",
};
char *names203 [] =
{
"item",
};
char *names204 [] =
{
"item",
};
char *names205 [] =
{
"item",
};
char *names206 [] =
{
"item",
};
char *names207 [] =
{
"item",
};
char *names208 [] =
{
"item",
};
char *names209 [] =
{
"item",
};
char *names210 [] =
{
"item",
};
char *names211 [] =
{
"item",
};
char *names212 [] =
{
"item",
};
char *names213 [] =
{
"item",
};
char *names214 [] =
{
"item",
};
char *names215 [] =
{
"item",
};
char *names216 [] =
{
"item",
};
char *names217 [] =
{
"item",
};
char *names218 [] =
{
"item",
};
char *names219 [] =
{
"item",
};
char *names220 [] =
{
"item",
};
char *names221 [] =
{
"item",
};
char *names222 [] =
{
"item",
};
char *names223 [] =
{
"item",
};
char *names224 [] =
{
"item",
};
char *names225 [] =
{
"item",
};
char *names226 [] =
{
"item",
};
char *names227 [] =
{
"item",
};
char *names228 [] =
{
"item",
};
char *names229 [] =
{
"item",
};
char *names230 [] =
{
"internal_hash_code",
"internal_case_insensitive_hash_code",
};
char *names231 [] =
{
"area",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names232 [] =
{
"internal_hash_code",
"internal_case_insensitive_hash_code",
};
char *names233 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names234 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
"index",
};
char *names235 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names236 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names237 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names238 [] =
{
"area",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names239 [] =
{
"area",
"object_comparison",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
};
char *names240 [] =
{
"internal_hash_code",
"internal_case_insensitive_hash_code",
};
char *names241 [] =
{
"area",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
"area_lower",
};
char *names242 [] =
{
"area",
"internal_hash_code",
"internal_case_insensitive_hash_code",
"count",
"area_lower",
};
char *names243 [] =
{
"last_string",
"internal_name",
"internal_detachable_name_pointer",
"last_character",
"separator",
"object_comparison",
"descriptor_available",
"is_sequence_an_expected_numeric",
"last_natural_8",
"last_integer_8",
"last_natural_16",
"last_integer_16",
"last_natural",
"last_integer",
"bytes_read",
"mode",
"last_real",
"file_pointer",
"last_natural_64",
"last_integer_64",
"last_double",
};
char *names244 [] =
{
"area",
};
char *names245 [] =
{
"retrieved_errors",
"deserialized_object",
"error_message",
"successful",
"last_file_position",
};
char *names246 [] =
{
"internal_name_32",
"internal_name",
};
char *names248 [] =
{
"internal_name_32",
"internal_name",
};
char *names249 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names251 [] =
{
"operands",
"closed_operands",
"open_map",
"open_types",
"is_target_closed",
"is_basic",
"open_count",
"routine_id",
"written_type_id_inline_agent",
"rout_disp",
"calc_rout_addr",
"encaps_rout_disp",
};
char *names252 [] =
{
"to_pointer",
};
char *names253 [] =
{
"to_pointer",
};
char *names254 [] =
{
"internal_name_32",
"internal_name",
};
char *names255 [] =
{
"operands",
"closed_operands",
"open_map",
"open_types",
"is_target_closed",
"is_basic",
"open_count",
"routine_id",
"written_type_id_inline_agent",
"rout_disp",
"calc_rout_addr",
"encaps_rout_disp",
};
char *names256 [] =
{
"object_comparison",
};
char *names260 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names262 [] =
{
"object_comparison",
};
char *names263 [] =
{
"object_comparison",
};
char *names264 [] =
{
"object_comparison",
};
char *names265 [] =
{
"operands",
"closed_operands",
"open_map",
"open_types",
"is_target_closed",
"is_basic",
"last_result",
"open_count",
"routine_id",
"written_type_id_inline_agent",
"rout_disp",
"calc_rout_addr",
"encaps_rout_disp",
};
char *names266 [] =
{
"object_comparison",
};
char *names267 [] =
{
"object_comparison",
};
char *names268 [] =
{
"object_comparison",
};
char *names269 [] =
{
"object_comparison",
};
char *names270 [] =
{
"object_comparison",
};
char *names271 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names272 [] =
{
"object_comparison",
};
char *names273 [] =
{
"object_comparison",
};
char *names274 [] =
{
"object_comparison",
};
char *names275 [] =
{
"object_comparison",
};
char *names276 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names278 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names279 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names280 [] =
{
"area",
};
char *names281 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names282 [] =
{
"object_comparison",
};
char *names283 [] =
{
"object_comparison",
};
char *names284 [] =
{
"object_comparison",
};
char *names285 [] =
{
"object_comparison",
};
char *names286 [] =
{
"object_comparison",
};
char *names287 [] =
{
"object_comparison",
};
char *names288 [] =
{
"object_comparison",
};
char *names289 [] =
{
"object_comparison",
};
char *names290 [] =
{
"object_comparison",
};
char *names293 [] =
{
"object_comparison",
};
char *names296 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names298 [] =
{
"object_comparison",
};
char *names299 [] =
{
"object_comparison",
};
char *names300 [] =
{
"object_comparison",
};
char *names301 [] =
{
"object_comparison",
};
char *names302 [] =
{
"object_comparison",
};
char *names303 [] =
{
"object_comparison",
};
char *names304 [] =
{
"object_comparison",
};
char *names305 [] =
{
"object_comparison",
};
char *names306 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names307 [] =
{
"internal_name_32",
"internal_name",
};
char *names308 [] =
{
"internal_name_32",
"internal_name",
};
char *names309 [] =
{
"internal_name_32",
"internal_name",
};
char *names310 [] =
{
"internal_name_32",
"internal_name",
};
char *names311 [] =
{
"internal_name_32",
"internal_name",
};
char *names312 [] =
{
"internal_name_32",
"internal_name",
};
char *names313 [] =
{
"internal_name_32",
"internal_name",
};
char *names314 [] =
{
"internal_name_32",
"internal_name",
};
char *names315 [] =
{
"internal_name_32",
"internal_name",
};
char *names316 [] =
{
"internal_name_32",
"internal_name",
};
char *names317 [] =
{
"internal_name_32",
"internal_name",
};
char *names318 [] =
{
"internal_name_32",
"internal_name",
};
char *names319 [] =
{
"internal_name_32",
"internal_name",
};
char *names320 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names321 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names327 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names330 [] =
{
"internal_name_32",
"internal_name",
};
char *names331 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names332 [] =
{
"object_comparison",
};
char *names333 [] =
{
"object_comparison",
};
char *names334 [] =
{
"object_comparison",
};
char *names335 [] =
{
"object_comparison",
};
char *names336 [] =
{
"object_comparison",
};
char *names337 [] =
{
"object_comparison",
};
char *names338 [] =
{
"object_comparison",
};
char *names339 [] =
{
"object_comparison",
};
char *names340 [] =
{
"object_comparison",
};
char *names341 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names342 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names343 [] =
{
"object_comparison",
};
char *names344 [] =
{
"object_comparison",
};
char *names345 [] =
{
"object_comparison",
};
char *names346 [] =
{
"object_comparison",
};
char *names347 [] =
{
"object_comparison",
};
char *names348 [] =
{
"object_comparison",
};
char *names349 [] =
{
"object_comparison",
};
char *names350 [] =
{
"object_comparison",
};
char *names351 [] =
{
"object_comparison",
};
char *names352 [] =
{
"object_comparison",
};
char *names353 [] =
{
"object_comparison",
};
char *names354 [] =
{
"area",
};
char *names355 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names356 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names358 [] =
{
"object_comparison",
};
char *names363 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names365 [] =
{
"object_comparison",
};
char *names366 [] =
{
"object_comparison",
};
char *names367 [] =
{
"object_comparison",
};
char *names368 [] =
{
"object_comparison",
};
char *names369 [] =
{
"object_comparison",
};
char *names370 [] =
{
"object_comparison",
};
char *names371 [] =
{
"object_comparison",
};
char *names372 [] =
{
"object_comparison",
};
char *names373 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names374 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names375 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names377 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names378 [] =
{
"internal_name_32",
"internal_name",
};
char *names379 [] =
{
"object_comparison",
};
char *names380 [] =
{
"object_comparison",
};
char *names381 [] =
{
"object_comparison",
};
char *names382 [] =
{
"object_comparison",
};
char *names383 [] =
{
"object_comparison",
};
char *names384 [] =
{
"object_comparison",
};
char *names385 [] =
{
"object_comparison",
};
char *names386 [] =
{
"object_comparison",
};
char *names387 [] =
{
"object_comparison",
};
char *names388 [] =
{
"object_comparison",
};
char *names389 [] =
{
"object_comparison",
};
char *names390 [] =
{
"area",
};
char *names391 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names392 [] =
{
"object_comparison",
};
char *names397 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names399 [] =
{
"object_comparison",
};
char *names400 [] =
{
"object_comparison",
};
char *names401 [] =
{
"object_comparison",
};
char *names402 [] =
{
"object_comparison",
};
char *names403 [] =
{
"object_comparison",
};
char *names404 [] =
{
"object_comparison",
};
char *names405 [] =
{
"object_comparison",
};
char *names406 [] =
{
"object_comparison",
};
char *names409 [] =
{
"area",
"object_comparison",
"out_index",
"count",
};
char *names410 [] =
{
"area",
"area_index",
"remaining_count",
};
char *names411 [] =
{
"object_comparison",
};
char *names412 [] =
{
"object_comparison",
};
char *names413 [] =
{
"found_item",
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_item",
"ht_deleted_key",
"object_comparison",
"hash_table_version_64",
"has_default",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"count",
};
char *names414 [] =
{
"object_comparison",
};
char *names415 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"iteration_position",
};
char *names418 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names420 [] =
{
"object_comparison",
};
char *names425 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names427 [] =
{
"object_comparison",
};
char *names428 [] =
{
"object_comparison",
};
char *names429 [] =
{
"object_comparison",
};
char *names430 [] =
{
"object_comparison",
};
char *names431 [] =
{
"object_comparison",
};
char *names432 [] =
{
"object_comparison",
};
char *names433 [] =
{
"object_comparison",
};
char *names434 [] =
{
"object_comparison",
};
char *names435 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names436 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names437 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names439 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names440 [] =
{
"internal_name_32",
"internal_name",
};
char *names441 [] =
{
"object_comparison",
};
char *names442 [] =
{
"object_comparison",
};
char *names443 [] =
{
"object_comparison",
};
char *names444 [] =
{
"object_comparison",
};
char *names445 [] =
{
"object_comparison",
};
char *names446 [] =
{
"object_comparison",
};
char *names447 [] =
{
"object_comparison",
};
char *names448 [] =
{
"object_comparison",
};
char *names449 [] =
{
"object_comparison",
};
char *names450 [] =
{
"object_comparison",
};
char *names451 [] =
{
"object_comparison",
};
char *names452 [] =
{
"area",
};
char *names453 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names454 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names456 [] =
{
"object_comparison",
};
char *names461 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names463 [] =
{
"object_comparison",
};
char *names464 [] =
{
"object_comparison",
};
char *names465 [] =
{
"object_comparison",
};
char *names466 [] =
{
"object_comparison",
};
char *names467 [] =
{
"object_comparison",
};
char *names468 [] =
{
"object_comparison",
};
char *names469 [] =
{
"object_comparison",
};
char *names470 [] =
{
"object_comparison",
};
char *names471 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names472 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names473 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names475 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names476 [] =
{
"internal_name_32",
"internal_name",
};
char *names477 [] =
{
"object_comparison",
};
char *names478 [] =
{
"object_comparison",
};
char *names479 [] =
{
"object_comparison",
};
char *names480 [] =
{
"object_comparison",
};
char *names481 [] =
{
"object_comparison",
};
char *names482 [] =
{
"object_comparison",
};
char *names483 [] =
{
"object_comparison",
};
char *names484 [] =
{
"object_comparison",
};
char *names485 [] =
{
"object_comparison",
};
char *names486 [] =
{
"object_comparison",
};
char *names487 [] =
{
"object_comparison",
};
char *names488 [] =
{
"area",
};
char *names489 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names490 [] =
{
"internal_name_32",
"internal_name",
};
char *names491 [] =
{
"internal_name_32",
"internal_name",
};
char *names492 [] =
{
"object_comparison",
};
char *names496 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names498 [] =
{
"object_comparison",
};
char *names499 [] =
{
"object_comparison",
};
char *names500 [] =
{
"object_comparison",
};
char *names501 [] =
{
"object_comparison",
};
char *names502 [] =
{
"object_comparison",
};
char *names503 [] =
{
"object_comparison",
};
char *names504 [] =
{
"object_comparison",
};
char *names505 [] =
{
"object_comparison",
};
char *names506 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names509 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names510 [] =
{
"internal_name_32",
"internal_name",
};
char *names511 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names512 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names513 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names514 [] =
{
"object_comparison",
};
char *names515 [] =
{
"object_comparison",
};
char *names516 [] =
{
"object_comparison",
};
char *names517 [] =
{
"object_comparison",
};
char *names518 [] =
{
"object_comparison",
};
char *names519 [] =
{
"object_comparison",
};
char *names520 [] =
{
"object_comparison",
};
char *names521 [] =
{
"object_comparison",
};
char *names522 [] =
{
"object_comparison",
};
char *names523 [] =
{
"object_comparison",
};
char *names524 [] =
{
"object_comparison",
};
char *names525 [] =
{
"area",
};
char *names526 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names527 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names528 [] =
{
"to_pointer",
};
char *names529 [] =
{
"to_pointer",
};
char *names530 [] =
{
"internal_name_32",
"internal_name",
};
char *names531 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"value",
"callstack_depth",
};
char *names532 [] =
{
"to_pointer",
};
char *names533 [] =
{
"to_pointer",
};
char *names534 [] =
{
"internal_name_32",
"internal_name",
};
char *names535 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names536 [] =
{
"found_item",
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_item",
"object_comparison",
"hash_table_version_64",
"has_default",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"ht_deleted_key",
"count",
};
char *names537 [] =
{
"internal_name_32",
"internal_name",
};
char *names543 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names545 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names546 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names547 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names548 [] =
{
"object_comparison",
};
char *names549 [] =
{
"object_comparison",
};
char *names550 [] =
{
"object_comparison",
};
char *names551 [] =
{
"object_comparison",
};
char *names552 [] =
{
"object_comparison",
};
char *names553 [] =
{
"object_comparison",
};
char *names554 [] =
{
"object_comparison",
};
char *names555 [] =
{
"object_comparison",
};
char *names556 [] =
{
"object_comparison",
};
char *names557 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names558 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names559 [] =
{
"object_comparison",
};
char *names560 [] =
{
"object_comparison",
};
char *names561 [] =
{
"object_comparison",
};
char *names562 [] =
{
"object_comparison",
};
char *names563 [] =
{
"object_comparison",
};
char *names564 [] =
{
"object_comparison",
};
char *names565 [] =
{
"object_comparison",
};
char *names566 [] =
{
"object_comparison",
};
char *names567 [] =
{
"object_comparison",
};
char *names568 [] =
{
"object_comparison",
};
char *names569 [] =
{
"object_comparison",
};
char *names570 [] =
{
"area",
};
char *names571 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names572 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"iteration_position",
};
char *names575 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"callstack_depth",
"value",
};
char *names576 [] =
{
"to_pointer",
};
char *names577 [] =
{
"to_pointer",
};
char *names578 [] =
{
"internal_name_32",
"internal_name",
};
char *names579 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"callstack_depth",
"value",
};
char *names580 [] =
{
"item",
};
char *names581 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names582 [] =
{
"to_pointer",
};
char *names583 [] =
{
"to_pointer",
};
char *names584 [] =
{
"internal_name_32",
"internal_name",
};
char *names585 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names586 [] =
{
"to_pointer",
};
char *names587 [] =
{
"to_pointer",
};
char *names588 [] =
{
"internal_name_32",
"internal_name",
};
char *names589 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names590 [] =
{
"to_pointer",
};
char *names591 [] =
{
"to_pointer",
};
char *names592 [] =
{
"internal_name_32",
"internal_name",
};
char *names593 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names594 [] =
{
"to_pointer",
};
char *names595 [] =
{
"to_pointer",
};
char *names596 [] =
{
"internal_name_32",
"internal_name",
};
char *names597 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names598 [] =
{
"to_pointer",
};
char *names599 [] =
{
"to_pointer",
};
char *names600 [] =
{
"internal_name_32",
"internal_name",
};
char *names601 [] =
{
"content",
"keys",
"indexes_map",
"deleted_marks",
"object_comparison",
"hash_table_version_64",
"has_default",
"found_item",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"ht_deleted_item",
"ht_deleted_key",
"count",
};
char *names602 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"iteration_position",
};
char *names605 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names606 [] =
{
"to_pointer",
};
char *names607 [] =
{
"to_pointer",
};
char *names608 [] =
{
"internal_name_32",
"internal_name",
};
char *names609 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names610 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names611 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names612 [] =
{
"to_pointer",
};
char *names613 [] =
{
"to_pointer",
};
char *names614 [] =
{
"internal_name_32",
"internal_name",
};
char *names615 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names622 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names624 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names625 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names626 [] =
{
"internal_name_32",
"internal_name",
};
char *names627 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names628 [] =
{
"object_comparison",
};
char *names629 [] =
{
"object_comparison",
};
char *names630 [] =
{
"object_comparison",
};
char *names631 [] =
{
"object_comparison",
};
char *names632 [] =
{
"object_comparison",
};
char *names633 [] =
{
"object_comparison",
};
char *names634 [] =
{
"object_comparison",
};
char *names635 [] =
{
"object_comparison",
};
char *names636 [] =
{
"object_comparison",
};
char *names637 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names638 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names639 [] =
{
"object_comparison",
};
char *names640 [] =
{
"object_comparison",
};
char *names641 [] =
{
"object_comparison",
};
char *names642 [] =
{
"object_comparison",
};
char *names643 [] =
{
"object_comparison",
};
char *names644 [] =
{
"object_comparison",
};
char *names645 [] =
{
"object_comparison",
};
char *names646 [] =
{
"object_comparison",
};
char *names647 [] =
{
"object_comparison",
};
char *names648 [] =
{
"object_comparison",
};
char *names649 [] =
{
"object_comparison",
};
char *names650 [] =
{
"area",
};
char *names651 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names658 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names660 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names661 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names662 [] =
{
"internal_name_32",
"internal_name",
};
char *names663 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names664 [] =
{
"object_comparison",
};
char *names665 [] =
{
"object_comparison",
};
char *names666 [] =
{
"object_comparison",
};
char *names667 [] =
{
"object_comparison",
};
char *names668 [] =
{
"object_comparison",
};
char *names669 [] =
{
"object_comparison",
};
char *names670 [] =
{
"object_comparison",
};
char *names671 [] =
{
"object_comparison",
};
char *names672 [] =
{
"object_comparison",
};
char *names673 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names674 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names675 [] =
{
"object_comparison",
};
char *names676 [] =
{
"object_comparison",
};
char *names677 [] =
{
"object_comparison",
};
char *names678 [] =
{
"object_comparison",
};
char *names679 [] =
{
"object_comparison",
};
char *names680 [] =
{
"object_comparison",
};
char *names681 [] =
{
"object_comparison",
};
char *names682 [] =
{
"object_comparison",
};
char *names683 [] =
{
"object_comparison",
};
char *names684 [] =
{
"object_comparison",
};
char *names685 [] =
{
"object_comparison",
};
char *names686 [] =
{
"area",
};
char *names687 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names694 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names696 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names697 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names698 [] =
{
"internal_name_32",
"internal_name",
};
char *names699 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names700 [] =
{
"object_comparison",
};
char *names701 [] =
{
"object_comparison",
};
char *names702 [] =
{
"object_comparison",
};
char *names703 [] =
{
"object_comparison",
};
char *names704 [] =
{
"object_comparison",
};
char *names705 [] =
{
"object_comparison",
};
char *names706 [] =
{
"object_comparison",
};
char *names707 [] =
{
"object_comparison",
};
char *names708 [] =
{
"object_comparison",
};
char *names709 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names710 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names711 [] =
{
"object_comparison",
};
char *names712 [] =
{
"object_comparison",
};
char *names713 [] =
{
"object_comparison",
};
char *names714 [] =
{
"object_comparison",
};
char *names715 [] =
{
"object_comparison",
};
char *names716 [] =
{
"object_comparison",
};
char *names717 [] =
{
"object_comparison",
};
char *names718 [] =
{
"object_comparison",
};
char *names719 [] =
{
"object_comparison",
};
char *names720 [] =
{
"object_comparison",
};
char *names721 [] =
{
"object_comparison",
};
char *names722 [] =
{
"area",
};
char *names723 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names726 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names727 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names728 [] =
{
"internal_name_32",
"internal_name",
};
char *names729 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names730 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names731 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names732 [] =
{
"object_comparison",
};
char *names733 [] =
{
"object_comparison",
};
char *names734 [] =
{
"object_comparison",
};
char *names735 [] =
{
"object_comparison",
};
char *names736 [] =
{
"object_comparison",
};
char *names737 [] =
{
"object_comparison",
};
char *names738 [] =
{
"object_comparison",
};
char *names739 [] =
{
"object_comparison",
};
char *names740 [] =
{
"object_comparison",
};
char *names741 [] =
{
"object_comparison",
};
char *names742 [] =
{
"object_comparison",
};
char *names743 [] =
{
"area",
};
char *names744 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names745 [] =
{
"internal_name_32",
"internal_name",
};
char *names752 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names754 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names755 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names756 [] =
{
"internal_name_32",
"internal_name",
};
char *names757 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names758 [] =
{
"object_comparison",
};
char *names759 [] =
{
"object_comparison",
};
char *names760 [] =
{
"object_comparison",
};
char *names761 [] =
{
"object_comparison",
};
char *names762 [] =
{
"object_comparison",
};
char *names763 [] =
{
"object_comparison",
};
char *names764 [] =
{
"object_comparison",
};
char *names765 [] =
{
"object_comparison",
};
char *names766 [] =
{
"object_comparison",
};
char *names767 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names768 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names769 [] =
{
"object_comparison",
};
char *names770 [] =
{
"object_comparison",
};
char *names771 [] =
{
"object_comparison",
};
char *names772 [] =
{
"object_comparison",
};
char *names773 [] =
{
"object_comparison",
};
char *names774 [] =
{
"object_comparison",
};
char *names775 [] =
{
"object_comparison",
};
char *names776 [] =
{
"object_comparison",
};
char *names777 [] =
{
"object_comparison",
};
char *names778 [] =
{
"object_comparison",
};
char *names779 [] =
{
"object_comparison",
};
char *names780 [] =
{
"area",
};
char *names781 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names782 [] =
{
"item",
};
char *names789 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names791 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names792 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names793 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names794 [] =
{
"object_comparison",
};
char *names795 [] =
{
"object_comparison",
};
char *names796 [] =
{
"object_comparison",
};
char *names797 [] =
{
"object_comparison",
};
char *names798 [] =
{
"object_comparison",
};
char *names799 [] =
{
"object_comparison",
};
char *names800 [] =
{
"object_comparison",
};
char *names801 [] =
{
"object_comparison",
};
char *names802 [] =
{
"object_comparison",
};
char *names803 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names804 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names805 [] =
{
"object_comparison",
};
char *names806 [] =
{
"object_comparison",
};
char *names807 [] =
{
"object_comparison",
};
char *names808 [] =
{
"object_comparison",
};
char *names809 [] =
{
"object_comparison",
};
char *names810 [] =
{
"object_comparison",
};
char *names811 [] =
{
"object_comparison",
};
char *names812 [] =
{
"object_comparison",
};
char *names813 [] =
{
"object_comparison",
};
char *names814 [] =
{
"object_comparison",
};
char *names815 [] =
{
"object_comparison",
};
char *names816 [] =
{
"area",
};
char *names817 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names818 [] =
{
"operands",
"closed_operands",
"open_map",
"open_types",
"last_result",
"is_target_closed",
"is_basic",
"open_count",
"routine_id",
"written_type_id_inline_agent",
"rout_disp",
"calc_rout_addr",
"encaps_rout_disp",
};
char *names819 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names820 [] =
{
"to_pointer",
};
char *names821 [] =
{
"to_pointer",
};
char *names822 [] =
{
"internal_name_32",
"internal_name",
};
char *names823 [] =
{
"object_comparison",
"index",
};
char *names824 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names825 [] =
{
"target",
"active",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names826 [] =
{
"right",
"item",
};
char *names827 [] =
{
"active",
"after",
"before",
};
char *names828 [] =
{
"object_comparison",
};
char *names829 [] =
{
"object_comparison",
};
char *names830 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names831 [] =
{
"object_comparison",
};
char *names832 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names833 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names834 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names835 [] =
{
"to_pointer",
};
char *names836 [] =
{
"to_pointer",
};
char *names837 [] =
{
"internal_name_32",
"internal_name",
};
char *names838 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names839 [] =
{
"to_pointer",
};
char *names840 [] =
{
"to_pointer",
};
char *names841 [] =
{
"internal_name_32",
"internal_name",
};
char *names842 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names843 [] =
{
"breakable_info",
"object",
"rt_type",
"offset",
"type",
"value",
};
char *names844 [] =
{
"to_pointer",
};
char *names845 [] =
{
"to_pointer",
};
char *names846 [] =
{
"internal_name_32",
"internal_name",
};
char *names847 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names848 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names849 [] =
{
"breakable_info",
"object",
"value",
"rt_type",
"offset",
"type",
};
char *names856 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names858 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names859 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names860 [] =
{
"internal_name_32",
"internal_name",
};
char *names861 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names862 [] =
{
"object_comparison",
};
char *names863 [] =
{
"object_comparison",
};
char *names864 [] =
{
"object_comparison",
};
char *names865 [] =
{
"object_comparison",
};
char *names866 [] =
{
"object_comparison",
};
char *names867 [] =
{
"object_comparison",
};
char *names868 [] =
{
"object_comparison",
};
char *names869 [] =
{
"object_comparison",
};
char *names870 [] =
{
"object_comparison",
};
char *names871 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names872 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names873 [] =
{
"object_comparison",
};
char *names874 [] =
{
"object_comparison",
};
char *names875 [] =
{
"object_comparison",
};
char *names876 [] =
{
"object_comparison",
};
char *names877 [] =
{
"object_comparison",
};
char *names878 [] =
{
"object_comparison",
};
char *names879 [] =
{
"object_comparison",
};
char *names880 [] =
{
"object_comparison",
};
char *names881 [] =
{
"object_comparison",
};
char *names882 [] =
{
"object_comparison",
};
char *names883 [] =
{
"object_comparison",
};
char *names884 [] =
{
"area",
};
char *names885 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names886 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"iteration_position",
};
char *names887 [] =
{
"content",
"keys",
"indexes_map",
"deleted_marks",
"object_comparison",
"hash_table_version_64",
"has_default",
"found_item",
"ht_deleted_item",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"count",
"ht_deleted_key",
};
char *names888 [] =
{
"object_comparison",
};
char *names891 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names892 [] =
{
"active",
"after",
"before",
};
char *names893 [] =
{
"right",
"item",
};
char *names894 [] =
{
"item",
};
char *names895 [] =
{
"object_comparison",
};
char *names896 [] =
{
"object_comparison",
};
char *names897 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names898 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names899 [] =
{
"target",
"active",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names900 [] =
{
"operands",
"closed_operands",
"open_map",
"open_types",
"is_target_closed",
"is_basic",
"last_result",
"open_count",
"routine_id",
"written_type_id_inline_agent",
"rout_disp",
"calc_rout_addr",
"encaps_rout_disp",
};
char *names901 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names902 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names903 [] =
{
"object_comparison",
};
char *names904 [] =
{
"object_comparison",
};
char *names905 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names906 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names907 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names908 [] =
{
"area_v2",
"object_comparison",
"index",
};
char *names909 [] =
{
"area",
"object_comparison",
"upper",
"lower",
};
char *names911 [] =
{
"object_comparison",
};
char *names912 [] =
{
"object_comparison",
};
char *names913 [] =
{
"internal_name_32",
"internal_name",
};
char *names914 [] =
{
"area",
"target",
"area_index",
"area_last_index",
"first_index",
};
char *names916 [] =
{
"target",
"area_index",
"area_last_index",
};
char *names917 [] =
{
"area",
"area_index",
"area_last_index",
};
char *names918 [] =
{
"area",
};
char *names919 [] =
{
"area",
"target",
"area_index",
"area_last_index",
};
char *names920 [] =
{
"object_comparison",
};
char *names921 [] =
{
"object_comparison",
};
char *names922 [] =
{
"object_comparison",
};
char *names923 [] =
{
"object_comparison",
};
char *names924 [] =
{
"object_comparison",
};
char *names925 [] =
{
"object_comparison",
};
char *names926 [] =
{
"object_comparison",
};
char *names927 [] =
{
"item",
};
char *names928 [] =
{
"found_item",
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_item",
"ht_deleted_key",
"object_comparison",
"hash_table_version_64",
"has_default",
"is_case_insensitive",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"count",
};
char *names929 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names930 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names931 [] =
{
"target",
"active",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"target_index",
};
char *names932 [] =
{
"item",
"right",
};
char *names933 [] =
{
"active",
"after",
"before",
};
char *names934 [] =
{
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_key",
"object_comparison",
"hash_table_version_64",
"has_default",
"is_case_insensitive",
"found_item",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"ht_deleted_item",
"count",
};
char *names935 [] =
{
"target",
"is_reversed",
"version",
"step",
"last_index",
"first_index",
"iteration_position",
};
char *names936 [] =
{
"content",
"keys",
"indexes_map",
"deleted_marks",
"ht_deleted_key",
"object_comparison",
"hash_table_version_64",
"has_default",
"found_item",
"capacity",
"item_position",
"iteration_position",
"control",
"deleted_item_position",
"ht_lowest_deleted_position",
"ht_deleted_item",
"count",
};
char *names937 [] =
{
"object_comparison",
};
char *names940 [] =
{
"area_v2",
"is_aborted_stack_internal",
"call_buffer_internal",
"name_internal",
"event_data_names_internal",
"dummy_event_data_internal",
"kamikazes_internal",
"not_empty_actions_internal",
"empty_actions_internal",
"object_comparison",
"in_operation",
"index",
"state",
};
char *names941 [] =
{
"first_element",
"active",
"object_comparison",
"before",
"after",
"count",
};
char *names942 [] =
{
"area_v2",
"object_comparison",
"in_operation",
"index",
};
char *names943 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names944 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names945 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names946 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names947 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names948 [] =
{
"breakable_info",
"object",
"value",
"index",
"type",
};
char *names949 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names950 [] =
{
"object_comparison",
};
char *names951 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names952 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names953 [] =
{
"breakable_info",
"value",
"rt_type",
"position",
"type",
"callstack_depth",
};
char *names954 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names955 [] =
{
"breakable_info",
"object",
"index",
"type",
"value",
};
char *names956 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"callstack_depth",
"value",
};
char *names957 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"callstack_depth",
"value",
};
char *names958 [] =
{
"item",
};
char *names959 [] =
{
"breakable_info",
"rt_type",
"position",
"type",
"callstack_depth",
"value",
};
#ifdef __cplusplus
}
#endif
|
the_stack_data/90982.c | /* { dg-do compile } */
/* { dg-options "-O2 -fdump-rtl-expand-details" } */
float total = 0.2;
void foo(int n)
{
int i;
for (i = 0; i < n; i++)
total += i;
}
/* Verify that out-of-ssa coalescing did its job by verifying there are not
any partition copies inserted. */
/* { dg-final { scan-rtl-dump-not "partition copy" "expand"} } */
|
the_stack_data/110337.c | /*
* Copyright (c) 2007 - 2015 Joseph Gaeddert
*
* 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.
*/
//
// firfilt_crcf_data_h7x16.c: autotest firfilt data
//
#include <complex.h>
float firfilt_crcf_data_h7x16_h[] = {
0.027835212534,
-0.040645664069,
-0.095885554580,
0.200974194416,
0.142773900141,
-0.084839081860,
0.026675441534};
float complex firfilt_crcf_data_h7x16_x[] = {
-0.050554619430 + -0.051932459243*_Complex_I,
0.033654160787 + 0.041969310283*_Complex_I,
0.083110727700 + 0.078162488859*_Complex_I,
-0.077891200631 + -0.098321707426*_Complex_I,
-0.187861386260 + -0.107086777579*_Complex_I,
-0.151977015997 + 0.027468572824*_Complex_I,
0.081513596724 + 0.062785557274*_Complex_I,
0.031782625481 + -0.013462505188*_Complex_I,
-0.007610286404 + 0.087544934055*_Complex_I,
0.155881117469 + 0.110195135092*_Complex_I,
-0.104429397916 + 0.137400420010*_Complex_I,
-0.116176549274 + 0.071085593565*_Complex_I,
-0.164136953851 + 0.202903767828*_Complex_I,
0.084667802512 + 0.059492856539*_Complex_I,
0.026416620904 + 0.138990393077*_Complex_I,
-0.116423582608 + -0.028759261678*_Complex_I};
float complex firfilt_crcf_data_h7x16_y[] = {
-0.001407198576 + -0.001445551040*_Complex_I,
0.002991596797 + 0.003279053964*_Complex_I,
0.005792966776 + 0.005449371658*_Complex_I,
-0.018933330628 + -0.020375106640*_Complex_I,
-0.010486602589 + -0.005458937140*_Complex_I,
0.036671134061 + 0.040651505702*_Complex_I,
0.018467514775 + -0.002647275592*_Complex_I,
-0.042885517171 + -0.046631668104*_Complex_I,
-0.057859564144 + -0.002378383977*_Complex_I,
0.010144797998 + 0.023802283800*_Complex_I,
0.017394817258 + -0.007977151925*_Complex_I,
-0.021897278604 + -0.003093924849*_Complex_I,
0.039886090889 + 0.027046322091*_Complex_I,
0.022929460881 + 0.022153334200*_Complex_I,
-0.038653803420 + 0.008885169596*_Complex_I,
-0.048989194709 + 0.030055784593*_Complex_I};
|
the_stack_data/18686.c | int de;
int d = 6;
int a = 4, b = 9;
int f(){
de = 3;
return d + de + a + b;
}
|
the_stack_data/137471.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gnl_tester.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mchardin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/22 17:41:13 by mchardin #+# #+# */
/* Updated: 2019/12/15 17:19:49 by mchardin ### ########.fr */
/* */
/* ************************************************************************** */
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int get_next_line(int fd, char **line);
int main()
{
int fd;
int i;
int j;
char *line = 0;
char *lineadress[66];
j = 1;
printf("\n==========================================\n");
printf("========== TEST 1 : The Alphabet =========\n");
printf("==========================================\n\n");
if (!(fd = open("files/alphabet", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
lineadress[j - 1] = line;
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 66)
printf("\nRight number of lines\n");
else if (j != 66)
printf("\nNot Good - Wrong Number Of Lines\n");
while (--j > 0)
free(lineadress[j - 1]);
j = 1;
printf("\n==========================================\n");
printf("========= TEST 2 : Empty Lines ===========\n");
printf("==========================================\n\n");
if (!(fd = open("files/empty_lines", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 9)
printf("\nRight number of lines\n");
else if (j != 9)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("======== TEST 3 : The Empty File =========\n");
printf("==========================================\n\n");
if (!(fd = open("files/empty_file", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 1)
printf("\nRight number of lines\n");
else if (j != 1)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("========= TEST 4 : One New Line ==========\n");
printf("==========================================\n\n");
if (!(fd = open("files/1_newline", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 2)
printf("\nRight number of lines\n");
else if (j != 2)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("========= TEST 5 : Four New Lines ========\n");
printf("==========================================\n\n");
if (!(fd = open("files/4_newlines", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 5)
printf("\nRight number of lines\n");
else if (j != 5)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("============== TEST 6 : 42 ===============\n");
printf("==========================================\n\n");
if (!(fd = open("files/41_char", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (!(fd = open("files/42_char", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (!(fd = open("files/43_char", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("|%s\n", line);
free(line);
j++;
}
printf("|%s\n", line);
free(line);
close(fd);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 1)
printf("\nRight number of lines\n");
else if (j != 1)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("============= TEST 7 : Marge =============\n");
printf("==========================================\n\n");
int fd2;
if (!(fd = open("files/half_marge_top", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
if (!(fd2 = open("files/half_marge_bottom", O_RDONLY)))
{
printf("\nError in open\n");
return (0);
}
while ((i = get_next_line(fd, &line)) > 0)
{
printf("%s\n", line);
free(line);
j++;
}
free(line);
while ((i = get_next_line(fd2, &line)) > 0)
{
printf("%s\n", line);
free(line);
j++;
}
printf("%s\n", line);
free(line);
close(fd);
close(fd2);
if (i == -1)
printf ("\nError in Fonction - Returned -1\n");
else if (j == 25)
printf("\nRight number of lines\n");
else if (j != 25)
printf("\nNot Good - Wrong Number Of Lines\n");
j = 1;
printf("\n==========================================\n");
printf("========= TEST 8 : Wrong Input ===========\n");
printf("==========================================\n\n");
if (get_next_line(180, &line) == -1)
printf("Well Done, you return -1 if no FD\n\n");
else
printf("Not Good, you don't return -1 if no FD\n\n");
return (0);
}
|
the_stack_data/103264353.c | #include <stdio.h>
#include <stdlib.h>
/**
* This stores the total number of books in each shelf.
*/
int *total_number_of_books;
/**
* This stores the total number of pages in each book of each shelf. The rows represent the shelves and the columns
* represent the books.
*/
int **total_number_of_pages;
int main() {
int total_number_of_shelves;
scanf("%d", &total_number_of_shelves);
// initialize the number of books per shelf to 0
total_number_of_books = calloc(total_number_of_shelves, sizeof(int));
// initialize the number of pages per book per shelf to NULL pointers
total_number_of_pages = calloc(total_number_of_shelves, sizeof(int *));
int total_number_of_queries;
scanf("%d", &total_number_of_queries);
while (total_number_of_queries--) {
int type_of_query;
scanf("%d", &type_of_query);
if (type_of_query == 1) {
int x, y;
scanf("%d %d", &x, &y);
total_number_of_books[x] += 1;
if (total_number_of_books[x] == 1) {
total_number_of_pages[x] = malloc(1 * sizeof(int));
}
else {
total_number_of_pages[x] = realloc(total_number_of_pages[x], total_number_of_books[x] * sizeof(int));
}
if (!total_number_of_pages[x]) {
printf("Memory allocation failed!\n");
exit(1);
}
total_number_of_pages[x][total_number_of_books[x] - 1] = y;
}
else if (type_of_query == 2) {
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", *(*(total_number_of_pages + x) + y));
}
else {
int x;
scanf("%d", &x);
printf("%d\n", *(total_number_of_books + x));
}
}
if (total_number_of_books) {
free(total_number_of_books);
}
for (int i = 0; i < total_number_of_shelves; i++) {
if (*(total_number_of_pages + i)) {
free(*(total_number_of_pages + i));
}
}
if (total_number_of_pages) {
free(total_number_of_pages);
}
return 0;
}
|
the_stack_data/350165.c | #include <ncurses.h>
int main(void)
{
int c,y,x,cmax;
initscr();
getmaxyx(stdscr,y,x);
cmax = (x * y) / 5;
for(c=0;c<cmax;c++) addstr("blah ");
refresh();
getchar();
erase(); /* clear the screen */
refresh(); /* don't forget this! */
getchar();
endwin();
return 0;
}
|
the_stack_data/746801.c | /* Generate assembler source containing symbol information
*
* Copyright 2002 by Kai Germaschewski
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
* Usage: nm -n vmlinux | scripts/kallsyms [--all-symbols] > symbols.S
*
* Table compression uses all the unused char codes on the symbols and
* maps these to the most used substrings (tokens). For instance, it might
* map char code 0xF7 to represent "write_" and then in every symbol where
* "write_" appears it can be replaced by 0xF7, saving 5 bytes.
* The used codes themselves are also placed in the table so that the
* decompresion can work without "special cases".
* Applied to kernel symbols, this usually produces a compression ratio
* of about 50%.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#endif
#define KSYM_NAME_LEN 128
struct sym_entry {
unsigned long long addr;
unsigned int len;
unsigned int start_pos;
unsigned char *sym;
};
struct text_range {
const char *stext, *etext;
unsigned long long start, end;
};
static unsigned long long _text;
static struct text_range text_ranges[] = {
{ "_stext", "_etext" },
{ "_sinittext", "_einittext" },
{ "_stext_l1", "_etext_l1" }, /* Blackfin on-chip L1 inst SRAM */
{ "_stext_l2", "_etext_l2" }, /* Blackfin on-chip L2 SRAM */
};
#define text_range_text (&text_ranges[0])
#define text_range_inittext (&text_ranges[1])
static struct sym_entry *table;
static unsigned int table_size, table_cnt;
static int all_symbols = 0;
static char symbol_prefix_char = '\0';
int token_profit[0x10000];
/* the table that holds the result of the compression */
unsigned char best_table[256][2];
unsigned char best_table_len[256];
static void usage(void)
{
fprintf(stderr, "Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] < in.map > out.S\n");
exit(1);
}
/*
* This ignores the intensely annoying "mapping symbols" found
* in ARM ELF files: $a, $t and $d.
*/
static inline int is_arm_mapping_symbol(const char *str)
{
return str[0] == '$' && strchr("atd", str[1])
&& (str[2] == '\0' || str[2] == '.');
}
static int read_symbol_tr(const char *sym, unsigned long long addr)
{
size_t i;
struct text_range *tr;
for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) {
tr = &text_ranges[i];
if (strcmp(sym, tr->stext) == 0) {
tr->start = addr;
return 0;
} else if (strcmp(sym, tr->etext) == 0) {
tr->end = addr;
return 0;
}
}
return 1;
}
static int read_symbol(FILE *in, struct sym_entry *s)
{
char str[500];
char *sym, stype;
int rc;
rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
if (rc != 3) {
if (rc != EOF && fgets(str, 500, in) == NULL)
fprintf(stderr, "Read error or end of file.\n");
return -1;
}
sym = str;
/* skip prefix char */
if (symbol_prefix_char && str[0] == symbol_prefix_char)
sym++;
/* Ignore most absolute/undefined (?) symbols. */
if (strcmp(sym, "_text") == 0)
_text = s->addr;
else if (read_symbol_tr(sym, s->addr) == 0)
/* nothing to do */;
else if (toupper(stype) == 'A')
{
/* Keep these useful absolute symbols */
if (strcmp(sym, "__kernel_syscall_via_break") &&
strcmp(sym, "__kernel_syscall_via_epc") &&
strcmp(sym, "__kernel_sigtramp") &&
strcmp(sym, "__gp"))
return -1;
}
else if (toupper(stype) == 'U' ||
is_arm_mapping_symbol(sym))
return -1;
/* exclude also MIPS ELF local symbols ($L123 instead of .L123) */
else if (str[0] == '$')
return -1;
/* exclude debugging symbols */
else if (stype == 'N')
return -1;
/* include the type field in the symbol name, so that it gets
* compressed together */
s->len = strlen(str) + 1;
s->sym = malloc(s->len + 1);
if (!s->sym) {
fprintf(stderr, "kallsyms failure: "
"unable to allocate required amount of memory\n");
exit(EXIT_FAILURE);
}
strcpy((char *)s->sym + 1, str);
s->sym[0] = stype;
return 0;
}
static int symbol_valid_tr(struct sym_entry *s)
{
size_t i;
struct text_range *tr;
for (i = 0; i < ARRAY_SIZE(text_ranges); ++i) {
tr = &text_ranges[i];
if (s->addr >= tr->start && s->addr <= tr->end)
return 1;
}
return 0;
}
static int symbol_valid(struct sym_entry *s)
{
/* Symbols which vary between passes. Passes 1 and 2 must have
* identical symbol lists. The kallsyms_* symbols below are only added
* after pass 1, they would be included in pass 2 when --all-symbols is
* specified so exclude them to get a stable symbol list.
*/
static char *special_symbols[] = {
"kallsyms_addresses",
"kallsyms_num_syms",
"kallsyms_names",
"kallsyms_markers",
"kallsyms_token_table",
"kallsyms_token_index",
/* Exclude linker generated symbols which vary between passes */
"_SDA_BASE_", /* ppc */
"_SDA2_BASE_", /* ppc */
NULL };
int i;
int offset = 1;
/* skip prefix char */
if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char)
offset++;
/* if --all-symbols is not specified, then symbols outside the text
* and inittext sections are discarded */
if (!all_symbols) {
if (symbol_valid_tr(s) == 0)
return 0;
/* Corner case. Discard any symbols with the same value as
* _etext _einittext; they can move between pass 1 and 2 when
* the kallsyms data are added. If these symbols move then
* they may get dropped in pass 2, which breaks the kallsyms
* rules.
*/
if ((s->addr == text_range_text->end &&
strcmp((char *)s->sym + offset, text_range_text->etext)) ||
(s->addr == text_range_inittext->end &&
strcmp((char *)s->sym + offset, text_range_inittext->etext)))
return 0;
}
/* Exclude symbols which vary between passes. */
if (strstr((char *)s->sym + offset, "_compiled."))
return 0;
for (i = 0; special_symbols[i]; i++)
if( strcmp((char *)s->sym + offset, special_symbols[i]) == 0 )
return 0;
return 1;
}
static void read_map(FILE *in)
{
while (!feof(in)) {
if (table_cnt >= table_size) {
table_size += 10000;
table = realloc(table, sizeof(*table) * table_size);
if (!table) {
fprintf(stderr, "out of memory\n");
exit (1);
}
}
if (read_symbol(in, &table[table_cnt]) == 0) {
table[table_cnt].start_pos = table_cnt;
table_cnt++;
}
}
}
static void output_label(char *label)
{
if (symbol_prefix_char)
printf(".globl %c%s\n", symbol_prefix_char, label);
else
printf(".globl %s\n", label);
printf("\tALGN\n");
if (symbol_prefix_char)
printf("%c%s:\n", symbol_prefix_char, label);
else
printf("%s:\n", label);
}
/* uncompress a compressed symbol. When this function is called, the best table
* might still be compressed itself, so the function needs to be recursive */
static int expand_symbol(unsigned char *data, int len, char *result)
{
int c, rlen, total=0;
while (len) {
c = *data;
/* if the table holds a single char that is the same as the one
* we are looking for, then end the search */
if (best_table[c][0]==c && best_table_len[c]==1) {
*result++ = c;
total++;
} else {
/* if not, recurse and expand */
rlen = expand_symbol(best_table[c], best_table_len[c], result);
total += rlen;
result += rlen;
}
data++;
len--;
}
*result=0;
return total;
}
static void write_src(void)
{
unsigned int i, k, off;
unsigned int best_idx[256];
unsigned int *markers;
char buf[KSYM_NAME_LEN];
printf("#include <asm/types.h>\n");
printf("#if BITS_PER_LONG == 64\n");
printf("#define PTR .quad\n");
printf("#define ALGN .align 8\n");
printf("#else\n");
printf("#define PTR .long\n");
printf("#define ALGN .align 4\n");
printf("#endif\n");
printf("\t.section .rodata, \"a\"\n");
/* Provide proper symbols relocatability by their '_text'
* relativeness. The symbol names cannot be used to construct
* normal symbol references as the list of symbols contains
* symbols that are declared static and are private to their
* .o files. This prevents .tmp_kallsyms.o or any other
* object from referencing them.
*/
output_label("kallsyms_addresses");
for (i = 0; i < table_cnt; i++) {
if (toupper(table[i].sym[0]) != 'A') {
if (_text <= table[i].addr)
printf("\tPTR\t_text + %#llx\n",
table[i].addr - _text);
else
printf("\tPTR\t_text - %#llx\n",
_text - table[i].addr);
} else {
printf("\tPTR\t%#llx\n", table[i].addr);
}
}
printf("\n");
output_label("kallsyms_num_syms");
printf("\tPTR\t%d\n", table_cnt);
printf("\n");
/* table of offset markers, that give the offset in the compressed stream
* every 256 symbols */
markers = malloc(sizeof(unsigned int) * ((table_cnt + 255) / 256));
if (!markers) {
fprintf(stderr, "kallsyms failure: "
"unable to allocate required memory\n");
exit(EXIT_FAILURE);
}
output_label("kallsyms_names");
off = 0;
for (i = 0; i < table_cnt; i++) {
if ((i & 0xFF) == 0)
markers[i >> 8] = off;
printf("\t.byte 0x%02x", table[i].len);
for (k = 0; k < table[i].len; k++)
printf(", 0x%02x", table[i].sym[k]);
printf("\n");
off += table[i].len + 1;
}
printf("\n");
output_label("kallsyms_markers");
for (i = 0; i < ((table_cnt + 255) >> 8); i++)
printf("\tPTR\t%d\n", markers[i]);
printf("\n");
free(markers);
output_label("kallsyms_token_table");
off = 0;
for (i = 0; i < 256; i++) {
best_idx[i] = off;
expand_symbol(best_table[i], best_table_len[i], buf);
printf("\t.asciz\t\"%s\"\n", buf);
off += strlen(buf) + 1;
}
printf("\n");
output_label("kallsyms_token_index");
for (i = 0; i < 256; i++)
printf("\t.short\t%d\n", best_idx[i]);
printf("\n");
}
/* table lookup compression functions */
/* count all the possible tokens in a symbol */
static void learn_symbol(unsigned char *symbol, int len)
{
int i;
for (i = 0; i < len - 1; i++)
token_profit[ symbol[i] + (symbol[i + 1] << 8) ]++;
}
/* decrease the count for all the possible tokens in a symbol */
static void forget_symbol(unsigned char *symbol, int len)
{
int i;
for (i = 0; i < len - 1; i++)
token_profit[ symbol[i] + (symbol[i + 1] << 8) ]--;
}
/* remove all the invalid symbols from the table and do the initial token count */
static void build_initial_tok_table(void)
{
unsigned int i, pos;
pos = 0;
for (i = 0; i < table_cnt; i++) {
if ( symbol_valid(&table[i]) ) {
if (pos != i)
table[pos] = table[i];
learn_symbol(table[pos].sym, table[pos].len);
pos++;
}
}
table_cnt = pos;
}
static void *find_token(unsigned char *str, int len, unsigned char *token)
{
int i;
for (i = 0; i < len - 1; i++) {
if (str[i] == token[0] && str[i+1] == token[1])
return &str[i];
}
return NULL;
}
/* replace a given token in all the valid symbols. Use the sampled symbols
* to update the counts */
static void compress_symbols(unsigned char *str, int idx)
{
unsigned int i, len, size;
unsigned char *p1, *p2;
for (i = 0; i < table_cnt; i++) {
len = table[i].len;
p1 = table[i].sym;
/* find the token on the symbol */
p2 = find_token(p1, len, str);
if (!p2) continue;
/* decrease the counts for this symbol's tokens */
forget_symbol(table[i].sym, len);
size = len;
do {
*p2 = idx;
p2++;
size -= (p2 - p1);
memmove(p2, p2 + 1, size);
p1 = p2;
len--;
if (size < 2) break;
/* find the token on the symbol */
p2 = find_token(p1, size, str);
} while (p2);
table[i].len = len;
/* increase the counts for this symbol's new tokens */
learn_symbol(table[i].sym, len);
}
}
/* search the token with the maximum profit */
static int find_best_token(void)
{
int i, best, bestprofit;
bestprofit=-10000;
best = 0;
for (i = 0; i < 0x10000; i++) {
if (token_profit[i] > bestprofit) {
best = i;
bestprofit = token_profit[i];
}
}
return best;
}
/* this is the core of the algorithm: calculate the "best" table */
static void optimize_result(void)
{
int i, best;
/* using the '\0' symbol last allows compress_symbols to use standard
* fast string functions */
for (i = 255; i >= 0; i--) {
/* if this table slot is empty (it is not used by an actual
* original char code */
if (!best_table_len[i]) {
/* find the token with the breates profit value */
best = find_best_token();
if (token_profit[best] == 0)
break;
/* place it in the "best" table */
best_table_len[i] = 2;
best_table[i][0] = best & 0xFF;
best_table[i][1] = (best >> 8) & 0xFF;
/* replace this token in all the valid symbols */
compress_symbols(best_table[i], i);
}
}
}
/* start by placing the symbols that are actually used on the table */
static void insert_real_symbols_in_table(void)
{
unsigned int i, j, c;
memset(best_table, 0, sizeof(best_table));
memset(best_table_len, 0, sizeof(best_table_len));
for (i = 0; i < table_cnt; i++) {
for (j = 0; j < table[i].len; j++) {
c = table[i].sym[j];
best_table[c][0]=c;
best_table_len[c]=1;
}
}
}
static void optimize_token_table(void)
{
build_initial_tok_table();
insert_real_symbols_in_table();
/* When valid symbol is not registered, exit to error */
if (!table_cnt) {
fprintf(stderr, "No valid symbol.\n");
exit(1);
}
optimize_result();
}
/* guess for "linker script provide" symbol */
static int may_be_linker_script_provide_symbol(const struct sym_entry *se)
{
const char *symbol = (char *)se->sym + 1;
int len = se->len - 1;
if (len < 8)
return 0;
if (symbol[0] != '_' || symbol[1] != '_')
return 0;
/* __start_XXXXX */
if (!memcmp(symbol + 2, "start_", 6))
return 1;
/* __stop_XXXXX */
if (!memcmp(symbol + 2, "stop_", 5))
return 1;
/* __end_XXXXX */
if (!memcmp(symbol + 2, "end_", 4))
return 1;
/* __XXXXX_start */
if (!memcmp(symbol + len - 6, "_start", 6))
return 1;
/* __XXXXX_end */
if (!memcmp(symbol + len - 4, "_end", 4))
return 1;
return 0;
}
static int prefix_underscores_count(const char *str)
{
const char *tail = str;
while (*tail == '_')
tail++;
return tail - str;
}
static int compare_symbols(const void *a, const void *b)
{
const struct sym_entry *sa;
const struct sym_entry *sb;
int wa, wb;
sa = a;
sb = b;
/* sort by address first */
if (sa->addr > sb->addr)
return 1;
if (sa->addr < sb->addr)
return -1;
/* sort by "weakness" type */
wa = (sa->sym[0] == 'w') || (sa->sym[0] == 'W');
wb = (sb->sym[0] == 'w') || (sb->sym[0] == 'W');
if (wa != wb)
return wa - wb;
/* sort by "linker script provide" type */
wa = may_be_linker_script_provide_symbol(sa);
wb = may_be_linker_script_provide_symbol(sb);
if (wa != wb)
return wa - wb;
/* sort by the number of prefix underscores */
wa = prefix_underscores_count((const char *)sa->sym + 1);
wb = prefix_underscores_count((const char *)sb->sym + 1);
if (wa != wb)
return wa - wb;
/* sort by initial order, so that other symbols are left undisturbed */
return sa->start_pos - sb->start_pos;
}
static void sort_symbols(void)
{
qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols);
}
int main(int argc, char **argv)
{
if (argc >= 2) {
int i;
for (i = 1; i < argc; i++) {
if(strcmp(argv[i], "--all-symbols") == 0)
all_symbols = 1;
else if (strncmp(argv[i], "--symbol-prefix=", 16) == 0) {
char *p = &argv[i][16];
/* skip quote */
if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\''))
p++;
symbol_prefix_char = *p;
} else
usage();
}
} else if (argc != 1)
usage();
read_map(stdin);
sort_symbols();
optimize_token_table();
write_src();
return 0;
}
|
the_stack_data/225141849.c | /*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
static int _gettemp(char*,int*);
mkstemp(path)
char *path;
{
int fd;
return (_gettemp(path, &fd) ? fd : -1);
}
char *
mktemp(path)
char *path;
{
return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
}
static
_gettemp(path, doopen)
char *path;
register int *doopen;
{
extern int errno;
register char *start, *trv;
struct stat sbuf;
u_int pid;
pid = getpid();
for (trv = path; *trv; ++trv); /* extra X's get set to 0's */
while (*--trv == 'X') {
*trv = (pid % 10) + '0';
pid /= 10;
}
/*
* check the target directory; if you have six X's and it
* doesn't exist this runs for a *very* long time.
*/
for (start = trv + 1;; --trv) {
if (trv <= path)
break;
if (*trv == '/') {
*trv = '\0';
if (stat(path, &sbuf))
return(0);
if (!S_ISDIR(sbuf.st_mode)) {
errno = ENOTDIR;
return(0);
}
*trv = '/';
break;
}
}
for (;;) {
if (doopen) {
if ((*doopen =
open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
return(1);
if (errno != EEXIST)
return(0);
}
else if (stat(path, &sbuf))
return(errno == ENOENT ? 1 : 0);
/* tricky little algorithm for backward compatibility */
for (trv = start;;) {
if (!*trv)
return(0);
if (*trv == 'z')
*trv++ = 'a';
else {
if (isdigit(*trv))
*trv = 'a';
else
++*trv;
break;
}
}
}
/*NOTREACHED*/
}
/*
* $PchId: mktemp.c,v 1.3 1995/11/20 19:10:39 philip Exp $
*/
|
the_stack_data/190767161.c | /* UNIX V7 source code: see /COPYRIGHT or www.tuhs.org for details. */
/* nice */
#include <stdio.h>
main(argc, argv)
int argc;
char *argv[];
{
int nicarg = 10;
extern errno;
extern char *sys_errlist[];
if(argc > 1 && argv[1][0] == '-') {
nicarg = atoi(&argv[1][1]);
argc--;
argv++;
}
if(argc < 2) {
fputs("usage: nice [ -n ] command\n", stderr);
exit(1);
}
nice(nicarg);
execvp(argv[1], &argv[1]);
fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]);
exit(1);
}
|
the_stack_data/21304.c | /*------------------------------------------------------------
PROGRAMACIÓN AVANZADA I HW05P04
César Magaña
[email protected]
--------------------------------------------------------------*/
#include <stdio.h>
#include <math.h>
//------------------------------------------------------------
//Ésta es la función que se va a derivar.
double F ( double x, double y ){
return x*x*y/2;
}
//------------------------------------------------------------
//Esta "función" calcula las derivadas parciales de una función y las guarda en parcialx y parcialy.
int DerivadaParcial( double x_0, double y_0, double h, double (*f)( double, double ), double *parcialx, double *parcialy ){
if ( h==0 )
return -1;
*parcialx = ((*f)(x_0+h,y_0)-(*f)(x_0-h,y_0))/(2*h);
*parcialy = ((*f)(x_0,y_0+h)-(*f)(x_0,y_0-h))/(2*h);
return 0;
}
//------------------------------------------------------------
int main (int argc, const char * argv[]) {
double x0 = 5.0;
double y0 = 3.0;
double h = 0.00000001;
double parcialx, parcialy;
if ( DerivadaParcial(x0, y0, h, &F, &parcialx, &parcialy) < 0 )
return -1;
printf("Las derivadas parciales de F( x, y ) en ( %lf,%lf ) son: ( %lf, %lf ).\n",x0,y0,parcialx, parcialy);
getchar();
return 0;
}
//------------------------------------------------------------
|
the_stack_data/148577262.c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
static char g_buf[10*2*1024*1024];
static int g_size =0;
pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
int save_image(const void* buf, int size);
int grab_image(void* buf);
int send_tcp_data(void* buf, int size);
void* worker_thread(void* pdata)
{
int size;
(void)pdata;
for(;;)
{
//grab picture
size = grab_image(g_buf);
if(size <= 0)
{
sleep(1);
continue;
}
//calculation
//send to host
send_tcp_data(g_buf, size);
}
printf("return worker\n");
return 0;
}
int init_worker_proc(void)
{
pthread_t cli;
pthread_create(&cli, NULL, worker_thread, NULL);
return 0;
}
int save_image(const void* buf, int size)
{
pthread_mutex_lock(&g_mutex);
g_size = size;
memcpy(g_buf+size, buf, size);
pthread_mutex_unlock(&g_mutex);
return 0;
}
int grab_image(void* buf)
{
pthread_mutex_lock(&g_mutex);
memcpy(buf, g_buf+g_size, g_size);
pthread_mutex_unlock(&g_mutex);
return g_size;
}
|
the_stack_data/151704343.c | /* xstrdup.c -- copy a string with out of memory checking
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
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, 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
# include <string.h>
#else
# include <strings.h>
#endif
#if defined (__STDC__) && __STDC__
char *xmalloc (size_t);
char *xstrdup (char *string);
#else
char *xmalloc ();
#endif
/* Return a newly allocated copy of STRING. */
char *
xstrdup (string)
char *string;
{
return strcpy (xmalloc (strlen (string) + 1), string);
}
|
the_stack_data/49946.c | // test way to support algebraic data types in C
#include<stdlib.h> // malloc
#include<stdio.h>
//---------------------------------------
#define declare_branch_ptr(bvar, lptr, rptr)
#define declare_branch_ptr_init(bvar, lptr, initl, rptr, initr)
// check out enum types in more detail for tags (especially
// if we have separate macros for switch cases)?
typedef struct cord_s *cord;
typedef struct nil_s {} nil_t;
typedef struct leaf_s {int datum;} leaf_t;
typedef struct branch_s {cord left; cord right;} branch_t;
// will optimise following for malloc etc
union cord_u {nil_t nil_d; leaf_t leaf_d; branch_t branch_d;};
struct cord_s {char cord_k; union cord_u cord_n;};
// XXX check return value; could have option to specify what
// malloc+free function to call - may want specialised malloc for
// ADTs. Makes determining how many tag bits we can use a bit more
// tricky (with stdlib malloc we can probably use 3)
#define safe_malloc(s) malloc(s)
// can we make #define/inline version of following easily using ","?
// (maybe marginal due to malloc call, though we might
// optimise this away for zero arity constructors)
cord
malloc_nil() {
cord c = (cord) safe_malloc(sizeof(struct cord_s));
c->cord_k = 0;
return c;
}
cord
malloc_leaf(int datum_v) {
cord c = (cord) safe_malloc(sizeof(struct cord_s));
c->cord_k = 1;
c->cord_n.leaf_d.datum = datum_v;
return c;
}
cord
malloc_branch(cord left_v, cord right_v) {
cord c = (cord) safe_malloc(sizeof(struct cord_s));
c->cord_k = 2;
c->cord_n.branch_d.left = left_v;
c->cord_n.branch_d.right = right_v;
return c;
}
// want this for optimised case where we may not call free for
// zero arity constructors
void
free_cord(cord cord_v) {
free(cord_v);
}
#define if_nil(cord_v, s1, s2) \
if (cord_v->cord_k == 0) { \
s1} else s2
#define if_leaf(cord_v, datum_v, s1, s2) \
if (cord_v->cord_k == 1) { \
int datum_v = cord_v->cord_n.leaf_d.datum; \
s1} else s2
#define if_branch(cord_v, left_v, right_v, s1, s2) \
if (cord_v->cord_k == 2) { \
cord left_v = cord_v->cord_n.branch_d.left; \
cord right_v = cord_v->cord_n.branch_d.right; \
s1} else s2
// returns sum of data in cord
// Uses iteration to avoid some recursion
int
cord_sum(cord c) {
int s = 0;
while (1) {
if_nil(c,
return s;,
if_leaf(c, d,
return d+s;,
if_branch(c, l, r,
s += cord_sum(l);
c = r;,
//else
printf("Impossible!\n");
)))
}
}
main(){
int i = 10;
// printf("Sizes: %d %d %d\n", (int)sizeof(void*), (int)sizeof(int),(int)sizeof(long));
cord c = malloc_branch(
// malloc_nil(),
malloc_branch(
malloc_leaf(42),
malloc_leaf(1)),
malloc_branch(
malloc_leaf(i),
malloc_nil()));
printf("Sum is %d\n", cord_sum(c));
// if_branch(c, l1, r1,
// if_branch(r1, l, r,
// if_leaf(l,d, printf("Datum %d\n",d);,;),
// ;),
// ;)
}
|
the_stack_data/7951471.c | /*
Copyright (c) 2011-2018 Roger Light <[email protected]>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
and Eclipse Distribution License v1.0 which accompany this distribution.
The Eclipse Public License is available at
http://www.eclipse.org/legal/epl-v10.html
and the Eclipse Distribution License is available at
http://www.eclipse.org/org/documents/edl-v10.php.
Contributors:
Roger Light - initial implementation and documentation.
*/
#if defined(WIN32) || defined(__CYGWIN__)
#include <windows.h>
#include <memory_mosq.h>
extern int run;
SERVICE_STATUS_HANDLE service_handle = 0;
static SERVICE_STATUS service_status;
int main(int argc, char *argv[]);
/* Service control callback */
void __stdcall service_handler(DWORD fdwControl)
{
switch(fdwControl){
case SERVICE_CONTROL_CONTINUE:
/* Continue from Paused state. */
break;
case SERVICE_CONTROL_PAUSE:
/* Pause service. */
break;
case SERVICE_CONTROL_SHUTDOWN:
/* System is shutting down. */
case SERVICE_CONTROL_STOP:
/* Service should stop. */
service_status.dwCurrentState = SERVICE_STOP_PENDING;
SetServiceStatus(service_handle, &service_status);
run = 0;
break;
}
}
/* Function called when started as a service. */
void __stdcall service_main(DWORD dwArgc, LPTSTR *lpszArgv)
{
char **argv;
int argc = 1;
char conf_path[MAX_PATH + 20];
int rc;
service_handle = RegisterServiceCtrlHandler("mosquitto", service_handler);
if(service_handle){
rc = GetEnvironmentVariable("MOSQUITTO_DIR", conf_path, MAX_PATH);
if(!rc || rc == MAX_PATH){
service_status.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(service_handle, &service_status);
return;
}
strcat(conf_path, "/mosquitto.conf");
argv = _mosquitto_malloc(sizeof(char *)*3);
argv[0] = "mosquitto";
argv[1] = "-c";
argv[2] = conf_path;
argc = 3;
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
service_status.dwCurrentState = SERVICE_RUNNING;
service_status.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;
service_status.dwWin32ExitCode = NO_ERROR;
service_status.dwCheckPoint = 0;
SetServiceStatus(service_handle, &service_status);
main(argc, argv);
_mosquitto_free(argv);
service_status.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(service_handle, &service_status);
}
}
void service_install(void)
{
SC_HANDLE sc_manager, svc_handle;
char exe_path[MAX_PATH + 5];
SERVICE_DESCRIPTION svc_desc;
GetModuleFileName(NULL, exe_path, MAX_PATH);
strcat(exe_path, " run");
sc_manager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if(sc_manager){
svc_handle = CreateService(sc_manager, "mosquitto", "Mosquitto Broker",
SERVICE_START | SERVICE_STOP | SERVICE_CHANGE_CONFIG,
SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
exe_path, NULL, NULL, NULL, NULL, NULL);
if(svc_handle){
svc_desc.lpDescription = "MQTT v3.1 broker";
ChangeServiceConfig2(svc_handle, SERVICE_CONFIG_DESCRIPTION, &svc_desc);
CloseServiceHandle(svc_handle);
}
CloseServiceHandle(sc_manager);
}
}
void service_uninstall(void)
{
SC_HANDLE sc_manager, svc_handle;
SERVICE_STATUS status;
sc_manager = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT);
if(sc_manager){
svc_handle = OpenService(sc_manager, "mosquitto", SERVICE_QUERY_STATUS | DELETE);
if(svc_handle){
if(QueryServiceStatus(svc_handle, &status)){
if(status.dwCurrentState == SERVICE_STOPPED){
DeleteService(svc_handle);
}
}
CloseServiceHandle(svc_handle);
}
CloseServiceHandle(sc_manager);
}
}
void service_run(void)
{
SERVICE_TABLE_ENTRY ste[] = {
{ "mosquitto", service_main },
{ NULL, NULL }
};
StartServiceCtrlDispatcher(ste);
}
#endif
|
the_stack_data/721255.c | /* { dg-do compile } */
/* { dg-options "-O1 -fno-tree-fre -fdump-tree-optimized" } */
/* Test for SRA. */
void link_error (void);
typedef struct teststruct
{
double d;
char f1;
} teststruct;
void
copystruct11 (teststruct *param)
{
static teststruct local;
param->f1 = 0;
local = *param;
if (local.f1 != 0)
link_error ();
}
/* There should be no reference to link_error. */
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail *-*-* } } } */
|
the_stack_data/1051507.c | // bucket sort, generally used for sorting floating point numbers
|
the_stack_data/46950.c | #include <stdio.h>
int redefine_add(int a, int b) {
return (a + b) * (a + b);
}
int main(int argc, char const *argv[]) {
int sum = redefine_add(21, 37);
printf("%d\n", sum);
return 0;
} |
the_stack_data/145453406.c | extern float __VERIFIER_nondet_float(void);
extern int __VERIFIER_nondet_int(void);
typedef enum {false, true} bool;
bool __VERIFIER_nondet_bool(void) {
return __VERIFIER_nondet_int() != 0;
}
int main()
{
float x_18, _x_x_18;
bool _J1308, _x__J1308;
bool _J1302, _x__J1302;
bool _EL_X_1284, _x__EL_X_1284;
float x_13, _x_x_13;
float x_3, _x_x_3;
float x_14, _x_x_14;
float x_1, _x_x_1;
float x_6, _x_x_6;
float x_7, _x_x_7;
float x_4, _x_x_4;
float x_8, _x_x_8;
float x_9, _x_x_9;
float x_10, _x_x_10;
float x_12, _x_x_12;
float x_15, _x_x_15;
float x_19, _x_x_19;
bool _EL_U_1281, _x__EL_U_1281;
bool _EL_X_1275, _x__EL_X_1275;
bool _EL_U_1283, _x__EL_U_1283;
float x_0, _x_x_0;
float x_2, _x_x_2;
float x_5, _x_x_5;
float x_11, _x_x_11;
float x_16, _x_x_16;
float x_17, _x_x_17;
int __steps_to_fair = __VERIFIER_nondet_int();
x_18 = __VERIFIER_nondet_float();
_J1308 = __VERIFIER_nondet_bool();
_J1302 = __VERIFIER_nondet_bool();
_EL_X_1284 = __VERIFIER_nondet_bool();
x_13 = __VERIFIER_nondet_float();
x_3 = __VERIFIER_nondet_float();
x_14 = __VERIFIER_nondet_float();
x_1 = __VERIFIER_nondet_float();
x_6 = __VERIFIER_nondet_float();
x_7 = __VERIFIER_nondet_float();
x_4 = __VERIFIER_nondet_float();
x_8 = __VERIFIER_nondet_float();
x_9 = __VERIFIER_nondet_float();
x_10 = __VERIFIER_nondet_float();
x_12 = __VERIFIER_nondet_float();
x_15 = __VERIFIER_nondet_float();
x_19 = __VERIFIER_nondet_float();
_EL_U_1281 = __VERIFIER_nondet_bool();
_EL_X_1275 = __VERIFIER_nondet_bool();
_EL_U_1283 = __VERIFIER_nondet_bool();
x_0 = __VERIFIER_nondet_float();
x_2 = __VERIFIER_nondet_float();
x_5 = __VERIFIER_nondet_float();
x_11 = __VERIFIER_nondet_float();
x_16 = __VERIFIER_nondet_float();
x_17 = __VERIFIER_nondet_float();
bool __ok = (1 && ((( !_EL_X_1284) && ( !_J1302)) && ( !_J1308)));
while (__steps_to_fair >= 0 && __ok) {
if ((_J1302 && _J1308)) {
__steps_to_fair = __VERIFIER_nondet_int();
} else {
__steps_to_fair--;
}
_x_x_18 = __VERIFIER_nondet_float();
_x__J1308 = __VERIFIER_nondet_bool();
_x__J1302 = __VERIFIER_nondet_bool();
_x__EL_X_1284 = __VERIFIER_nondet_bool();
_x_x_13 = __VERIFIER_nondet_float();
_x_x_3 = __VERIFIER_nondet_float();
_x_x_14 = __VERIFIER_nondet_float();
_x_x_1 = __VERIFIER_nondet_float();
_x_x_6 = __VERIFIER_nondet_float();
_x_x_7 = __VERIFIER_nondet_float();
_x_x_4 = __VERIFIER_nondet_float();
_x_x_8 = __VERIFIER_nondet_float();
_x_x_9 = __VERIFIER_nondet_float();
_x_x_10 = __VERIFIER_nondet_float();
_x_x_12 = __VERIFIER_nondet_float();
_x_x_15 = __VERIFIER_nondet_float();
_x_x_19 = __VERIFIER_nondet_float();
_x__EL_U_1281 = __VERIFIER_nondet_bool();
_x__EL_X_1275 = __VERIFIER_nondet_bool();
_x__EL_U_1283 = __VERIFIER_nondet_bool();
_x_x_0 = __VERIFIER_nondet_float();
_x_x_2 = __VERIFIER_nondet_float();
_x_x_5 = __VERIFIER_nondet_float();
_x_x_11 = __VERIFIER_nondet_float();
_x_x_16 = __VERIFIER_nondet_float();
_x_x_17 = __VERIFIER_nondet_float();
__ok = ((((((((((((((((((((((((x_18 + (-1.0 * _x_x_0)) <= -1.0) && (((x_17 + (-1.0 * _x_x_0)) <= -17.0) && (((x_16 + (-1.0 * _x_x_0)) <= -3.0) && (((x_15 + (-1.0 * _x_x_0)) <= -2.0) && (((x_10 + (-1.0 * _x_x_0)) <= -15.0) && (((x_9 + (-1.0 * _x_x_0)) <= -14.0) && (((x_8 + (-1.0 * _x_x_0)) <= -8.0) && (((x_3 + (-1.0 * _x_x_0)) <= -3.0) && (((x_0 + (-1.0 * _x_x_0)) <= -2.0) && ((x_1 + (-1.0 * _x_x_0)) <= -4.0)))))))))) && (((x_18 + (-1.0 * _x_x_0)) == -1.0) || (((x_17 + (-1.0 * _x_x_0)) == -17.0) || (((x_16 + (-1.0 * _x_x_0)) == -3.0) || (((x_15 + (-1.0 * _x_x_0)) == -2.0) || (((x_10 + (-1.0 * _x_x_0)) == -15.0) || (((x_9 + (-1.0 * _x_x_0)) == -14.0) || (((x_8 + (-1.0 * _x_x_0)) == -8.0) || (((x_3 + (-1.0 * _x_x_0)) == -3.0) || (((x_0 + (-1.0 * _x_x_0)) == -2.0) || ((x_1 + (-1.0 * _x_x_0)) == -4.0))))))))))) && ((((x_19 + (-1.0 * _x_x_1)) <= -10.0) && (((x_16 + (-1.0 * _x_x_1)) <= -7.0) && (((x_13 + (-1.0 * _x_x_1)) <= -10.0) && (((x_12 + (-1.0 * _x_x_1)) <= -10.0) && (((x_11 + (-1.0 * _x_x_1)) <= -16.0) && (((x_9 + (-1.0 * _x_x_1)) <= -16.0) && (((x_8 + (-1.0 * _x_x_1)) <= -10.0) && (((x_3 + (-1.0 * _x_x_1)) <= -13.0) && (((x_1 + (-1.0 * _x_x_1)) <= -19.0) && ((x_2 + (-1.0 * _x_x_1)) <= -18.0)))))))))) && (((x_19 + (-1.0 * _x_x_1)) == -10.0) || (((x_16 + (-1.0 * _x_x_1)) == -7.0) || (((x_13 + (-1.0 * _x_x_1)) == -10.0) || (((x_12 + (-1.0 * _x_x_1)) == -10.0) || (((x_11 + (-1.0 * _x_x_1)) == -16.0) || (((x_9 + (-1.0 * _x_x_1)) == -16.0) || (((x_8 + (-1.0 * _x_x_1)) == -10.0) || (((x_3 + (-1.0 * _x_x_1)) == -13.0) || (((x_1 + (-1.0 * _x_x_1)) == -19.0) || ((x_2 + (-1.0 * _x_x_1)) == -18.0)))))))))))) && ((((x_14 + (-1.0 * _x_x_2)) <= -15.0) && (((x_13 + (-1.0 * _x_x_2)) <= -5.0) && (((x_12 + (-1.0 * _x_x_2)) <= -1.0) && (((x_11 + (-1.0 * _x_x_2)) <= -9.0) && (((x_9 + (-1.0 * _x_x_2)) <= -15.0) && (((x_7 + (-1.0 * _x_x_2)) <= -7.0) && (((x_6 + (-1.0 * _x_x_2)) <= -10.0) && (((x_5 + (-1.0 * _x_x_2)) <= -9.0) && (((x_0 + (-1.0 * _x_x_2)) <= -18.0) && ((x_1 + (-1.0 * _x_x_2)) <= -17.0)))))))))) && (((x_14 + (-1.0 * _x_x_2)) == -15.0) || (((x_13 + (-1.0 * _x_x_2)) == -5.0) || (((x_12 + (-1.0 * _x_x_2)) == -1.0) || (((x_11 + (-1.0 * _x_x_2)) == -9.0) || (((x_9 + (-1.0 * _x_x_2)) == -15.0) || (((x_7 + (-1.0 * _x_x_2)) == -7.0) || (((x_6 + (-1.0 * _x_x_2)) == -10.0) || (((x_5 + (-1.0 * _x_x_2)) == -9.0) || (((x_0 + (-1.0 * _x_x_2)) == -18.0) || ((x_1 + (-1.0 * _x_x_2)) == -17.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_3)) <= -18.0) && (((x_17 + (-1.0 * _x_x_3)) <= -4.0) && (((x_16 + (-1.0 * _x_x_3)) <= -6.0) && (((x_12 + (-1.0 * _x_x_3)) <= -6.0) && (((x_8 + (-1.0 * _x_x_3)) <= -3.0) && (((x_7 + (-1.0 * _x_x_3)) <= -9.0) && (((x_6 + (-1.0 * _x_x_3)) <= -4.0) && (((x_2 + (-1.0 * _x_x_3)) <= -11.0) && (((x_0 + (-1.0 * _x_x_3)) <= -19.0) && ((x_1 + (-1.0 * _x_x_3)) <= -6.0)))))))))) && (((x_19 + (-1.0 * _x_x_3)) == -18.0) || (((x_17 + (-1.0 * _x_x_3)) == -4.0) || (((x_16 + (-1.0 * _x_x_3)) == -6.0) || (((x_12 + (-1.0 * _x_x_3)) == -6.0) || (((x_8 + (-1.0 * _x_x_3)) == -3.0) || (((x_7 + (-1.0 * _x_x_3)) == -9.0) || (((x_6 + (-1.0 * _x_x_3)) == -4.0) || (((x_2 + (-1.0 * _x_x_3)) == -11.0) || (((x_0 + (-1.0 * _x_x_3)) == -19.0) || ((x_1 + (-1.0 * _x_x_3)) == -6.0)))))))))))) && ((((x_15 + (-1.0 * _x_x_4)) <= -18.0) && (((x_14 + (-1.0 * _x_x_4)) <= -6.0) && (((x_13 + (-1.0 * _x_x_4)) <= -10.0) && (((x_12 + (-1.0 * _x_x_4)) <= -17.0) && (((x_11 + (-1.0 * _x_x_4)) <= -11.0) && (((x_10 + (-1.0 * _x_x_4)) <= -16.0) && (((x_8 + (-1.0 * _x_x_4)) <= -10.0) && (((x_7 + (-1.0 * _x_x_4)) <= -19.0) && (((x_0 + (-1.0 * _x_x_4)) <= -16.0) && ((x_5 + (-1.0 * _x_x_4)) <= -9.0)))))))))) && (((x_15 + (-1.0 * _x_x_4)) == -18.0) || (((x_14 + (-1.0 * _x_x_4)) == -6.0) || (((x_13 + (-1.0 * _x_x_4)) == -10.0) || (((x_12 + (-1.0 * _x_x_4)) == -17.0) || (((x_11 + (-1.0 * _x_x_4)) == -11.0) || (((x_10 + (-1.0 * _x_x_4)) == -16.0) || (((x_8 + (-1.0 * _x_x_4)) == -10.0) || (((x_7 + (-1.0 * _x_x_4)) == -19.0) || (((x_0 + (-1.0 * _x_x_4)) == -16.0) || ((x_5 + (-1.0 * _x_x_4)) == -9.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_5)) <= -6.0) && (((x_17 + (-1.0 * _x_x_5)) <= -13.0) && (((x_15 + (-1.0 * _x_x_5)) <= -18.0) && (((x_14 + (-1.0 * _x_x_5)) <= -11.0) && (((x_13 + (-1.0 * _x_x_5)) <= -20.0) && (((x_11 + (-1.0 * _x_x_5)) <= -10.0) && (((x_6 + (-1.0 * _x_x_5)) <= -12.0) && (((x_2 + (-1.0 * _x_x_5)) <= -16.0) && (((x_0 + (-1.0 * _x_x_5)) <= -20.0) && ((x_1 + (-1.0 * _x_x_5)) <= -2.0)))))))))) && (((x_19 + (-1.0 * _x_x_5)) == -6.0) || (((x_17 + (-1.0 * _x_x_5)) == -13.0) || (((x_15 + (-1.0 * _x_x_5)) == -18.0) || (((x_14 + (-1.0 * _x_x_5)) == -11.0) || (((x_13 + (-1.0 * _x_x_5)) == -20.0) || (((x_11 + (-1.0 * _x_x_5)) == -10.0) || (((x_6 + (-1.0 * _x_x_5)) == -12.0) || (((x_2 + (-1.0 * _x_x_5)) == -16.0) || (((x_0 + (-1.0 * _x_x_5)) == -20.0) || ((x_1 + (-1.0 * _x_x_5)) == -2.0)))))))))))) && ((((x_18 + (-1.0 * _x_x_6)) <= -15.0) && (((x_15 + (-1.0 * _x_x_6)) <= -8.0) && (((x_14 + (-1.0 * _x_x_6)) <= -12.0) && (((x_13 + (-1.0 * _x_x_6)) <= -16.0) && (((x_11 + (-1.0 * _x_x_6)) <= -14.0) && (((x_10 + (-1.0 * _x_x_6)) <= -12.0) && (((x_7 + (-1.0 * _x_x_6)) <= -11.0) && (((x_5 + (-1.0 * _x_x_6)) <= -8.0) && (((x_1 + (-1.0 * _x_x_6)) <= -13.0) && ((x_2 + (-1.0 * _x_x_6)) <= -11.0)))))))))) && (((x_18 + (-1.0 * _x_x_6)) == -15.0) || (((x_15 + (-1.0 * _x_x_6)) == -8.0) || (((x_14 + (-1.0 * _x_x_6)) == -12.0) || (((x_13 + (-1.0 * _x_x_6)) == -16.0) || (((x_11 + (-1.0 * _x_x_6)) == -14.0) || (((x_10 + (-1.0 * _x_x_6)) == -12.0) || (((x_7 + (-1.0 * _x_x_6)) == -11.0) || (((x_5 + (-1.0 * _x_x_6)) == -8.0) || (((x_1 + (-1.0 * _x_x_6)) == -13.0) || ((x_2 + (-1.0 * _x_x_6)) == -11.0)))))))))))) && ((((x_18 + (-1.0 * _x_x_7)) <= -13.0) && (((x_17 + (-1.0 * _x_x_7)) <= -2.0) && (((x_16 + (-1.0 * _x_x_7)) <= -9.0) && (((x_14 + (-1.0 * _x_x_7)) <= -16.0) && (((x_13 + (-1.0 * _x_x_7)) <= -17.0) && (((x_12 + (-1.0 * _x_x_7)) <= -13.0) && (((x_9 + (-1.0 * _x_x_7)) <= -18.0) && (((x_8 + (-1.0 * _x_x_7)) <= -13.0) && (((x_1 + (-1.0 * _x_x_7)) <= -4.0) && ((x_3 + (-1.0 * _x_x_7)) <= -3.0)))))))))) && (((x_18 + (-1.0 * _x_x_7)) == -13.0) || (((x_17 + (-1.0 * _x_x_7)) == -2.0) || (((x_16 + (-1.0 * _x_x_7)) == -9.0) || (((x_14 + (-1.0 * _x_x_7)) == -16.0) || (((x_13 + (-1.0 * _x_x_7)) == -17.0) || (((x_12 + (-1.0 * _x_x_7)) == -13.0) || (((x_9 + (-1.0 * _x_x_7)) == -18.0) || (((x_8 + (-1.0 * _x_x_7)) == -13.0) || (((x_1 + (-1.0 * _x_x_7)) == -4.0) || ((x_3 + (-1.0 * _x_x_7)) == -3.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_8)) <= -16.0) && (((x_16 + (-1.0 * _x_x_8)) <= -16.0) && (((x_15 + (-1.0 * _x_x_8)) <= -17.0) && (((x_12 + (-1.0 * _x_x_8)) <= -17.0) && (((x_11 + (-1.0 * _x_x_8)) <= -20.0) && (((x_10 + (-1.0 * _x_x_8)) <= -2.0) && (((x_7 + (-1.0 * _x_x_8)) <= -13.0) && (((x_5 + (-1.0 * _x_x_8)) <= -14.0) && (((x_2 + (-1.0 * _x_x_8)) <= -5.0) && ((x_3 + (-1.0 * _x_x_8)) <= -4.0)))))))))) && (((x_19 + (-1.0 * _x_x_8)) == -16.0) || (((x_16 + (-1.0 * _x_x_8)) == -16.0) || (((x_15 + (-1.0 * _x_x_8)) == -17.0) || (((x_12 + (-1.0 * _x_x_8)) == -17.0) || (((x_11 + (-1.0 * _x_x_8)) == -20.0) || (((x_10 + (-1.0 * _x_x_8)) == -2.0) || (((x_7 + (-1.0 * _x_x_8)) == -13.0) || (((x_5 + (-1.0 * _x_x_8)) == -14.0) || (((x_2 + (-1.0 * _x_x_8)) == -5.0) || ((x_3 + (-1.0 * _x_x_8)) == -4.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_9)) <= -9.0) && (((x_16 + (-1.0 * _x_x_9)) <= -13.0) && (((x_14 + (-1.0 * _x_x_9)) <= -15.0) && (((x_11 + (-1.0 * _x_x_9)) <= -12.0) && (((x_10 + (-1.0 * _x_x_9)) <= -13.0) && (((x_9 + (-1.0 * _x_x_9)) <= -15.0) && (((x_5 + (-1.0 * _x_x_9)) <= -16.0) && (((x_4 + (-1.0 * _x_x_9)) <= -4.0) && (((x_1 + (-1.0 * _x_x_9)) <= -7.0) && ((x_3 + (-1.0 * _x_x_9)) <= -16.0)))))))))) && (((x_19 + (-1.0 * _x_x_9)) == -9.0) || (((x_16 + (-1.0 * _x_x_9)) == -13.0) || (((x_14 + (-1.0 * _x_x_9)) == -15.0) || (((x_11 + (-1.0 * _x_x_9)) == -12.0) || (((x_10 + (-1.0 * _x_x_9)) == -13.0) || (((x_9 + (-1.0 * _x_x_9)) == -15.0) || (((x_5 + (-1.0 * _x_x_9)) == -16.0) || (((x_4 + (-1.0 * _x_x_9)) == -4.0) || (((x_1 + (-1.0 * _x_x_9)) == -7.0) || ((x_3 + (-1.0 * _x_x_9)) == -16.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_10)) <= -1.0) && (((x_17 + (-1.0 * _x_x_10)) <= -4.0) && (((x_16 + (-1.0 * _x_x_10)) <= -19.0) && (((x_13 + (-1.0 * _x_x_10)) <= -19.0) && (((x_10 + (-1.0 * _x_x_10)) <= -19.0) && (((x_7 + (-1.0 * _x_x_10)) <= -2.0) && (((x_6 + (-1.0 * _x_x_10)) <= -13.0) && (((x_5 + (-1.0 * _x_x_10)) <= -11.0) && (((x_2 + (-1.0 * _x_x_10)) <= -7.0) && ((x_3 + (-1.0 * _x_x_10)) <= -4.0)))))))))) && (((x_19 + (-1.0 * _x_x_10)) == -1.0) || (((x_17 + (-1.0 * _x_x_10)) == -4.0) || (((x_16 + (-1.0 * _x_x_10)) == -19.0) || (((x_13 + (-1.0 * _x_x_10)) == -19.0) || (((x_10 + (-1.0 * _x_x_10)) == -19.0) || (((x_7 + (-1.0 * _x_x_10)) == -2.0) || (((x_6 + (-1.0 * _x_x_10)) == -13.0) || (((x_5 + (-1.0 * _x_x_10)) == -11.0) || (((x_2 + (-1.0 * _x_x_10)) == -7.0) || ((x_3 + (-1.0 * _x_x_10)) == -4.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_11)) <= -7.0) && (((x_15 + (-1.0 * _x_x_11)) <= -16.0) && (((x_14 + (-1.0 * _x_x_11)) <= -4.0) && (((x_13 + (-1.0 * _x_x_11)) <= -6.0) && (((x_12 + (-1.0 * _x_x_11)) <= -13.0) && (((x_11 + (-1.0 * _x_x_11)) <= -4.0) && (((x_10 + (-1.0 * _x_x_11)) <= -20.0) && (((x_6 + (-1.0 * _x_x_11)) <= -6.0) && (((x_0 + (-1.0 * _x_x_11)) <= -6.0) && ((x_4 + (-1.0 * _x_x_11)) <= -1.0)))))))))) && (((x_19 + (-1.0 * _x_x_11)) == -7.0) || (((x_15 + (-1.0 * _x_x_11)) == -16.0) || (((x_14 + (-1.0 * _x_x_11)) == -4.0) || (((x_13 + (-1.0 * _x_x_11)) == -6.0) || (((x_12 + (-1.0 * _x_x_11)) == -13.0) || (((x_11 + (-1.0 * _x_x_11)) == -4.0) || (((x_10 + (-1.0 * _x_x_11)) == -20.0) || (((x_6 + (-1.0 * _x_x_11)) == -6.0) || (((x_0 + (-1.0 * _x_x_11)) == -6.0) || ((x_4 + (-1.0 * _x_x_11)) == -1.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_12)) <= -17.0) && (((x_18 + (-1.0 * _x_x_12)) <= -1.0) && (((x_17 + (-1.0 * _x_x_12)) <= -1.0) && (((x_15 + (-1.0 * _x_x_12)) <= -12.0) && (((x_14 + (-1.0 * _x_x_12)) <= -7.0) && (((x_13 + (-1.0 * _x_x_12)) <= -9.0) && (((x_8 + (-1.0 * _x_x_12)) <= -15.0) && (((x_5 + (-1.0 * _x_x_12)) <= -14.0) && (((x_2 + (-1.0 * _x_x_12)) <= -8.0) && ((x_4 + (-1.0 * _x_x_12)) <= -18.0)))))))))) && (((x_19 + (-1.0 * _x_x_12)) == -17.0) || (((x_18 + (-1.0 * _x_x_12)) == -1.0) || (((x_17 + (-1.0 * _x_x_12)) == -1.0) || (((x_15 + (-1.0 * _x_x_12)) == -12.0) || (((x_14 + (-1.0 * _x_x_12)) == -7.0) || (((x_13 + (-1.0 * _x_x_12)) == -9.0) || (((x_8 + (-1.0 * _x_x_12)) == -15.0) || (((x_5 + (-1.0 * _x_x_12)) == -14.0) || (((x_2 + (-1.0 * _x_x_12)) == -8.0) || ((x_4 + (-1.0 * _x_x_12)) == -18.0)))))))))))) && ((((x_15 + (-1.0 * _x_x_13)) <= -10.0) && (((x_14 + (-1.0 * _x_x_13)) <= -17.0) && (((x_13 + (-1.0 * _x_x_13)) <= -17.0) && (((x_12 + (-1.0 * _x_x_13)) <= -5.0) && (((x_10 + (-1.0 * _x_x_13)) <= -8.0) && (((x_9 + (-1.0 * _x_x_13)) <= -7.0) && (((x_6 + (-1.0 * _x_x_13)) <= -2.0) && (((x_3 + (-1.0 * _x_x_13)) <= -4.0) && (((x_0 + (-1.0 * _x_x_13)) <= -6.0) && ((x_2 + (-1.0 * _x_x_13)) <= -10.0)))))))))) && (((x_15 + (-1.0 * _x_x_13)) == -10.0) || (((x_14 + (-1.0 * _x_x_13)) == -17.0) || (((x_13 + (-1.0 * _x_x_13)) == -17.0) || (((x_12 + (-1.0 * _x_x_13)) == -5.0) || (((x_10 + (-1.0 * _x_x_13)) == -8.0) || (((x_9 + (-1.0 * _x_x_13)) == -7.0) || (((x_6 + (-1.0 * _x_x_13)) == -2.0) || (((x_3 + (-1.0 * _x_x_13)) == -4.0) || (((x_0 + (-1.0 * _x_x_13)) == -6.0) || ((x_2 + (-1.0 * _x_x_13)) == -10.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_14)) <= -5.0) && (((x_18 + (-1.0 * _x_x_14)) <= -20.0) && (((x_16 + (-1.0 * _x_x_14)) <= -14.0) && (((x_10 + (-1.0 * _x_x_14)) <= -18.0) && (((x_9 + (-1.0 * _x_x_14)) <= -1.0) && (((x_8 + (-1.0 * _x_x_14)) <= -14.0) && (((x_6 + (-1.0 * _x_x_14)) <= -17.0) && (((x_5 + (-1.0 * _x_x_14)) <= -14.0) && (((x_2 + (-1.0 * _x_x_14)) <= -2.0) && ((x_4 + (-1.0 * _x_x_14)) <= -19.0)))))))))) && (((x_19 + (-1.0 * _x_x_14)) == -5.0) || (((x_18 + (-1.0 * _x_x_14)) == -20.0) || (((x_16 + (-1.0 * _x_x_14)) == -14.0) || (((x_10 + (-1.0 * _x_x_14)) == -18.0) || (((x_9 + (-1.0 * _x_x_14)) == -1.0) || (((x_8 + (-1.0 * _x_x_14)) == -14.0) || (((x_6 + (-1.0 * _x_x_14)) == -17.0) || (((x_5 + (-1.0 * _x_x_14)) == -14.0) || (((x_2 + (-1.0 * _x_x_14)) == -2.0) || ((x_4 + (-1.0 * _x_x_14)) == -19.0)))))))))))) && ((((x_18 + (-1.0 * _x_x_15)) <= -11.0) && (((x_15 + (-1.0 * _x_x_15)) <= -16.0) && (((x_10 + (-1.0 * _x_x_15)) <= -8.0) && (((x_9 + (-1.0 * _x_x_15)) <= -11.0) && (((x_8 + (-1.0 * _x_x_15)) <= -9.0) && (((x_7 + (-1.0 * _x_x_15)) <= -6.0) && (((x_5 + (-1.0 * _x_x_15)) <= -12.0) && (((x_4 + (-1.0 * _x_x_15)) <= -3.0) && (((x_0 + (-1.0 * _x_x_15)) <= -12.0) && ((x_1 + (-1.0 * _x_x_15)) <= -2.0)))))))))) && (((x_18 + (-1.0 * _x_x_15)) == -11.0) || (((x_15 + (-1.0 * _x_x_15)) == -16.0) || (((x_10 + (-1.0 * _x_x_15)) == -8.0) || (((x_9 + (-1.0 * _x_x_15)) == -11.0) || (((x_8 + (-1.0 * _x_x_15)) == -9.0) || (((x_7 + (-1.0 * _x_x_15)) == -6.0) || (((x_5 + (-1.0 * _x_x_15)) == -12.0) || (((x_4 + (-1.0 * _x_x_15)) == -3.0) || (((x_0 + (-1.0 * _x_x_15)) == -12.0) || ((x_1 + (-1.0 * _x_x_15)) == -2.0)))))))))))) && ((((x_18 + (-1.0 * _x_x_16)) <= -11.0) && (((x_17 + (-1.0 * _x_x_16)) <= -1.0) && (((x_15 + (-1.0 * _x_x_16)) <= -18.0) && (((x_12 + (-1.0 * _x_x_16)) <= -15.0) && (((x_9 + (-1.0 * _x_x_16)) <= -19.0) && (((x_7 + (-1.0 * _x_x_16)) <= -8.0) && (((x_5 + (-1.0 * _x_x_16)) <= -9.0) && (((x_3 + (-1.0 * _x_x_16)) <= -17.0) && (((x_0 + (-1.0 * _x_x_16)) <= -7.0) && ((x_2 + (-1.0 * _x_x_16)) <= -16.0)))))))))) && (((x_18 + (-1.0 * _x_x_16)) == -11.0) || (((x_17 + (-1.0 * _x_x_16)) == -1.0) || (((x_15 + (-1.0 * _x_x_16)) == -18.0) || (((x_12 + (-1.0 * _x_x_16)) == -15.0) || (((x_9 + (-1.0 * _x_x_16)) == -19.0) || (((x_7 + (-1.0 * _x_x_16)) == -8.0) || (((x_5 + (-1.0 * _x_x_16)) == -9.0) || (((x_3 + (-1.0 * _x_x_16)) == -17.0) || (((x_0 + (-1.0 * _x_x_16)) == -7.0) || ((x_2 + (-1.0 * _x_x_16)) == -16.0)))))))))))) && ((((x_18 + (-1.0 * _x_x_17)) <= -18.0) && (((x_15 + (-1.0 * _x_x_17)) <= -18.0) && (((x_12 + (-1.0 * _x_x_17)) <= -4.0) && (((x_10 + (-1.0 * _x_x_17)) <= -15.0) && (((x_8 + (-1.0 * _x_x_17)) <= -4.0) && (((x_6 + (-1.0 * _x_x_17)) <= -6.0) && (((x_5 + (-1.0 * _x_x_17)) <= -5.0) && (((x_4 + (-1.0 * _x_x_17)) <= -1.0) && (((x_0 + (-1.0 * _x_x_17)) <= -15.0) && ((x_3 + (-1.0 * _x_x_17)) <= -7.0)))))))))) && (((x_18 + (-1.0 * _x_x_17)) == -18.0) || (((x_15 + (-1.0 * _x_x_17)) == -18.0) || (((x_12 + (-1.0 * _x_x_17)) == -4.0) || (((x_10 + (-1.0 * _x_x_17)) == -15.0) || (((x_8 + (-1.0 * _x_x_17)) == -4.0) || (((x_6 + (-1.0 * _x_x_17)) == -6.0) || (((x_5 + (-1.0 * _x_x_17)) == -5.0) || (((x_4 + (-1.0 * _x_x_17)) == -1.0) || (((x_0 + (-1.0 * _x_x_17)) == -15.0) || ((x_3 + (-1.0 * _x_x_17)) == -7.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_18)) <= -8.0) && (((x_18 + (-1.0 * _x_x_18)) <= -11.0) && (((x_17 + (-1.0 * _x_x_18)) <= -20.0) && (((x_16 + (-1.0 * _x_x_18)) <= -4.0) && (((x_15 + (-1.0 * _x_x_18)) <= -15.0) && (((x_6 + (-1.0 * _x_x_18)) <= -3.0) && (((x_5 + (-1.0 * _x_x_18)) <= -19.0) && (((x_2 + (-1.0 * _x_x_18)) <= -19.0) && (((x_0 + (-1.0 * _x_x_18)) <= -20.0) && ((x_1 + (-1.0 * _x_x_18)) <= -19.0)))))))))) && (((x_19 + (-1.0 * _x_x_18)) == -8.0) || (((x_18 + (-1.0 * _x_x_18)) == -11.0) || (((x_17 + (-1.0 * _x_x_18)) == -20.0) || (((x_16 + (-1.0 * _x_x_18)) == -4.0) || (((x_15 + (-1.0 * _x_x_18)) == -15.0) || (((x_6 + (-1.0 * _x_x_18)) == -3.0) || (((x_5 + (-1.0 * _x_x_18)) == -19.0) || (((x_2 + (-1.0 * _x_x_18)) == -19.0) || (((x_0 + (-1.0 * _x_x_18)) == -20.0) || ((x_1 + (-1.0 * _x_x_18)) == -19.0)))))))))))) && ((((x_19 + (-1.0 * _x_x_19)) <= -13.0) && (((x_15 + (-1.0 * _x_x_19)) <= -6.0) && (((x_12 + (-1.0 * _x_x_19)) <= -4.0) && (((x_10 + (-1.0 * _x_x_19)) <= -4.0) && (((x_9 + (-1.0 * _x_x_19)) <= -5.0) && (((x_8 + (-1.0 * _x_x_19)) <= -19.0) && (((x_7 + (-1.0 * _x_x_19)) <= -18.0) && (((x_6 + (-1.0 * _x_x_19)) <= -20.0) && (((x_1 + (-1.0 * _x_x_19)) <= -14.0) && ((x_3 + (-1.0 * _x_x_19)) <= -7.0)))))))))) && (((x_19 + (-1.0 * _x_x_19)) == -13.0) || (((x_15 + (-1.0 * _x_x_19)) == -6.0) || (((x_12 + (-1.0 * _x_x_19)) == -4.0) || (((x_10 + (-1.0 * _x_x_19)) == -4.0) || (((x_9 + (-1.0 * _x_x_19)) == -5.0) || (((x_8 + (-1.0 * _x_x_19)) == -19.0) || (((x_7 + (-1.0 * _x_x_19)) == -18.0) || (((x_6 + (-1.0 * _x_x_19)) == -20.0) || (((x_1 + (-1.0 * _x_x_19)) == -14.0) || ((x_3 + (-1.0 * _x_x_19)) == -7.0)))))))))))) && ((((_EL_X_1284 == (_x__EL_U_1283 || ( !(_x__EL_U_1281 || _x__EL_X_1275)))) && ((_EL_U_1283 == (_x__EL_U_1283 || ( !(_x__EL_U_1281 || _x__EL_X_1275)))) && ((_EL_X_1275 == ((_x_x_12 + (-1.0 * _x_x_13)) <= 1.0)) && (_EL_U_1281 == (_x__EL_U_1281 || _x__EL_X_1275))))) && (_x__J1302 == (( !(_J1302 && _J1308)) && ((_J1302 && _J1308) || ((_EL_X_1275 || ( !(_EL_X_1275 || _EL_U_1281))) || _J1302))))) && (_x__J1308 == (( !(_J1302 && _J1308)) && ((_J1302 && _J1308) || ((( !(_EL_X_1275 || _EL_U_1281)) || ( !(_EL_U_1283 || ( !(_EL_X_1275 || _EL_U_1281))))) || _J1308))))));
x_18 = _x_x_18;
_J1308 = _x__J1308;
_J1302 = _x__J1302;
_EL_X_1284 = _x__EL_X_1284;
x_13 = _x_x_13;
x_3 = _x_x_3;
x_14 = _x_x_14;
x_1 = _x_x_1;
x_6 = _x_x_6;
x_7 = _x_x_7;
x_4 = _x_x_4;
x_8 = _x_x_8;
x_9 = _x_x_9;
x_10 = _x_x_10;
x_12 = _x_x_12;
x_15 = _x_x_15;
x_19 = _x_x_19;
_EL_U_1281 = _x__EL_U_1281;
_EL_X_1275 = _x__EL_X_1275;
_EL_U_1283 = _x__EL_U_1283;
x_0 = _x_x_0;
x_2 = _x_x_2;
x_5 = _x_x_5;
x_11 = _x_x_11;
x_16 = _x_x_16;
x_17 = _x_x_17;
}
}
|
the_stack_data/148578274.c | /* PR tree-optimization/52267 */
/* { dg-do run { target { ! int16 } } } */
/* { dg-options "-O2" } */
extern void abort (void);
#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
#define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
void
f1 (unsigned int s)
{
if ((s & (7U << (BITSM1 - 2))) != 0)
{
if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
|| s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
|| s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
|| s == (0xc000U << BITSH) + 1 || s == -1U || s == -15U
|| s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == 1U + __INT_MAX__ || s == -32U
|| s == (3 << (BITSM1 - 2)) + 2 || s == -5U || s == -63U
|| s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
|| s == -8191U || s == -8192U || s == -8193U || s == -8250U
|| s == -8255U || s == -8256U || s == -8257U || s == __INT_MAX__
|| s == __INT_MAX__ + 9U)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f || s == 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
return;
}
abort ();
}
void
f2 (int s)
{
if ((s & (7U << (BITSM1 - 2))) == 0)
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f || s == 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
return;
}
else
{
if (s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == -1 || s == -15 || s == -15550
|| s == -15552 || s == (0x7000 << BITSH) - 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == -__INT_MAX__ - 1 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
|| s == -5 || s == -63 || s == -64 || s == -65
|| s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f3 (unsigned int s)
{
if ((s & 0x3cc0) == 0)
{
if (s == 0 || s == 0x20 || s == 0x3f || s == (0xbfbfU << BITSH)
|| s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
|| s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == 1U + __INT_MAX__ || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == 6U + __INT_MAX__
|| s == __INT_MAX__ + 9U)
return;
}
else
{
if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x3cbf || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
|| s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
|| s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
|| s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
|| s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
|| s == -8192U || s == -8193U || s == -8250U || s == -8255U
|| s == -8256U || s == -8257U || s == __INT_MAX__)
return;
}
abort ();
}
void
f4 (int s)
{
if ((s & 0x3cc0) == 0)
{
if (s == 0 || s == 0x20 || s == 0x3f || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
|| s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
|| s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
|| s == -15552 || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == __INT_MAX__)
return;
}
abort ();
}
void
f5 (int s)
{
if ((s & 0x3cc0U) == 0)
{
if (s == 0 || s == 0x20 || s == 0x3f || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
|| s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
|| s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
|| s == -15552 || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == __INT_MAX__)
return;
}
abort ();
}
void
f6 (unsigned int s)
{
if ((s & 0x3cc0) == 0x3cc0)
{
if (s == 0x3cc0 || s == (0xc000U << BITSH) - 1
|| s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
|| s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
|| s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
|| s == -32U || s == -5U || s == -63U || s == -64U
|| s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3f || s == (0xbfbfU << BITSH)
|| s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
|| s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
|| s == -15550U || s == -15552U || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65U
|| s == 6U + __INT_MAX__ || s == -8189U || s == -8191U
|| s == -8192U || s == -8193U || s == -8250U || s == -8255U
|| s == -8256U || s == -8257U || s == __INT_MAX__ + 9U)
return;
}
abort ();
}
void
f7 (int s)
{
if ((s & 0x3cc0) == 0x3cc0)
{
if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
|| s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
|| s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
|| s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == -15550 || s == -15552 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
|| s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f8 (int s)
{
if ((s & 0x3cc0U) == 0x3cc0)
{
if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
|| s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
|| s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
|| s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == -15550 || s == -15552 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
|| s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f9 (unsigned int s)
{
if ((s & 0x3cc0) >= 0x1cc0)
{
if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
|| s == 0x3cc0 || s == (0xc000U << BITSH) - 1
|| s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
|| s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
|| s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
|| s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
|| s == -8189U || s == -8191U || s == -8192U || s == -8193U
|| s == -8250U || s == -8255U || s == -8256U || s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
|| s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
|| s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
|| s == -15552U || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
|| s == 6U + __INT_MAX__ || s == -8257U || s == __INT_MAX__ + 9U)
return;
}
abort ();
}
void
f10 (unsigned int s)
{
if ((s & 0x3cc0) > 0x1cc0)
{
if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
|| s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
|| s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
|| s == -1U || s == -15U || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
|| s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
|| s == -8192U || s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
|| s == 0x3f || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
|| s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
|| s == -15552U || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
|| s == 6U + __INT_MAX__ || s == -8193U || s == -8250U
|| s == -8255U || s == -8256U || s == -8257U
|| s == __INT_MAX__ + 9U)
return;
}
abort ();
}
void
f11 (int s)
{
if ((s & 0x3cc0) >= 0x1cc0)
{
if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
|| s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
|| s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
|| s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
|| s == -32 || s == -5 || s == -63 || s == -64 || s == -65
|| s == -8189 || s == -8191 || s == -8192 || s == -8193
|| s == -8250 || s == -8255 || s == -8256 || s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
|| s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
|| s == -15552 || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
|| s == -8257 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f12 (int s)
{
if ((s & 0x3cc0) > 0x1cc0)
{
if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == -1 || s == -15 || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
|| s == __INT_MAX__)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
|| s == 0x3f || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
|| s == -15552 || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
|| s == -8193 || s == -8250 || s == -8255 || s == -8256
|| s == -8257 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f13 (unsigned int s)
{
if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
{
if (s == (0xf000U << BITSH) - 1 || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
|| s == -1U || s == -15U || s == -15550U || s == -15552U
|| s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
|| s == -8189U || s == -8191U || s == -8192U || s == -8193U
|| s == -8250U || s == -8255U || s == -8256U || s == -8257U)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (0xc000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
|| s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
|| s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
|| s == 6U + __INT_MAX__ || s == __INT_MAX__
|| s == __INT_MAX__ + 9U)
return;
}
abort ();
}
void
f14 (unsigned int s)
{
if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
{
if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
|| s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
|| s == -1U || s == -15U || s == -15550U || s == -15552U
|| s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
|| s == -8189U || s == -8191U || s == -8192U || s == -8193U
|| s == -8250U || s == -8255U || s == -8256U || s == -8257U)
return;
}
else
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
|| s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
|| s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
|| s == 6U + __INT_MAX__ || s == __INT_MAX__
|| s == __INT_MAX__ + 9U)
return;
}
abort ();
}
void
f15 (int s)
{
if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == -1 || s == -15 || s == -15550 || s == -15552
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
|| s == 5 || s == -5 || s == -63 || s == -64 || s == -65
|| s == -8189 || s == -8191 || s == -8192 || s == -8193
|| s == -8250 || s == -8255 || s == -8256 || s == -8257
|| s == __INT_MAX__)
return;
}
else
{
if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
|| s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
|| s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f16 (int s)
{
if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == -1 || s == -15 || s == -15550 || s == -15552
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
|| s == 5 || s == -5 || s == -63 || s == -64 || s == -65
|| s == -8189 || s == -8191 || s == -8192 || s == -8193
|| s == -8250 || s == -8255 || s == -8256 || s == -8257
|| s == __INT_MAX__)
return;
}
else
{
if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
|| s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
|| s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f17 (int s)
{
if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
|| s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
|| s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
|| s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == -32
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
|| s == -8191 || s == -8192 || s == -8193 || s == -8250
|| s == -8255 || s == -8256 || s == -8257 || s == __INT_MAX__)
return;
}
else
{
if (s == (-0x4041 << BITSH) || s == (-0x7000 << BITSH)
|| s == -__INT_MAX__ - 1 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f18 (int s)
{
if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == 1 || s == -15550 || s == -15552
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -64
|| s == -__INT_MAX__ + 4 || s == -8192 || s == -8250 || s == -8256
|| s == __INT_MAX__ || s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH) + 1
|| s == -1 || s == -15 || s == -5 || s == -63 || s == -65
|| s == -8189 || s == -8191 || s == -8193 || s == -8255
|| s == -8257)
return;
}
abort ();
}
void
f19 (int s)
{
if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
|| s == -15550 || s == -15552 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
|| s == -8191 || s == -8192 || s == -8193 || s == -8250
|| s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == (0x7000 << BITSH) - 1 || s == __INT_MAX__)
return;
}
abort ();
}
void
f20 (int s)
{
if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
|| s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == -1 || s == -15 || s == -15550 || s == -15552
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
|| s == 5 || s == -5 || s == -63 || s == -64 || s == -65
|| s == -8189 || s == -8191 || s == -8192 || s == -8193
|| s == -8250 || s == -8255 || s == -8256 || s == -8257
|| s == __INT_MAX__)
return;
}
else
{
if (s == (-0x7000 << BITSH) - 1 || s == -__INT_MAX__ - 1
|| s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
return;
}
abort ();
}
void
f21 (int s)
{
if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
|| s == __INT_MAX__ || s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == (-0x1000 << BITSH) || s == -1 || s == -15 || s == -15550
|| s == -15552 || s == -32 || s == -5 || s == -63 || s == -64
|| s == -65 || s == -8189 || s == -8191 || s == -8192 || s == -8193
|| s == -8250 || s == -8255 || s == -8256 || s == -8257)
return;
}
abort ();
}
void
f22 (int s)
{
if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
|| s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
|| s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
|| s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
|| s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
|| s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
|| s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
|| s == -8191 || s == -8192 || s == -8193 || s == -8250
|| s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
return;
}
else
{
if (s == (0x7000 << BITSH) || s == __INT_MAX__)
return;
}
abort ();
}
void
f23 (unsigned int s)
{
if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
|| s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
|| s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
|| s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
|| s == (0xc000U << BITSH) + 1 || s == 1 || s == -1U || s == -15U
|| s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == 1U + __INT_MAX__ || s == 2 || s == 24 || s == -32U
|| s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5U || s == -63U
|| s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
|| s == -8191U || s == -8192U || s == -8193U || s == -8250U
|| s == -8255U || s == -8256U || s == -8257U
|| s == __INT_MAX__ + 9U)
return;
}
else
{
if (s == (0x7000 << BITSH) || s == __INT_MAX__)
return;
}
abort ();
}
void
f24 (unsigned int s)
{
if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
{
if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
|| s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
|| s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
|| s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
|| s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
|| s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
|| s == -1U || s == -15U || s == -15550U || s == -15552U
|| s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
|| s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
|| s == 2 || s == 24 || s == -32U || s == (3 << (BITSM1 - 2)) + 2
|| s == 5 || s == -5U || s == -63U || s == -64U || s == -65U
|| s == -8189U || s == -8191U || s == -8192U || s == -8193U
|| s == -8250U || s == -8255U || s == -8256U || s == -8257U
|| s == __INT_MAX__)
return;
}
else
{
if (s == (0x9000U << BITSH) - 1 || s == 1U + __INT_MAX__
|| s == 6U + __INT_MAX__ || s == __INT_MAX__ + 9U)
return;
}
abort ();
}
int svals[] = {
0,
0x1cbf,
0x1cc0,
0x1fff,
0x2000,
0x20,
0x3cbf,
0x3cc0,
0x3f,
(-0x4000 << BITSH) - 1,
(-0x1000 << BITSH) - 1,
(-0x7000 << BITSH) - 1,
(-0x5fcf << BITSH) - 1,
(-0x4041 << BITSH),
(-0x4000 << BITSH),
(-0x1000 << BITSH),
(-0x7000 << BITSH),
(-0x4000 << BITSH) + 1,
1,
-1,
-15,
-15550,
-15552,
(0x7000 << BITSH) - 1,
(0x7000 << BITSH),
(1 << (BITSM1 - 2)),
(1 << (BITSM1 - 2)) - 1,
-__INT_MAX__ - 1,
2,
24,
-32,
(3 << (BITSM1 - 2)) + 2,
5,
-5,
-63,
-64,
-65,
-__INT_MAX__ + 4,
-8189,
-8191,
-8192,
-8193,
-8250,
-8255,
-8256,
-8257,
__INT_MAX__,
-__INT_MAX__ + 7,
};
unsigned int uvals[] = {
0,
0x1cbf,
0x1cc0,
0x1fff,
0x2000,
0x20,
0x3cbf,
0x3cc0,
0x3f,
(0xc000U << BITSH) - 1,
(0xf000U << BITSH) - 1,
(0x9000U << BITSH) - 1,
(0xa031U << BITSH) - 1,
(0xbfbfU << BITSH),
(0xc000U << BITSH),
(0xf000U << BITSH),
(0x9000U << BITSH),
(0xc000U << BITSH) + 1,
1,
-1U,
-15U,
-15550U,
-15552U,
(0x7000 << BITSH) - 1,
(0x7000 << BITSH),
(1 << (BITSM1 - 2)),
(1 << (BITSM1 - 2)) - 1,
1U + __INT_MAX__,
2,
24,
-32U,
(3 << (BITSM1 - 2)) + 2,
5,
-5U,
-63U,
-64U,
-65U,
6U + __INT_MAX__,
-8189U,
-8191U,
-8192U,
-8193U,
-8250U,
-8255U,
-8256U,
-8257U,
__INT_MAX__,
__INT_MAX__ + 9U,
};
int
main ()
{
int i;
for (i = 0; i < sizeof (svals) / sizeof (svals[0]); i++)
{
f2 (svals[i]);
f4 (svals[i]);
f5 (svals[i]);
f7 (svals[i]);
f8 (svals[i]);
f11 (svals[i]);
f12 (svals[i]);
f15 (svals[i]);
f16 (svals[i]);
f17 (svals[i]);
f18 (svals[i]);
f19 (svals[i]);
f20 (svals[i]);
f21 (svals[i]);
f22 (svals[i]);
}
for (i = 0; i < sizeof (uvals) / sizeof (uvals[0]); i++)
{
f1 (uvals[i]);
f3 (uvals[i]);
f6 (uvals[i]);
f9 (uvals[i]);
f10 (uvals[i]);
f13 (uvals[i]);
f14 (uvals[i]);
f23 (uvals[i]);
f24 (uvals[i]);
}
return 0;
}
|
the_stack_data/190768177.c | #include<stdio.h>
#define A sizeof
int main(void)
{
printf("\"shuzhan is a fucker\".%%\\\\");
printf("\nfaferwfs\r111111");
int unsigned a=-1;
printf("\n%u",a);
printf("\n%d %d",sizeof(float),sizeof(double));
printf("\n%d %d %d",A(int*),A(float**),A(void*));
printf("\n%d %d %d %d",sizeof(char),sizeof(int),sizeof(long),sizeof(long long));
printf("\n %c%c%c%c",49,65,81,97);
printf("\n%f",2.0/3);
return 0;
}
|
the_stack_data/92325549.c | // Copyright (c) 2015 RV-Match Team. All Rights Reserved.
int foo();
int main(void){
foo();
}
int foo(int a, int b){
return 0;
}
|
the_stack_data/242329733.c | #define N 32
int
foo (unsigned int sum)
{
#pragma acc parallel reduction (+:sum)
{
sum;
}
return sum;
}
int
main (void)
{
unsigned int sum = 0;
foo (sum);
return 0;
}
|
the_stack_data/32951194.c | int main ()
{
int a = 0 ;
int b = 1 ;
int c = a & b ;
return c;
} |
the_stack_data/450678.c |
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int num,prod=1,i;
for(i=1;i<=21;i++){
printf("Digite um numero: \n");
scanf("%d",&num);
prod=prod*num;
printf("-->>%d\n ",prod);
if(prod==0){
prod=1;
}
}
return 0;
}
|
the_stack_data/1160378.c | #include <stdio.h>
int main() {
// & | ^ ~ << >>
int a = 9; //1001
int b = 5; //0101
a = a ^ b;
b = b ^ a;
a = a ^ b;
printf("%d\n%d\n", a, b);
return 0;
}
|
the_stack_data/138467.c | // using bool type
#include <stdio.h>
#include <stdbool.h>
int main()
{
bool myboolean=true;
return 0;
} |
the_stack_data/17690.c | #include <stdio.h>
int main()
{
char str1[25];
printf("Please enter your name: ");
scanf("%[^\n]", str1);
printf("Welcome to CSE031, %s", str1);
printf("!\n");
return 0;
}
|
the_stack_data/82949520.c | /* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2019, STMicroelectronics
* SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
*
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
*
* either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*/
#if DEVICE_SERIAL
#include "serial_api.h"
#include "device.h"
#include "BlueNRG1_sysCtrl.h"
#include "misc.h"
int stdio_uart_inited = 0;// used in platform/mbed_board.c and platform/mbed_retarget.cpp
serial_t stdio_uart;
static uart_irq_handler irq_handler;
static uint32_t serial_irq_ids = 0;
void serial_init(serial_t *obj, PinName tx, PinName rx){
//GPIO and UART Peripherals clock enable
SysCtrl_PeripheralClockCmd(CLOCK_PERIPH_UART | CLOCK_PERIPH_GPIO, ENABLE);
//This statement is valid for both BlueNRG1-2, developed under DK 3.0.0
//GPIO TX config
switch(tx){
case USBTX:
GPIO_InitUartTxPin8();
break;
case IO_5:
GPIO_InitUartTxPin5();
break;
default:
error("The selected is not UART_TX capable. Choose the correct pin.");
break;
}
//GPIO RX config
switch(rx){
case USBRX:
GPIO_InitUartRxPin11();
break;
case IO_4:
GPIO_InitUartRxPin4();
break;
default:
error("The selected is not UART_RX capable. Choose the correct pin.");
break;
}
/*
------------ UART configuration -------------------
- BaudRate = 115200 baud
- Word Length = 8 Bits
- One Stop Bit
- No parity
- Hardware flow control disabled (RTS and CTS signals)
- Receive and transmit enabled
*/
UART_StructInit(&obj->serial.init);
UART_Init(&obj->serial.init);
obj->serial.uart = UART_1;
//obj->init = &UART_InitStructure;
obj->serial.pin_tx = tx;
obj->serial.pin_rx = rx;
/* Interrupt as soon as data is received. */
UART_RxFifoIrqLevelConfig(FIFO_LEV_1_64);
/* Enable UART */
UART_Cmd(ENABLE);
// For stdio management in platform/mbed_board.c and platform/mbed_retarget.cpp
if (tx==USBTX && rx==USBRX) {
stdio_uart_inited = 1;
memcpy(&stdio_uart, obj, sizeof(serial_t));
}
}
void serial_free(serial_t *obj){
UART_DeInit();
UART_Cmd(DISABLE);
SysCtrl_PeripheralClockCmd(CLOCK_PERIPH_UART, DISABLE);
obj->serial.index_irq = 0;
obj->serial.init.UART_BaudRate = 0;
/**
* One has to release also the GPIO assigned to the UART. In this case the
* GPIO release is not performed since it has been initialized with pull and
* high power mode disable.
*/
}
void serial_baud(serial_t *obj, int baudrate){
obj->serial.init.UART_BaudRate = baudrate;
UART_Init(&obj->serial.init);
}
void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits){
obj->serial.init.UART_WordLengthTransmit = (uint8_t)data_bits;
obj->serial.init.UART_WordLengthReceive = (uint8_t)data_bits;
obj->serial.init.UART_Parity = (uint8_t)parity;
obj->serial.init.UART_StopBits= (uint8_t)stop_bits;
UART_Init(&obj->serial.init);
}
void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id){
irq_handler = handler;
serial_irq_ids = id;
//obj->index_irq = id;
}
void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable){
/* NVIC configuration */
NVIC_InitType NVIC_InitStructure;
/* Enable the UART Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = UART_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = LOW_PRIORITY;
NVIC_InitStructure.NVIC_IRQChannelCmd = enable;
NVIC_Init(&NVIC_InitStructure);
//UART_ITConfig(UART_IT_RX, enable);
if (irq == RxIrq)
UART_ITConfig(UART_IT_RX, enable);
else// TxIrq
UART_ITConfig(UART_IT_TX, enable);
}
int serial_getc(serial_t *obj){
/* Loop until the UART Receive Data Register is not empty */
while (UART_GetFlagStatus(UART_FLAG_RXFE) == SET);
/* Store the received byte in RxBuffer */
return (int) UART_ReceiveData();
}
void serial_putc(serial_t *obj, int c){
/* Wait if TX fifo is full. */
while (UART_GetFlagStatus(UART_FLAG_TXFF) == SET);
/* send the data */
UART_SendData((uint16_t)c);
}
int serial_readable(serial_t *obj){
// To avoid a target blocking case, let's check for possible OVERRUN error and discard it
if(UART_GetFlagStatus(UART_FLAG_OE)){
UART_ClearFlag(UART_FLAG_OE);
}
return !UART_GetFlagStatus(UART_FLAG_RXFE);
}
int serial_writable(serial_t *obj){
return UART_GetFlagStatus(UART_FLAG_TXFF);
}
void serial_clear(serial_t *obj){}
void serial_break_set(serial_t *obj){}
void serial_break_clear(serial_t *obj){}
void serial_pinout_tx(PinName tx){}
void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow){}
const PinMap *serial_tx_pinmap(void){}
const PinMap *serial_rx_pinmap(void){}
const PinMap *serial_cts_pinmap(void){}
const PinMap *serial_rts_pinmap(void){}
#if DEVICE_SERIAL_ASYNCH
int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint){}
void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_width, uint32_t handler, uint32_t event, uint8_t char_match, DMAUsage hint){}
uint8_t serial_tx_active(serial_t *obj){}
uint8_t serial_rx_active(serial_t *obj){}
int serial_irq_handler_asynch(serial_t *obj){}
void serial_tx_abort_asynch(serial_t *obj){}
void serial_rx_abort_asynch(serial_t *obj){}
#endif
/* Function used to protect deep sleep while a serial transmission is on-going.
* Returns 1 if there is at least 1 serial instance with an on-going transfer
* and 0 otherwise.
* HANDLED IN sleep_api.c
*/
uint8_t serialTxActive(void) {
return(UART_GetFlagStatus(UART_FLAG_TXFE) == RESET);
}
#endif //DEVICE_SERIAL
|
the_stack_data/16518.c | #include <stdio.h>
int f();
int main()
{
fprintf(stderr, "my result = %d\n", f());
return !( 896 == f() );
}
|
the_stack_data/97014113.c | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
//declarations and inputs
int num,i,valley=0;
scanf("%d",&num);
char steps[num];
scanf("%s",steps);
int sea=0;
//loop for counting no of valleys
for(i=0;i<num;i++)
{
if(sea==0 && steps[i]=='D')
{ valley++;}
if(steps[i]=='U')
{ sea++;}
else
{ sea--;}
}
//printing valleys
printf("%d",valley);
return 0;
} |
the_stack_data/247018369.c | /*
David Cairuz | (ICMC/USP) - 2018
25/11/2018
A simple and powerful code of an AVL tree.
This code's purpose is teaching and that's the reason
why it has so many comments.
Heavily based on:
https://github.com/Vernalhav/T1-Alg/blob/master/avl.c
https://gist.github.com/tonious/1377768
https://www.youtube.com/watch?v=g4y2h70D6Nk
*/
#include <stdio.h>
#include <stdlib.h>
#define max(a, b) ((a > b) ? a : b)
/*
If you want to change the type of item in the AVL
the only place you need to change is here.
*/
typedef int ITEM;
struct node {
struct node *left;
struct node *right;
int height;
ITEM value;
};
struct avl {
struct node *root;
};
typedef struct node NODE;
typedef struct avl AVL;
AVL* create_avl() {
AVL *tree = malloc(sizeof(AVL));
if(tree == NULL) return tree;
tree->root = NULL;
return tree;
}
/*
Creates a node with determined value.
Used in the insertion of an item in the tree.
When a NULL node is found, it becomes the node
created by this function
*/
NODE* initialize_node(ITEM value) {
NODE *node = malloc(sizeof(NODE));
if(node == NULL) return node;
node->value = value;
node->height = 0;
node->left = NULL;
node->right = NULL;
return node;
}
/*
Gets the root of the tree.
*/
NODE* get_root(AVL* tree) {
return tree->root;
}
/*
Returns a node's height or -1 if it's NULL.
It's useful to say taht the height of a NULL node is -1
for porpuses of updating its height when necessary.
*/
int node_height(NODE *node) {
return (node == NULL) ? -1 : node->height;
}
/*
Updates a node's height using the formula:
height(node) = max(left child, right child) + 1
*/
void height_update(NODE *node) {
int height = max(node_height(node->left), node_height(node->right));
node->height = height + 1;
}
/*
Calculates the balance factor of a node using the formula:
balance(node) = height(left child) - height(right child)
*/
int balance_factor(NODE *node) {
return node_height(node->left) - node_height(node->right);
}
/*
Rotates a node to the left when necessary.
This function is called when the balance factor
of a node is out of the range [-1, 1] and is negative.
Also updates the heights of 'a' and 'b'.
*/
NODE* left_rotate(NODE* a) {
NODE* b = a->right;
a->right = b->left;
b->left = a;
height_update(a);
height_update(b);
return b;
}
/*
Rotates a node to the right when necessary.
This function is called when the balance factor
of a node is out of the range [-1, 1] and is positive.
Also updates the heights of 'a' and 'b'.
*/
NODE* right_rotate(NODE *a) {
NODE *b = a->left;
a->left = b-> right;
b->right = a;
height_update(a);
height_update(b);
return b;
}
/*
Makes a double rotation when necessary.
A left/right rotation is needed when the balance factor
of a node has the opposite sign of its left child.
*/
NODE* left_right_rotate(NODE *a){
a->left = left_rotate(a->left);
return right_rotate(a);
}
/*
Makes a double rotation when necessary.
A right/left rotation is needed when the balance factor
of a node has the opposite sign of its right child.
*/
NODE* right_left_rotate(NODE *a){
a->right = right_rotate(a->right);
return left_rotate(a);
}
/*
Follows the already mentioned rules to perform the correct
rotations on node 'a'.
*/
NODE* rebalance(NODE *a) {
int balance = balance_factor(a);
if(balance >= 0) {
return balance_factor(a->left) < 0 ? a = left_right_rotate(a) : right_rotate(a);
} else if(balance < 0) {
return balance_factor(a->right) > 0 ? a = right_left_rotate(a) : left_rotate(a);
}
}
/*
Finds the correct place for the item to be in the AVL and inserts it there.
While leaving the recursion, it updates the height of each node and
rebalances the tree when needed.
The '(balance * balance) > 2' part is used to check if the balance factor is
in the range [-1, 1].
*/
NODE* insert_avl_node(NODE* node, ITEM value) {
if(node == NULL) node = initialize_node(value);
else if(value < node->value) node->left = insert_avl_node(node->left, value);
else if(value > node->value) node->right = insert_avl_node(node->right, value);
else if(value == node->value) {
printf("Invalid value.\n");
return node;
}
height_update(node);
int balance = balance_factor(node);
if(balance * balance > 2) return rebalance(node);
return node;
}
/*
Used to start insertion.
*/
void insert_avl(AVL* tree, ITEM value) {
tree->root = insert_avl_node(tree->root, value);
}
/*
Used to find the smallest value of a subtree.
*/
ITEM smallest_in_subtree(NODE* node) {
while(node->left != NULL) {
node = node->left;
}
return node->value;
}
/*
Used to remove a node from the AVL.
The idea behind removal is not simple enough
to explain here.
However, the idea used in this code is the one
in this video: https://www.youtube.com/watch?v=g4y2h70D6Nk
by William Fiset.
*/
NODE* remove_avl_node(NODE *node, ITEM key) {
if(node == NULL) return node;
if(key < node->value) {
node->left = remove_avl_node(node->left,key);
} else if (key > node->value) {
node->right = remove_avl_node(node->right, key);
} else if (key == node->value) {
if(node->right == NULL) {
NODE* aux = node->left;
free(node);
node = aux;
} else if(node->left == NULL) {
NODE*aux = node->right;
free(node);
node = aux;
} else if(node->right != NULL && node->left != NULL) {
ITEM new_value = smallest_in_subtree(node->right);
node-> value = new_value;
node->right = remove_avl_node(node->right, new_value);
}
}
if (node == NULL) return node;
height_update(node);
int balance = balance_factor(node);
if (balance * balance > 2) return rebalance(node);
return node;
}
/*
Used to start removal.
*/
void remove_avl(AVL* tree, ITEM value) {
tree->root = remove_avl_node(tree->root, value);
}
/*
Used to print the tree.
Copied this function from Victor Vernalha's project T1-Alg on Github.
The link to his project is in the header of this file since my code
was heavily based on his.
*/
void avl_print_debug(NODE *node, int depth){
if (node == NULL) {
putchar('\n');
return;
}
int i;
for (i = 0; i < depth; i++) putchar('\t');
printf("[%d]\n", node->value);
avl_print_debug(node->left, depth + 1);
avl_print_debug(node->right, depth + 1);
}
/*
Performs an in-order traversal on the tree
and prints the result.
*/
void avl_print_sorted(NODE* node) {
if (node == NULL) return;
avl_print_sorted(node->left);
printf("%d ", node->value);
avl_print_sorted(node->right);
}
/*
Recursively frees the AVL tree.
*/
void free_avl(NODE* node) {
if(node == NULL) return;
free_avl(node->left);
free_avl(node->right);
free(node);
}
/*
You can test the AVL using the main function below.
*/
int main() {
AVL* tree = create_avl();
int op;
int value;
printf("[1] Insert item\n");
printf("[2] Remove item\n");
printf("[3] Print tree\n");
printf("[4] Print sorted\n");
printf("[0] Exit\n\n");
while(scanf("%d", &op), op != 0) {
if(op == 1) {
printf("Insert item: ");
scanf("%d", &value);
insert_avl(tree, value);
} else if(op == 2) {
printf("Remove item: ");
scanf("%d", &value);
remove_avl(tree, value);
} else if(op == 3) {
printf("Printing tree...\n");
avl_print_debug(get_root(tree), 0);
} else if(op == 4) {
printf("Printing sorted items...\n");
avl_print_sorted(get_root(tree));
printf("\n");
}
}
free_avl(get_root(tree));
return 0;
}
|
the_stack_data/192330814.c | #include<stdio.h>
#include<string.h>
//Structure for the linked list
struct node{
struct node *prev;
int roll_no;
char name[70];
float cgpa;
struct node *next;
};
//Pointer to the start
struct node *start=NULL;
//Insertion at the first
void insertFirst()
{
struct node *p,*temp;
p=(struct node *)malloc(sizeof(struct node));
printf("Enter the name of the student:\t");
fflush(stdin);
scanf("%[^\n]s",p->name);
printf("Enter the roll number:\t");
scanf("%d",&p->roll_no);
printf("Enter the CGPA:\t");
scanf("%f",&p->cgpa);
p->next=NULL;
p->prev=NULL;
if(start==NULL){
start=p;
p->next=p;
p->prev=p;
}
else{
temp=start;
while(temp->next!=start)
temp=temp->next;
p->next=start;
p->prev=start->prev;
start->prev=p;
start=p;
temp->next=start;
}
}
//Insertion a the end of the list
void insertLast()
{
struct node *p,*temp;
p=(struct node *)malloc(sizeof(struct node));
printf("Enter the name of the student:\t");
fflush(stdin);
scanf("%[^\n]s",p->name);
printf("Enter the roll number:\t");
scanf("%d",&p->roll_no);
printf("Enter the CGPA:\t");
scanf("%f",&p->cgpa);
p->next=NULL;
if(start==NULL){
start=p;
p->next=p;
}
else{
temp=start;
while(temp->next!=start)
temp=temp->next;
p->next=temp->next;
p->prev=temp;
temp->next=p;
}
}
//Insertion in after the roll number
void insertInbetween()
{
struct node *temp,*p;
int n;
if(start==NULL){
printf("The list is empty\n");
return 0;
}
display();
printf("Enter the roll number after which you want to insert the node:\t");
scanf("%d",&n);
p=(struct node *)malloc(sizeof(struct node));
printf("Enter the name of the student:\t");
fflush(stdin);
scanf("%[^\n]s",p->name);
printf("Enter the roll number:\t");
scanf("%d",&p->roll_no);
printf("Enter the CGPA:\t");
scanf("%f",&p->cgpa);
p->next=NULL;
temp=start;
if(temp->next == temp && temp->roll_no==n)
{
p->next=temp->next;
p->prev=temp;
temp->prev=p;
temp->next=p;
return 0;
}
if(temp->roll_no==n)
{
p->next=temp->next;
p->prev=temp;
temp->next->prev=p;
temp->next=p;
return 0;
}
temp=temp->next;
while(temp!=start && temp->roll_no!=n)
temp=temp->next;
if(temp==start)
printf("There is no such element exist\n");
else{
p->next=temp->next;
p->prev=temp;
temp->next->prev=p;
temp->next=p;
}
}
//Delete the last node
void deleteLast()
{
struct node *temp,*t;
temp=start;
if(start==NULL)
printf("\nList is empty\n");
else if(start->next==start)
{
free(start);
start=NULL;
}
else{
while(temp->next!=start)
{
t=temp;
temp=temp->next;
}
free(t->next);
t->next=start;
start->prev=t;
}
}
//Delete the first node
void deleteFirst()
{
struct node *temp,*t;
t=start;
temp=start;
if(start==NULL)
printf("\nThe list is empty\n");
else if(start->next==start)
{
free(start);
start=NULL;
}
else{
while(temp->next!=start)
temp=temp->next;
start=start->next;
temp->next=start;
start->prev=temp;
free(t);
}
}
//Deletion of the roll number entered
void deleteInbetween()
{
struct node *temp,*t;
int n;
if(start==NULL){
printf("The list is empty\n");
}
display();
printf("Enter the roll number which you want to delete:\t");
scanf("%d",&n);
temp=start;
if(temp->next == temp && temp->roll_no==n)
{
free(temp);
start=NULL;
return 0;
}
if(temp->roll_no==n)
{
t=start;
while(t->next!=start)
t=t->next;
start=start->next;
t->next=start;
start->prev=t;
free(temp);
return 0;
}
t=temp;
temp=temp->next;
while(temp!=start && temp->roll_no!=n)
{
t=temp;
temp=temp->next;
}
if(temp==start)
printf("There is no such element exist\n");
else{
t->next=temp->next;
temp->next->prev=t;
free(temp);
}
}
//Search by the roll number
void searchByRoll()
{
struct node *temp;
int roll;
temp=start;
printf("Enter the roll number:\t");
scanf("%d",&roll);
printf("\n");
while(temp->next!=start)
{
if(temp->roll_no == roll)
{
printf("The Roll no. exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
return 0;
}
temp=temp->next;
}
if(temp->roll_no==roll)
{
printf("The Roll no. exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
return 0;
}
printf("No such element exist\n");
}
//Search by name
void searchByName()
{
struct node *temp;
char name[70];
int count=0;
temp=start;
printf("Enter the name number:\t");
fflush(stdin);
scanf("%[^\n]s",name);
printf("\n");
while(temp->next!=start)
{
if(strcmp(temp->name,name) == 0)
{
printf("The name exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
count++;
}
temp=temp->next;
}
if(strcmp(temp->name,name) == 0)
{
printf("The name exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
count++;
}
if(count==0)
printf("No such element exist\n");
}
//Search by cgpa
void searchByCGPA()
{
struct node *temp;
float cg;
int count=0;
temp=start;
printf("Enter the CGPA number:\t");
scanf("%f",&cg);
while(temp->next!=start)
{
if(temp->cgpa == cg)
{
printf("The CGPA exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
count++;
}
temp=temp->next;
}
if(temp->cgpa == cg)
{
printf("The cgpa exist its details are:\n");
printf("ROLL NO\t\tNAME\t\tCGPA\n");
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
count++;
}
if(count==0)
printf("No such element exist\n");
}
//Display all the elements
void display()
{
struct node *temp;
temp=start;
if(start==NULL)
printf("\nThe list is empty\n");
else{
printf("ROLL NO\t\tNAME\t\tCGPA\n");
while(temp->next!=start)
{
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
temp=temp->next;
}
printf("%d\t\t%s\t\t%f\n",temp->roll_no,temp->name,temp->cgpa);
}
}
//Main
void main()
{
int choice;
while(1)
{
printf("\n==============================\n");
printf("CIRCULAR DOUBLY LINKED LIST\n");
display();
printf("\n");
printf("==============================\n");
printf("1.INSERT AT BEGINNING\n2.INSERT AT END\n3.INSERT IN BETWEEN\n4.DELETE AT BEGINNING\n5.DELETE AT END\n");
printf("6.DELETE IN BETWEEN\n7.SEARCH BY ROLL NUMBER\n8.SEARCH BY NAME\n9.SEARCH BY CGPA\n10.DISPLAY\n11.EXIT\n");
printf("==============================\n");
printf("Choose any one of the above:\t");
scanf("%d",&choice);
switch(choice)
{
case 1: insertFirst();
break;
case 2: insertLast();
break;
case 4: deleteFirst();
break;
case 5: deleteLast();
break;
case 10: display();
break;
case 7: searchByRoll();
break;
case 8: searchByName();
break;
case 9: searchByCGPA();
break;
case 3: insertInbetween();
break;
case 6: deleteInbetween();
break;
default: printf("Invalid choice\n");
break;
case 11: exit(0);
}
}
}
|
the_stack_data/89200988.c | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
char s[100];
scanf("%[^\n]%*c", &s);
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
printf("Hello, World!\n%s\n", s);
return 0;
} |
the_stack_data/3448.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdbool.h>
int main() {
char string[] = "I go to the University of Toronto.";
printf("String: \"%s\"\n", string);
// get the input character from the user
char search;
printf("Enter a character: ");
scanf("%c", &search);
// search for the location of the first instance
// of the character in the string
char *location = strchr(string, search);
// initialize a boolean which will tell us if the
// character has been found anywhere in the string
bool found = false;
// loop until the character is no longer found
while (location != NULL) {
found = true;
// the index location of the character in the string
// is the pointer of the found character in the string
// minus the pointer of the first character
printf("Found at index %ld\n", location - string);
// update the location of the next found character
// starting at the previous location's next character
// (i.e. the pointer location plus 1)
location = strchr(location + 1, search);
}
// if the character was not found, print that
if (!found) {
printf("Character not found.\n");
}
return 0;
}
|
the_stack_data/70451060.c | /* A C program to calculate the sum of every third integer using for loop. */
#include<stdio.h>
int main()
{
int sum = 0;
int i = 0;
for (i = 2; i < 100; i++) {
sum = sum + i;
i = i + 2;
}
printf("The sum is : %d", sum);
}
|
the_stack_data/57951567.c | #ifndef SOBEL2DATA_IMAGE
#define SOBEL2DATA_IMAGE
#include <stdint.h>
const uint8_t ImageHeight = 48;
const uint8_t ImageWidth = 48;
const uint8_t Image[48*48]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,
40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,
45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,
50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,
55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,
60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,
65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,
70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,
75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,
85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,
90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,
95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,
100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,
110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,
120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,
125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,
130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,
135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,
140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,
145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,
155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,
160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,
200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,
215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,
225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
};
#endif
|
the_stack_data/152376.c | /* ========================================================================
* Copyright 1988-2006 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* ========================================================================
*/
/*
* Program: POSIX Signals
*
* Author: Mark Crispin
* Networks and Distributed Computing
* Computing & Communications
* University of Washington
* Administration Building, AG-44
* Seattle, WA 98195
* Internet: [email protected]
*
* Date: 29 April 1997
* Last Edited: 30 August 2006
*/
#include <signal.h>
#include <string.h>
#ifndef SA_RESTART
#define SA_RESTART 0
#endif
/* Arm a signal
* Accepts: signal number
* desired action
* Returns: old action
*/
void *arm_signal (int sig,void *action)
{
struct sigaction nact,oact;
memset (&nact,0,sizeof (struct sigaction));
sigemptyset (&nact.sa_mask); /* no signals blocked */
nact.sa_handler = action; /* set signal handler */
nact.sa_flags = SA_RESTART; /* needed on Linux, nice on SVR4 */
sigaction (sig,&nact,&oact); /* do the signal action */
return (void *) oact.sa_handler;
}
|
the_stack_data/54824017.c | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
int a[10000000];
int main(){
long int i,n;
FILE *fp;
fp = fopen("data_decimal.in","w");
time_t t;
n = 1000000; // 10^6
srand((unsigned) time(&t));
for(i = 0; i < n; i++){
fprintf(fp,"%d",rand() % 10);
}
printf("\nCount %ld",i);
return 0;
}
|
the_stack_data/29825295.c | // @ ltl invariant positive: [](<>AP(n<0));
// (Bool)&(Bool) ==> a!=b/a==b
extern int __VERIFIER_nondet_int() __attribute__ ((__noreturn__));
extern void __VERIFIER_assume() __attribute__ ((__noreturn__));
extern void __VERIFIER_error() __attribute__ ((__noreturn__));
int n;
int x, y, a, b;
int main() {
n = __VERIFIER_nondet_int();
x = __VERIFIER_nondet_int();
y = x-1;
a = 0;
b = 0;
if ((b==1)&(a==1)){
/* if ((b==1)&&(a==1)){ */
n=-1;
} else {
n=1;
__VERIFIER_error();
}
return 0;
}
|
the_stack_data/754408.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2005-2016 Free Software Foundation, Inc.
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 <stdio.h>
#include <stdlib.h>
float b32;
double b64;
long double b128;
int main()
{
b32 = 1.5f;
b64 = 2.25;
b128 = 3.375l;
return 0;
}
|
the_stack_data/193893343.c | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
printf("\\begin{tabular}{lll|lll}\n");
printf("Index & Size & Cubes & Index & Size & Cubes\\\\\\hline\n");
for (int i = 0; i < n; i++) {
printf("%d &", i);
int t;
scanf("%d", &t);
printf("%d &", t);
for (int j = 0; j < t; j++) {
char s[5];
scanf ("%s", s);
printf (" %s", s);
}
if (i % 2 == 0)
printf("&");
else if (i % 2 == 1)
printf("\\\\\n");
}
printf("\\end{tabular}\n");
}
|
the_stack_data/161076707.c | #include<stdio.h>
#include<stdlib.h>
int main(){
float a,b,c,d,e,media,soma;
printf("Digite cinco numeros:\n");
scanf("%f %f %f %f %f",&a,&b,&c,&d,&e);
soma=a+b+c+d+e;
media=soma/5;
printf("\nResultado = %.2f\n", media);
}
|
the_stack_data/125878.c | #include <stdio.h>
void main() {
int num;
int count;
int total;
total = 0;
num = 6;
count = 15;
while(count > 0) { /* Modify this line only */
total = count / num;
printf("%d divided by %d is: %d\n", count, num, total);
count--;
num--;
}
}
|
the_stack_data/162643878.c | // RUN: rm -rf %t
// RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding
// RUN: %clang_cc1 -triple i686-unknown-unknown -fsyntax-only -fmodules -fmodule-map-file=%resource_dir/module.modulemap -fmodules-cache-path=%t %s -verify -ffreestanding
// expected-no-diagnostics
#include<x86intrin.h>
|
the_stack_data/63345.c | /*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not 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.
Any feedback is very welcome.
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
*/
#include <stdio.h>
/* Period parameters */
#define N 624
#define M 397
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
static unsigned long mt[N]; /* the array for the state vector */
static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */
/* initializes mt[N] with a seed */
void init_genrand(unsigned long s)
{
mt[0] = s & 0xffffffffUL;
for (mti = 1; mti < N; mti++)
{
mt[mti] =
(1812433253UL * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array mt[]. */
/* 2002/01/09 modified by Makoto Matsumoto */
mt[mti] &= 0xffffffffUL;
/* for >32 bit machines */
}
}
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
void init_by_array(unsigned long init_key[], int key_length)
{
int i, j, k;
init_genrand(19650218UL);
i = 1;
j = 0;
k = (N > key_length ? N : key_length);
for (; k; k--)
{
mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
j++;
if (i >= N)
{
mt[0] = mt[N - 1];
i = 1;
}
if (j >= key_length)
j = 0;
}
for (k = N - 1; k; k--)
{
mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941UL)) - i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
if (i >= N)
{
mt[0] = mt[N - 1];
i = 1;
}
}
mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0,0xffffffff]-interval */
unsigned long genrand_int32(void)
{
unsigned long y;
static unsigned long mag01[2] = {0x0UL, MATRIX_A};
/* mag01[x] = x * MATRIX_A for x=0,1 */
if (mti >= N)
{ /* generate N words at one time */
int kk;
if (mti == N + 1) /* if init_genrand() has not been called, */
init_genrand(5489UL); /* a default initial seed is used */
for (kk = 0; kk < N - M; kk++)
{
y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
mt[kk] = mt[kk + M] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
for (; kk < N - 1; kk++)
{
y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
mt[kk] = mt[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ mag01[y & 0x1UL];
mti = 0;
}
y = mt[mti++];
/* Tempering */
y ^= (y >> 11);
y ^= (y << 7) & 0x9d2c5680UL;
y ^= (y << 15) & 0xefc60000UL;
y ^= (y >> 18);
return y;
}
/* generates a random number on [0,0x7fffffff]-interval */
long genrand_int31(void)
{
return (long)(genrand_int32() >> 1);
}
/* generates a random number on [0,1]-real-interval */
double genrand_real1(void)
{
return genrand_int32() * (1.0 / 4294967295.0);
/* divided by 2^32-1 */
}
/* generates a random number on [0,1)-real-interval */
double genrand_real2(void)
{
return genrand_int32() * (1.0 / 4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on (0,1)-real-interval */
double genrand_real3(void)
{
return (((double)genrand_int32()) + 0.5) * (1.0 / 4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on [0,1) with 53-bit resolution*/
double genrand_res53(void)
{
unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}
/* These real versions are due to Isaku Wada, 2002/01/09 added */
/*
int main(void)
{
int i;
unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4;
init_by_array(init, length);
printf("1000 outputs of genrand_int32()\n");
for (i=0; i<1000; i++) {
printf("%10lu ", genrand_int32());
if (i%5==4) printf("\n");
}
printf("\n1000 outputs of genrand_real2()\n");
for (i=0; i<1000; i++) {
printf("%10.8f ", genrand_real2());
if (i%5==4) printf("\n");
}
return 0;
}
*/
|
the_stack_data/73574958.c | #include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <pthread.h>
#define MAX 8192
void vul_buffer(char *buffer, int n) {
int i = 0;
for(i; i < n; i++) {
buffer[i] = rand()%26+'a';
}
}
int main(int argc, char **argv) {
srand(time(0));
int i;
char buffer[MAX];
for(i=128; i<=MAX; i*=2) {
double start=clock();
int fd=open("bigfile", O_WRONLY|O_CREAT|O_SYNC);
int tot = 0;
if(fd<0) {
perror(argv[0]);
return 1;
}
while(tot < (10*1024*1024 - i)) {
vul_buffer(buffer, i);
tot += write(fd, buffer, i);
}
vul_buffer(buffer, 10*1024*1024-tot);
write(fd, buffer, 10*1024*1024-tot);
struct stat st;
fstat(fd, &st);
printf("SIZE=%d\n", st.st_size);
if(close(fd)<0) {
perror(argv[0]);
return 1;
}
double time=(clock()-start)/CLOCKS_PER_SEC;
printf("BUF_SIZ=\t %d\tTime=%f\n",i, time);
//delete bigfile
unlink("bigfile");
}
return 0;
}
|
the_stack_data/44403.c | /* { dg-do compile } */
/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
int a[10];
void foo (void)
{
int i;
#pragma omp parallel for schedule(runtime)
for (i = 0; i < 10; i++)
a[i] = i;
#pragma omp parallel
#pragma omp for schedule(runtime)
for (i = 0; i < 10; i++)
a[i] = 10 - i;
#pragma omp parallel
{
#pragma omp for schedule(runtime)
for (i = 0; i < 10; i++)
a[i] = i;
}
}
/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_maybe_nonmonotonic_runtime" 3 "optimized" } } */
|
the_stack_data/122016589.c | #include<stdio.h>
void print_array(int n, int *a){
for(int i=0; i<n; i++)
printf("%d ",*(a+i));
}
void merge(int *a, int lb, int mid, int ub)
{
int sub_array_one=mid-lb+1, sub_array_two=ub-mid;
int left_array[sub_array_one],right_array[sub_array_two];
for (int i=0; i<sub_array_one; i++)
left_array[i]=*(a+lb+i);
for (int j = 0; j < sub_array_two; j++)
right_array[j]=*(a+mid+1+j);
int one=0,two=0,merged_array = lb;
while (one < sub_array_one && two < sub_array_two)
{
if (left_array[one] <= right_array[two])
{
*(a+merged_array) = left_array[one];
one++;
}
else
{
*(a+merged_array)= right_array[two];
two++;
}
merged_array++;
}
while(one<sub_array_one)
{
*(a+merged_array)=left_array[one];
one++;
merged_array++;
}
while(two<sub_array_two)
{
*(a+merged_array)=right_array[two];
two++;
merged_array++;
}
}
void merge_sort(int *a, int lb, int ub)
{
if (lb>=ub)
return;
int mid=lb+(ub-lb)/2;
merge_sort(a, lb, mid);
merge_sort(a, mid + 1,ub);
merge(a,lb, mid, ub);
}
int main()
{
printf("Enter the number of elements you wants : ");
int n;
scanf("%d",&n);
int a[n];
printf("Eenter elements : ");
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
printf("-------------------------------\n");
printf("Array :\n");
for(int i=0;i<n;i++)
printf("%d ",a[i]);
int lb=0,ub=n-1;
merge_sort(a, lb, ub);
printf("\n-------------------------------");
printf("\nSorted Array :\n");
print_array(n, a);
printf("\n-------------------------------\n");
return 0;
}
|
the_stack_data/83603.c | #include<stdio.h>
int main()
{
int n;
printf("Enter a number: ");
scanf("%d",&n);
if ((n|1)==(n+1))
{
printf("%d is even\n",n);
}
else
{
printf("%d is odd.\n",n);
}
return 0;
}
|
the_stack_data/1132263.c | #include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#define BUFSIZE 256
void parser( char *p, char **args)
{
// kazalc p bomo povecevali
while ( *p != '\0') // Lahko bi dali tudi kar 0
{
while ( *p == ' ' || *p == '\t') // Prazen znak
*p++ = '\0';
if (*p != 0)
*args++ = p;
while ( *p != ' ' && *p != '\t' && *p != '\0') // Poln znak
p++;
// printf("%s\n", *args);
}
*args = (char *)0;
}
void main()
{
pid_t pid;
char buf[BUFSIZE];
char *args[50];
printf("$ "); // prompt
while ( fgets(buf, BUFSIZE, stdin) != NULL)
{
buf[strlen(buf)-1] = '\0';
parser( buf, args);
for (int i = 0; args[i]; i++)
{
puts(args[i]);
}
if ( (pid = fork()) < 0)
{
perror("fork");
}
else if (pid == 0){ //otrok
execvp( args[0], args);
printf("ne morem izvesti ukaza.\n");
exit(127);
}
}
} |
the_stack_data/145451955.c | #include <stdio.h>
#include <time.h>
#include<string.h>
int main(int argc, char const *argv[])
{
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
//printf ( "%s", asctime (timeinfo) );
char buf[270]={0};
memset(buf,0,270);
strftime(buf,270,"%a, %d %b %Y %T +0530 ",timeinfo);
puts(buf);
return 0;
} |
the_stack_data/583812.c |
#include<stdio.h>
main()
{
int phone;
printf("enter the price of phone\n");
scanf("%d",&phone);
if(phone==10000)
{
printf("phone can be puchased\n");
}
}
|
the_stack_data/115764223.c | #include <stdio.h>
#include <string.h>
/*
#include <string.h>
void *memset(void *str, int c, size_t n)
description:
复制字符 c(一个无符号字符)到参数 str 所指向的字符串的前 n 个字符。
params:
str -- 指向要填充的内存块。
c -- 要被设置的值。该值以 int 形式传递,但是函数在填充内存块时是使用该值的无符号字符形式。
n -- 要被设置为该值的字符数。
retrun value:
该值返回一个指向存储区 str 的指针。
**/
int main () {
char str[50];
strcpy(str,"This is string.h library function");
puts(str);
memset(str,'$',7);
puts(str);
return(0);
}
|
the_stack_data/1026307.c | // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify %s
// expected-no-diagnostics
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
int printf(const char *restrict,...);
typedef unsigned long UInt32;
typedef signed long SInt32;
typedef SInt32 OSStatus;
typedef unsigned char Boolean;
enum { noErr = 0};
typedef const void *CFTypeRef;
typedef const struct __CFString *CFStringRef;
typedef const struct __CFAllocator *CFAllocatorRef;
extern void CFRelease(CFTypeRef cf);
typedef UInt32 CFStringEncoding;
enum { kCFStringEncodingMacRoman = 0, kCFStringEncodingWindowsLatin1 = 0x0500,
kCFStringEncodingISOLatin1 = 0x0201, kCFStringEncodingNextStepLatin = 0x0B01,
kCFStringEncodingASCII = 0x0600, kCFStringEncodingUnicode = 0x0100,
kCFStringEncodingUTF8 = 0x08000100, kCFStringEncodingNonLossyASCII = 0x0BFF,
kCFStringEncodingUTF16 = 0x0100, kCFStringEncodingUTF16BE = 0x10000100,
kCFStringEncodingUTF16LE = 0x14000100, kCFStringEncodingUTF32 = 0x0c000100,
kCFStringEncodingUTF32BE = 0x18000100, kCFStringEncodingUTF32LE = 0x1c000100};
extern CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
enum { memROZWarn = -99, memROZError = -99, memROZErr = -99, memFullErr = -108,
nilHandleErr = -109, memWZErr = -111, memPurErr = -112, memAdrErr = -110,
memAZErr = -113, memPCErr = -114, memBCErr = -115, memSCErr = -116, memLockedErr = -117};
#define DEBUG1
void DebugStop(const char *format,...);
void DebugTraceIf(unsigned int condition, const char *format,...);
Boolean DebugDisplayOSStatusMsg(OSStatus status, const char *statusStr, const char *fileName, unsigned long lineNumber);
#define Assert(condition)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); }
#define AssertMsg(condition, message)if (!(condition)) { DebugStop("Assertion failure: %s (%s) [File: %s, Line: %lu]", #condition, message, __FILE__, __LINE__); }
#define Require(condition)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); }
#define RequireAction(condition, action)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); action }
#define RequireActionSilent(condition, action)if (!(condition)) { action }
#define AssertNoErr(err){ DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__); }
#define RequireNoErr(err, action){ if( DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__) ) { action }}
void DebugStop(const char *format,...); /* Not an abort function. */
int main(int argc, char *argv[]) {
CFStringRef cfString;
OSStatus status = noErr;
cfString = CFStringCreateWithCString(0, "hello", kCFStringEncodingUTF8);
RequireAction(cfString != 0, return memFullErr;) //no - warning
printf("cfstring %p\n", cfString);
Exit:
CFRelease(cfString);
return 0;
}
|
the_stack_data/310179.c | int main()
{
{
unsigned i, j, k, l;
j=k;
i=j/2;
l=j>>1;
assert(i==l);
j=k;
i=j%2;
l=j&1;
assert(i==l);
}
{
signed int i, j, k, l;
// shifting rounds into the wrong direction
__CPROVER_assume(!(k&1));
j=k;
i=j/2;
l=j>>1;
assert(i==l);
j=k;
i=j%2;
l=j&1;
assert(i==l);
}
}
|
the_stack_data/16816.c | /*-*/
/********************************************************
* Name: Calculator (Version 0 -- prototype) *
* *
* Purpose: *
* Act like a simple 4 function calculator. *
* *
* Usage: *
* Run the program. *
* Type in an operator (+ - * /) and a number. *
* The operaton will be performed on the current *
* result and a new result displayed. *
* *
* Note: *
* This is the first attempt at doing this program.*
* It only works for + and because of a bug, even *
* that fails. *
********************************************************/
/*+*/
#include <stdio.h>
char line[100];/* line of data from the input */
int result; /* the result of the calculations */
char operator; /* operator the user specified */
int value; /* value specified after the operator */
int main()
{
result = 0; /* initialize the result */
/* Loop forever (or till we hit the break statement) */
while (1) {
printf("Result: %d\n", result);
printf("Enter operator and number: ");
fgets(line, sizeof(line), stdin);
sscanf(line, "%c %d", &operator, &value);
if (operator = '+') {
result += value;
} else {
printf("Unknown operator %c\n", operator);
}
}
}
|
the_stack_data/29826140.c | #include <stdio.h>
#include <stdlib.h>
/* função para mostrar helloworld! */
int main()
{
printf("Hello, World!\n");
printf("Hello, World!\n");
return 0;
} |
the_stack_data/125140742.c | #define ER_LAST_ERROR -1132
void foobar()
{
// The problem is tha this is unparsed as:
// int ignore_error_list[--1132];
// which implies the use of the decrement operator.
// int ignore_error_list[-ER_LAST_ERROR];
int ignore_error_list[-ER_LAST_ERROR];
int x;
x = - -x;
x = - -5;
x = -ER_LAST_ERROR;
int y[- -5];
}
|
the_stack_data/138969.c | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
#include "pthread.h"
#define assert(e) { if(!(e)) { ERROR: __VERIFIER_error();(void)0; } }
_Bool s = 0;
__thread _Bool l = 0;
void* thr1(void* arg)
{
/* reachable */
/* assert not proved */
assert(!l || s);
/* reachable */
s = s || 1;
l = 1; //overapproximates
return 0;
}
int main()
{
pthread_t t;
/* reachable */
while(1) /* reachable */
pthread_create(&t, 0, thr1, 0);
/* UNREACHABLE */
}
|
the_stack_data/1415.c | #include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<pthread.h>
#include<strings.h>
void *Voterx(void *args){
char fname[50];
char lname[50];
char email[50];
char dep[50];
char soo[50];
char crep[50];
int level;
float cgpa;
printf("\t\t\tVoterX\n");
printf("Welcome to VoterX\n");
printf("Please provide the following details\n");
printf("\n First Name : ");
scanf("%s", fname);
printf("\nLast Name : ");
scanf("%s", lname);
printf("\nEmail : ");
scanf("%s", email);
printf("\nDepartment : ");
scanf("%s", dep);
printf("\nState of Origin : ");
scanf("%s", soo);
printf("\nOkay now please answer the following: ");
printf("\nAre you a Class Representative?");
scanf("%s", crep);
printf("\nWhat level are you? : ");
scanf("%d",&level);
printf("What is your current CGPA? : ");
scanf("%f",&cgpa);
if (crep == "Yes"||crep =="YES"||crep =="yes"||crep =="YEs"||crep == "yES" && level==300||level==200||level==400 && cgpa > 4.0){
printf("%s %s\n%s\n%s\n%s State\nYou can vote.",fname,lname,email,dep,soo);
}
else{
printf("Sorry you are not eligible to vote.\n");
}
return NULL;
}
void *Pubtaks(void* args){
char pname[50];
int papers;
Pubtaks:
printf("\t\t\tPubtaks\n");
printf("Welcome to Pubtaks\n");
printf("Please enter your last name \n");
printf("\nName : ");
scanf("%s", pname);
printf("\nHow many papers have you published? ");
scanf("%d",&papers);
if (papers<3){
printf("\nMr %s,your incentive is N100,000",pname);
}
else if (3<=papers<=5){
printf("\nMr %s,your incentive is N500,000",pname);
}
else if (6<=papers<10){
printf("\nMr %s,your incentive is N800,000",pname);
}
else if (papers>=10){
printf("\nMr %s,your incentive is N1,000,000",pname);
}
return NULL;
}
int main(){
int opt;
int p,i,a;
pthread_t voterx;
pthread_t pubtaks;
start:
printf("For VoterX, please press 1.\n For PubTaks, please press 2.");
scanf("%d",&opt);
if(opt == 1){
pthread_create(&voterx, NULL, &Voterx,NULL);
pthread_exit(NULL);
}
else if(opt == 2){
pthread_create(&pubtaks, NULL, &Pubtaks,NULL);
pthread_exit(NULL);
}
else{
printf("Invalid entry.\n");
goto start;
return 0;
}
}
|
the_stack_data/59512.c | /*
* Copyright (c) [2019] Huawei Technologies Co.,Ltd.All rights reverved.
*
* OpenArkCompiler is licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at:
*
* http://license.coscl.org.cn/MulanPSL
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
* FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v1 for more details.
*/
/*
* minigzip is a minimal implementation of the gzip utility. This is
* only an example of using zlib and isn't meant to replace the
* full-featured gzip. No attempt is made to deal with file systems
* limiting names to 14 or 8+3 characters, etc... Error checking is
* very limited. So use minigzip only for testing; use gzip for the
* real thing. On MSDOS, use only on file names without extension
* or in pipe mode.
*/
/* @(#) $Id$ */
#include "zlib.h"
#include <stdio.h>
#ifdef STDC
# include <string.h>
# include <stdlib.h>
#endif
#ifdef USE_MMAP
# include <sys/types.h>
# include <sys/mman.h>
# include <sys/stat.h>
#endif
#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# ifdef UNDER_CE
# include <stdlib.h>
# endif
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#else
# define SET_BINARY_MODE(file)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
#endif
#ifdef VMS
# define unlink delete
# define GZ_SUFFIX "-gz"
#endif
#ifdef RISCOS
# define unlink remove
# define GZ_SUFFIX "-gz"
# define fileno(file) file->__file
#endif
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fileno */
#endif
#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
extern int unlink OF((const char *));
#endif
#endif
#if defined(UNDER_CE)
# include <windows.h>
# define perror(s) pwinerror(s)
/* Map the Windows error number in ERROR to a locale-dependent error
message string and return a pointer to it. Typically, the values
for ERROR come from GetLastError.
The string pointed to shall not be modified by the application,
but may be overwritten by a subsequent call to strwinerror
The strwinerror function does not change the current setting
of GetLastError. */
static char *strwinerror (error)
DWORD error;
{
static char buf[1024];
wchar_t *msgbuf;
DWORD lasterr = GetLastError();
DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL,
error,
0, /* Default language */
(LPVOID)&msgbuf,
0,
NULL);
if (chars != 0) {
/* If there is an \r\n appended, zap it. */
if (chars >= 2
&& msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
chars -= 2;
msgbuf[chars] = 0;
}
if (chars > sizeof (buf) - 1) {
chars = sizeof (buf) - 1;
msgbuf[chars] = 0;
}
wcstombs(buf, msgbuf, chars + 1);
LocalFree(msgbuf);
}
else {
sprintf(buf, "unknown win32 error (%ld)", error);
}
SetLastError(lasterr);
return buf;
}
static void pwinerror (s)
const char *s;
{
if (s && *s)
fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ()));
else
fprintf(stderr, "%s\n", strwinerror(GetLastError ()));
}
#endif /* UNDER_CE */
#ifndef GZ_SUFFIX
# define GZ_SUFFIX ".gz"
#endif
#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
#define BUFLEN 16384
#define MAX_NAME_LEN 1024
#ifdef MAXSEG_64K
# define local static
/* Needed for systems with limitation on stack size. */
#else
# define local
#endif
#ifdef Z_SOLO
/* for Z_SOLO, create simplified gz* functions using deflate and inflate */
#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
# include <unistd.h> /* for unlink() */
#endif
void *myalloc OF((void *, unsigned, unsigned));
void myfree OF((void *, void *));
void *myalloc(q, n, m)
void *q;
unsigned n, m;
{
(void)q;
return calloc(n, m);
}
void myfree(q, p)
void *q, *p;
{
(void)q;
free(p);
}
typedef struct gzFile_s {
FILE *file;
int write;
int err;
char *msg;
z_stream strm;
} *gzFile;
gzFile gzopen OF((const char *, const char *));
gzFile gzdopen OF((int, const char *));
gzFile gz_open OF((const char *, int, const char *));
gzFile gzopen(path, mode)
const char *path;
const char *mode;
{
return gz_open(path, -1, mode);
}
gzFile gzdopen(fd, mode)
int fd;
const char *mode;
{
return gz_open(NULL, fd, mode);
}
gzFile gz_open(path, fd, mode)
const char *path;
int fd;
const char *mode;
{
gzFile gz;
int ret;
gz = malloc(sizeof(struct gzFile_s));
if (gz == NULL)
return NULL;
gz->write = strchr(mode, 'w') != NULL;
gz->strm.zalloc = myalloc;
gz->strm.zfree = myfree;
gz->strm.opaque = Z_NULL;
if (gz->write)
ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0);
else {
gz->strm.next_in = 0;
gz->strm.avail_in = Z_NULL;
ret = inflateInit2(&(gz->strm), 15 + 16);
}
if (ret != Z_OK) {
free(gz);
return NULL;
}
gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
fopen(path, gz->write ? "wb" : "rb");
if (gz->file == NULL) {
gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm));
free(gz);
return NULL;
}
gz->err = 0;
gz->msg = "";
return gz;
}
int gzwrite OF((gzFile, const void *, unsigned));
int gzwrite(gz, buf, len)
gzFile gz;
const void *buf;
unsigned len;
{
z_stream *strm;
unsigned char out[BUFLEN];
if (gz == NULL || !gz->write)
return 0;
strm = &(gz->strm);
strm->next_in = (void *)buf;
strm->avail_in = len;
do {
strm->next_out = out;
strm->avail_out = BUFLEN;
(void)deflate(strm, Z_NO_FLUSH);
fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
} while (strm->avail_out == 0);
return len;
}
int gzread OF((gzFile, void *, unsigned));
int gzread(gz, buf, len)
gzFile gz;
void *buf;
unsigned len;
{
int ret;
unsigned got;
unsigned char in[1];
z_stream *strm;
if (gz == NULL || gz->write)
return 0;
if (gz->err)
return 0;
strm = &(gz->strm);
strm->next_out = (void *)buf;
strm->avail_out = len;
do {
got = fread(in, 1, 1, gz->file);
if (got == 0)
break;
strm->next_in = in;
strm->avail_in = 1;
ret = inflate(strm, Z_NO_FLUSH);
if (ret == Z_DATA_ERROR) {
gz->err = Z_DATA_ERROR;
gz->msg = strm->msg;
return 0;
}
if (ret == Z_STREAM_END)
inflateReset(strm);
} while (strm->avail_out);
return len - strm->avail_out;
}
int gzclose OF((gzFile));
int gzclose(gz)
gzFile gz;
{
z_stream *strm;
unsigned char out[BUFLEN];
if (gz == NULL)
return Z_STREAM_ERROR;
strm = &(gz->strm);
if (gz->write) {
strm->next_in = Z_NULL;
strm->avail_in = 0;
do {
strm->next_out = out;
strm->avail_out = BUFLEN;
(void)deflate(strm, Z_FINISH);
fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
} while (strm->avail_out == 0);
deflateEnd(strm);
}
else
inflateEnd(strm);
fclose(gz->file);
free(gz);
return Z_OK;
}
const char *gzerror OF((gzFile, int *));
const char *gzerror(gz, err)
gzFile gz;
int *err;
{
*err = gz->err;
return gz->msg;
}
#endif
static char *prog;
void error OF((const char *msg));
void gz_compress OF((FILE *in, gzFile out));
#ifdef USE_MMAP
int gz_compress_mmap OF((FILE *in, gzFile out));
#endif
void gz_uncompress OF((gzFile in, FILE *out));
void file_compress OF((char *file, char *mode));
void file_uncompress OF((char *file));
int main OF((int argc, char *argv[]));
/* ===========================================================================
* Display error message and exit
*/
void error(msg)
const char *msg;
{
fprintf(stderr, "%s: %s\n", prog, msg);
exit(1);
}
/* ===========================================================================
* Compress input to output then close both files.
*/
void gz_compress(in, out)
FILE *in;
gzFile out;
{
local char buf[BUFLEN];
int len;
int err;
#ifdef USE_MMAP
/* Try first compressing with mmap. If mmap fails (minigzip used in a
* pipe), use the normal fread loop.
*/
if (gz_compress_mmap(in, out) == Z_OK) return;
#endif
for (;;) {
len = (int)fread(buf, 1, sizeof(buf), in);
if (ferror(in)) {
perror("fread");
exit(1);
}
if (len == 0) break;
if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
}
fclose(in);
if (gzclose(out) != Z_OK) error("failed gzclose");
}
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <[email protected]> */
/* Try compressing the input file at once using mmap. Return Z_OK if
* if success, Z_ERRNO otherwise.
*/
int gz_compress_mmap(in, out)
FILE *in;
gzFile out;
{
int len;
int err;
int ifd = fileno(in);
caddr_t buf; /* mmap'ed buffer for the entire input file */
off_t buf_len; /* length of the input file */
struct stat sb;
/* Determine the size of the file, needed for mmap: */
if (fstat(ifd, &sb) < 0) return Z_ERRNO;
buf_len = sb.st_size;
if (buf_len <= 0) return Z_ERRNO;
/* Now do the actual mmap: */
buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
if (buf == (caddr_t)(-1)) return Z_ERRNO;
/* Compress the whole file at once: */
len = gzwrite(out, (char *)buf, (unsigned)buf_len);
if (len != (int)buf_len) error(gzerror(out, &err));
munmap(buf, buf_len);
fclose(in);
if (gzclose(out) != Z_OK) error("failed gzclose");
return Z_OK;
}
#endif /* USE_MMAP */
/* ===========================================================================
* Uncompress input to output then close both files.
*/
void gz_uncompress(in, out)
gzFile in;
FILE *out;
{
local char buf[BUFLEN];
int len;
int err;
for (;;) {
len = gzread(in, buf, sizeof(buf));
if (len < 0) error (gzerror(in, &err));
if (len == 0) break;
if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
error("failed fwrite");
}
}
if (fclose(out)) error("failed fclose");
if (gzclose(in) != Z_OK) error("failed gzclose");
}
/* ===========================================================================
* Compress the given file: create a corresponding .gz file and remove the
* original.
*/
void file_compress(file, mode)
char *file;
char *mode;
{
local char outfile[MAX_NAME_LEN];
FILE *in;
gzFile out;
if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
fprintf(stderr, "%s: filename too long\n", prog);
exit(1);
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
#else
strcpy(outfile, file);
strcat(outfile, GZ_SUFFIX);
#endif
in = fopen(file, "rb");
if (in == NULL) {
perror(file);
exit(1);
}
out = gzopen(outfile, mode);
if (out == NULL) {
fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
exit(1);
}
gz_compress(in, out);
unlink(file);
}
/* ===========================================================================
* Uncompress the given file and remove the original.
*/
void file_uncompress(file)
char *file;
{
local char buf[MAX_NAME_LEN];
char *infile, *outfile;
FILE *out;
gzFile in;
unsigned len = strlen(file);
if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
fprintf(stderr, "%s: filename too long\n", prog);
exit(1);
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(buf, sizeof(buf), "%s", file);
#else
strcpy(buf, file);
#endif
if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
infile = file;
outfile = buf;
outfile[len-3] = '\0';
} else {
outfile = file;
infile = buf;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
#else
strcat(infile, GZ_SUFFIX);
#endif
}
in = gzopen(infile, "rb");
if (in == NULL) {
fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
exit(1);
}
out = fopen(outfile, "wb");
if (out == NULL) {
perror(file);
exit(1);
}
gz_uncompress(in, out);
unlink(infile);
}
/* ===========================================================================
* Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
* -c : write to standard output
* -d : decompress
* -f : compress with Z_FILTERED
* -h : compress with Z_HUFFMAN_ONLY
* -r : compress with Z_RLE
* -1 to -9 : compression level
*/
int main(argc, argv)
int argc;
char *argv[];
{
int copyout = 0;
int uncompr = 0;
gzFile file;
char *bname, outmode[20];
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
#else
strcpy(outmode, "wb6 ");
#endif
prog = argv[0];
bname = strrchr(argv[0], '/');
if (bname)
bname++;
else
bname = argv[0];
argc--, argv++;
if (!strcmp(bname, "gunzip"))
uncompr = 1;
else if (!strcmp(bname, "zcat"))
copyout = uncompr = 1;
while (argc > 0) {
if (strcmp(*argv, "-c") == 0)
copyout = 1;
else if (strcmp(*argv, "-d") == 0)
uncompr = 1;
else if (strcmp(*argv, "-f") == 0)
outmode[3] = 'f';
else if (strcmp(*argv, "-h") == 0)
outmode[3] = 'h';
else if (strcmp(*argv, "-r") == 0)
outmode[3] = 'R';
else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
(*argv)[2] == 0)
outmode[2] = (*argv)[1];
else
break;
argc--, argv++;
}
if (outmode[3] == ' ')
outmode[3] = 0;
if (argc == 0) {
SET_BINARY_MODE(stdin);
SET_BINARY_MODE(stdout);
if (uncompr) {
file = gzdopen(fileno(stdin), "rb");
if (file == NULL) error("can't gzdopen stdin");
gz_uncompress(file, stdout);
} else {
file = gzdopen(fileno(stdout), outmode);
if (file == NULL) error("can't gzdopen stdout");
gz_compress(stdin, file);
}
} else {
if (copyout) {
SET_BINARY_MODE(stdout);
}
do {
if (uncompr) {
if (copyout) {
file = gzopen(*argv, "rb");
if (file == NULL)
fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv);
else
gz_uncompress(file, stdout);
} else {
file_uncompress(*argv);
}
} else {
if (copyout) {
FILE * in = fopen(*argv, "rb");
if (in == NULL) {
perror(*argv);
} else {
file = gzdopen(fileno(stdout), outmode);
if (file == NULL) error("can't gzdopen stdout");
gz_compress(in, file);
}
} else {
file_compress(*argv, outmode);
}
}
} while (argv++, --argc);
}
return 0;
}
|
the_stack_data/145453908.c | #define _GNU_SOURCE
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
const int max_password_value = 500000;
const char cmd_format[300] = "unzip -P%d -t %s 2>&1";
FILE *popen(const char *command, const char *type);
int main(int argc, char **argv) {
FILE *fp;
FILE *input;
char filename[100];
char ret[200];
char cmd[400];
double t;
int nt, i;
int stopFlag = 0;
if (argc < 2) {
fprintf(stderr, "Error: missing path to input file\n");
return 1;
}
if ((input = fopen(argv[1], "r")) == NULL) {
fprintf(stderr, "Error: could not open file\n");
return 1;
}
// Read inputs
fscanf(input, "%d", &nt);
fscanf(input, "%s", filename);
// Do not touch this line
omp_set_num_threads(nt);
t = omp_get_wtime();
# pragma omp parallel
{
# pragma omp single
{
for (i = 0; i < max_password_value || stopFlag == 0; i++) {
sprintf((char *)&cmd, cmd_format, i, filename);
fp = popen(cmd, "r");
int auxVar = i;
# pragma omp task firstprivate(auxVar) shared(i, stopFlag, ret, fp)
{
while (!feof(fp)) {
fgets((char *)&ret, 200, fp);
if (strcasestr(ret, "ok") != NULL) {
printf("Password: %d\n", auxVar);
i = 500000;
stopFlag = 1;
}
}
pclose(fp);
}
}
}
}
t = omp_get_wtime() - t;
fprintf(stderr, "%lf\n", t);
} |
the_stack_data/211080108.c | /* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-O1" } */
int a, c;
void f(long long p)
{
long long b;
if(b)
b = p ? : 0;
for (; p; p++)
p *= a & (c = p *= !a < 2);
a = b += !(b & 3740917449u);
}
|
the_stack_data/93887098.c | /* **********************************************************
* Copyright (c) 2007-2008 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * 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 VMware, Inc. 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 VMWARE, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#ifdef WINDOWS
# include <windows.h>
# define EXPORT __declspec(dllexport)
char *get_systemroot(char** env)
{
const char sroot[] = "SYSTEMROOT=";
int len = sizeof(sroot)-1;
int i;
for (i=0; env[i] != NULL; i++) {
if (!strncmp(env[i], sroot, len)) {
return env[i] + len;
}
}
return "C:\\WINDOWS";
}
#else
# define EXPORT __attribute__((visibility("default")))
#endif
EXPORT
void start_monitor()
{}
EXPORT
void stop_monitor()
{}
#ifdef WINDOWS
void create_proc(char *cmd, char *cmdline, STARTUPINFO *sinfo)
{
PROCESS_INFORMATION pinfo;
if (!CreateProcess(cmd, /* application name */
cmdline, /* command line */
NULL, /* new proc cannot be inherited */
NULL, /* new thread cannot be inherited */
TRUE, /* inherit handles from this proc */
0, /* no creation flags */
NULL, /* use environment of this proc */
NULL, /* same directory of this proc */
sinfo, /* start up info */
&pinfo /* out: process information */
)) {
fprintf(stderr, "ERROR creating new process: %s %s\n", cmd, cmdline);
exit(1);
}
}
#endif
int
main(int argc, char** argv, char** env)
{
#ifdef WINDOWS
STARTUPINFO sinfo;
/* This test prints out all system calls. Creating a new process
* seems to be a good way to cause a bunch of them to execute.
* Launch cmd.exe /c exit.
*/
char cmd[MAX_PATH];
char *cmdline = "/c exit";
sprintf(cmd, "%s\\system32\\cmd.exe", get_systemroot(env));
/* It seems that CreateProcess follows a slightly different
* control-flow when executing the first time under DR vs.
* native. This phenomenon is probably due to DR calling certain
* ntdll routines itself. We'll just call CreateProcess twice and
* trace the system calls for the 2nd invocation only.
*/
GetStartupInfo(&sinfo);
create_proc(cmd, cmdline, &sinfo);
#endif
/* dummy marker to inform client lib to start monitoring */
start_monitor();
#ifdef WINDOWS
create_proc(cmd, cmdline, &sinfo);
#else
/* for linux this is really just a module iterator and dr_get_proc_address
* test; strace.* does syscall testing
*/
fprintf(stderr, "syscall.c test\n");
#endif
/* dummy marker to inform client lib to stop monitoring */
stop_monitor();
return 0;
}
|
the_stack_data/126702333.c | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n = 0;
// n from file read, internet, user input, etc.
return 0;
} |
the_stack_data/60090.c | /* uECC_platform_specific.c - Implementation of platform specific functions*/
/* Copyright (c) 2014, Kenneth MacKay
* 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.
*
* 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 HOLDER 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.*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* uECC_platform_specific.c -- Implementation of platform specific functions
*/
#if defined(unix) || defined(__linux__) || defined(__unix__) || \
defined(__unix) | (defined(__APPLE__) && defined(__MACH__)) || \
defined(uECC_POSIX)
/* Some POSIX-like system with /dev/urandom or /dev/random. */
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
int default_CSPRNG(uint8_t *dest, unsigned int size)
{
/* input sanity check: */
if (dest == (uint8_t *) 0 || (size <= 0)) {
return 0;
}
int fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
if (fd == -1) {
fd = open("/dev/random", O_RDONLY | O_CLOEXEC);
if (fd == -1) {
return 0;
}
}
char *ptr = (char *)dest;
size_t left = (size_t) size;
while (left > 0) {
ssize_t bytes_read = read(fd, ptr, left);
if (bytes_read <= 0) { // read failed
close(fd);
return 0;
}
left -= bytes_read;
ptr += bytes_read;
}
close(fd);
return 1;
}
#endif /* platform */
|
the_stack_data/92325847.c | //
// Sample Code:
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define DEBUG_CORRECTNESS
void pre_Initializing_Input_Tensors();
void post_Correctness();
//
// abcd-dbea-ec
// t3 [a,16,b,16,c,16,d,16] += sum(e,16) * t2 [d,b,e,a] * v2 [e,c];
//
int main(int argc, char** argv)
{
// for sd2
double *host_C, *host_C_chk;
double *host_A;
double *host_B;
int size_idx_a, size_idx_b, size_idx_c, size_idx_d, size_idx_e;
// Problem Size
size_idx_a = 16;
size_idx_b = 16;
size_idx_c = 16;
size_idx_d = 16;
size_idx_e = 16;
//
if (argc == 6)
{
size_idx_a = atoi(argv[1]);
size_idx_b = atoi(argv[2]);
size_idx_c = atoi(argv[3]);
size_idx_d = atoi(argv[4]);
size_idx_e = atoi(argv[5]);
}
int size_C;
int size_A;
int size_B;
int size_internal;
// abcd-dbea-ec
// t3 [a,16,b,16,c,16,d,16] += sum(e,16) * t2 [d,b,e,a] * v2 [e,c];
size_internal = size_idx_e;
size_C = size_idx_a * size_idx_b * size_idx_c * size_idx_d;
size_A = size_idx_d * size_idx_b * size_idx_e * size_idx_a;
size_B = size_idx_e * size_idx_c;
//
host_C = (double*)malloc(sizeof(double) * size_C);
host_C_chk = (double*)malloc(sizeof(double) * size_C);
host_A = (double*)malloc(sizeof(double) * size_A);
host_B = (double*)malloc(sizeof(double) * size_B);
printf ("==========================================================================================================\n");
printf (">>> abcd-dbea-ec\n");
printf (">>> t3 [a,16,b,16,c,16,d,16] += sum(e,16) * t2 [d,b,e,a] * v2 [e,c];\n");
printf (">>> Problem Size (a,b,c,d) and (e): (%2d,%2d,%2d,%2d) and (%2d)\n", size_idx_a, size_idx_b, size_idx_c, size_idx_d, size_idx_e);
printf ("==========================================================================================================\n");
//
// Initialze "1" Output and "2 x 9" Inputs
pre_Initializing_Input_Tensors(host_C, host_C_chk, size_C, host_A, size_A, host_B, size_B);
// Run the Kernels
sd_t_d2_fusion_(size_idx_a, size_idx_b, size_idx_c, size_idx_d, size_idx_e, host_C, host_A, host_B, 1, -1);
#ifdef DEBUG_CORRECTNESS
// Correctness-Check
post_Correctness(host_C, host_C_chk, host_A, host_B, size_idx_a, size_idx_b, size_idx_c, size_idx_d, size_idx_e);
#endif
// Free
free(host_C); free(host_C_chk);
free(host_A);
free(host_B);
return 0;
}
// Initialize t3 (t3_temp), 9 t2 and 9 v2.
void pre_Initializing_Input_Tensors(double* h_C, double* h_C_chk, int size_C, double* h_A, int size_A, double* h_B, int size_B)
{
// t3
int i, j;
for (i = 0; i < size_C; i++)
{
h_C[i] = 0.0;
h_C_chk[i] = 0.0;
}
for (j = 0; j < size_A; j++)
{
h_A[j] = ((double)rand() / RAND_MAX);
}
for (j = 0; j < size_B; j++)
{
h_B[j] = ((double)rand() / RAND_MAX);
}
}
//
void post_Correctness(double* h_C, double* h_C_chk, double* h_A, double* h_B, int size_idx_a, int size_idx_b, int size_idx_c, int size_idx_d, int size_idx_e)
{
// abcd-dbea-ec
// t3 [a,16,b,16,c,16,d,16] += sum(e,16) * t2 [d,b,e,a] * v2 [e,c];
int size_C = size_idx_a * size_idx_b * size_idx_c * size_idx_d;
long long int tmp_ops = 0;
int ops = 0;
int idx_a, idx_b, idx_c, idx_d, idx_e, idx_f;
for (idx_a = 0; idx_a < size_idx_a; idx_a++)
for (idx_b = 0; idx_b < size_idx_b; idx_b++)
for (idx_c = 0; idx_c < size_idx_c; idx_c++)
for (idx_d = 0; idx_d < size_idx_d; idx_d++)
{
// 4D Output --- [a,b,c,d]
int tmp_r_idx = idx_a + (idx_b + (idx_c + (idx_d) * size_idx_c) * size_idx_b) * size_idx_a;
ops = 0;
for (idx_e = 0; idx_e < size_idx_e; idx_e++)
{
h_C_chk[tmp_r_idx] += h_A[idx_d + (idx_b + (idx_e + (idx_a) * size_idx_e) * size_idx_b) * size_idx_d] *
h_B[idx_e + (idx_c) * size_idx_e];
ops++;
}
tmp_ops = tmp_ops + ops;
}
printf ("======================================= Correctness Check ==========================================\n");
double epsilon = 0.00000001;
int diff = 0;
int same = 0;
int i;
for (i = 0; i < size_C; i++)
{
double check = h_C_chk[i] - h_C[i];
if (check < 0) check *= -1;
if (check > epsilon)
{
diff++;
if (diff < 8)
printf ("Index: %5d, (Host) %8.4f, (Dev.) %8.4f >> (Diff.) %8.4f\n", i, h_C_chk[i], h_C[i], check);
}
else
{
same++;
}
}
printf (" >>> PASSED: %'10d among %'10d in t3\n", same, size_C);
printf (" >>> ERROR : %'10d among %'10d in t3\n", diff, size_C);
printf (" >>> Total Operations: %'lld\n", tmp_ops * 2);
printf ("====================================================================================================\n");
}
|
the_stack_data/9514162.c | // WARNING in idr_destroy
// https://syzkaller.appspot.com/bug?id=f70ba0e64248a0d67cdeb2a69acee75eb3288fe4
// status:open
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <linux/futex.h>
unsigned long long procid;
static void sleep_ms(uint64_t ms)
{
usleep(ms * 1000);
}
static uint64_t current_time_ms(void)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts))
exit(1);
return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
}
static void thread_start(void* (*fn)(void*), void* arg)
{
pthread_t th;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 128 << 10);
int i;
for (i = 0; i < 100; i++) {
if (pthread_create(&th, &attr, fn, arg) == 0) {
pthread_attr_destroy(&attr);
return;
}
if (errno == EAGAIN) {
usleep(50);
continue;
}
break;
}
exit(1);
}
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (ev->state)
exit(1);
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
static int event_isset(event_t* ev)
{
return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE);
}
static int event_timedwait(event_t* ev, uint64_t timeout)
{
uint64_t start = current_time_ms();
uint64_t now = start;
for (;;) {
uint64_t remain = timeout - (now - start);
struct timespec ts;
ts.tv_sec = remain / 1000;
ts.tv_nsec = (remain % 1000) * 1000 * 1000;
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts);
if (__atomic_load_n(&ev->state, __ATOMIC_RELAXED))
return 1;
now = current_time_ms();
if (now - start > timeout)
return 0;
}
}
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
{
if (a0 == 0xc || a0 == 0xb) {
char buf[128];
sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1,
(uint8_t)a2);
return open(buf, O_RDWR, 0);
} else {
char buf[1024];
char* hash;
strncpy(buf, (char*)a0, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = 0;
while ((hash = strchr(buf, '#'))) {
*hash = '0' + (char)(a1 % 10);
a1 /= 10;
}
return open(buf, a2, 0);
}
}
static int inject_fault(int nth)
{
int fd;
fd = open("/proc/thread-self/fail-nth", O_RDWR);
if (fd == -1)
exit(1);
char buf[16];
sprintf(buf, "%d", nth + 1);
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
exit(1);
return fd;
}
static void kill_and_wait(int pid, int* status)
{
kill(-pid, SIGKILL);
kill(pid, SIGKILL);
int i;
for (i = 0; i < 100; i++) {
if (waitpid(-1, status, WNOHANG | __WALL) == pid)
return;
usleep(1000);
}
DIR* dir = opendir("/sys/fs/fuse/connections");
if (dir) {
for (;;) {
struct dirent* ent = readdir(dir);
if (!ent)
break;
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
continue;
char abort[300];
snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
ent->d_name);
int fd = open(abort, O_WRONLY);
if (fd == -1) {
continue;
}
if (write(fd, abort, 1) < 0) {
}
close(fd);
}
closedir(dir);
} else {
}
while (waitpid(-1, status, __WALL) != pid) {
}
}
static void setup_test()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
write_file("/proc/self/oom_score_adj", "1000");
}
static void setup_fault()
{
static struct {
const char* file;
const char* val;
bool fatal;
} files[] = {
{"/sys/kernel/debug/failslab/ignore-gfp-wait", "N", true},
{"/sys/kernel/debug/fail_futex/ignore-private", "N", false},
{"/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem", "N", false},
{"/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait", "N", false},
{"/sys/kernel/debug/fail_page_alloc/min-order", "0", false},
};
unsigned i;
for (i = 0; i < sizeof(files) / sizeof(files[0]); i++) {
if (!write_file(files[i].file, files[i].val)) {
if (files[i].fatal)
exit(1);
}
}
}
struct thread_t {
int created, call;
event_t ready, done;
};
static struct thread_t threads[16];
static void execute_call(int call);
static int running;
static void* thr(void* arg)
{
struct thread_t* th = (struct thread_t*)arg;
for (;;) {
event_wait(&th->ready);
event_reset(&th->ready);
execute_call(th->call);
__atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED);
event_set(&th->done);
}
return 0;
}
static void execute_one(void)
{
int i, call, thread;
for (call = 0; call < 3; call++) {
for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0]));
thread++) {
struct thread_t* th = &threads[thread];
if (!th->created) {
th->created = 1;
event_init(&th->ready);
event_init(&th->done);
event_set(&th->done);
thread_start(thr, th);
}
if (!event_isset(&th->done))
continue;
event_reset(&th->done);
th->call = call;
__atomic_fetch_add(&running, 1, __ATOMIC_RELAXED);
event_set(&th->ready);
event_timedwait(&th->done, 45);
break;
}
}
for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++)
sleep_ms(1);
}
static void execute_one(void);
#define WAIT_FLAGS __WALL
static void loop(void)
{
int iter;
for (iter = 0;; iter++) {
int pid = fork();
if (pid < 0)
exit(1);
if (pid == 0) {
setup_test();
execute_one();
exit(0);
}
int status = 0;
uint64_t start = current_time_ms();
for (;;) {
if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
break;
sleep_ms(1);
if (current_time_ms() - start < 5 * 1000)
continue;
kill_and_wait(pid, &status);
break;
}
}
}
uint64_t r[1] = {0xffffffffffffffff};
void execute_call(int call)
{
intptr_t res;
switch (call) {
case 0:
*(uint64_t*)0x20000180 = 0;
*(uint32_t*)0x20000188 = 0;
*(uint64_t*)0x20000190 = 0x20000040;
*(uint64_t*)0x20000040 = 0x200000c0;
memcpy((void*)0x200000c0, "!", 1);
*(uint64_t*)0x200000c1 = 0x20000000;
*(uint64_t*)0x20000048 = 2;
*(uint64_t*)0x20000198 = 1;
*(uint64_t*)0x200001a0 = 0;
*(uint64_t*)0x200001a8 = 0;
*(uint32_t*)0x200001b0 = 0;
syscall(__NR_sendmsg, -1, 0x20000180ul, 0ul);
break;
case 1:
memcpy((void*)0x200001c0, "/dev/dri/card#\000", 15);
res = syz_open_dev(0x200001c0, 1, 0);
if (res != -1)
r[0] = res;
break;
case 2:
inject_fault(8);
syscall(__NR_ioctl, r[0], 0xffffffffffffffc6ul, 0x20000040ul);
break;
}
}
int main(void)
{
syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0);
setup_fault();
for (procid = 0; procid < 6; procid++) {
if (fork() == 0) {
loop();
}
}
sleep(1000000);
return 0;
}
|
the_stack_data/1051809.c | int test_array[100];
int dyn_bss_func(void)
{
test_array[0] += 100;
return 2017 + test_array[0];
}
|
the_stack_data/1097981.c | #include <stdio.h>
int main ()
{
int var = 20; /* 实际变量的声明 */
int *ip; /* 指针变量的声明 */
ip = &var; /* 在指针变量中存储 var 的地址 */
printf("Address of var variable: %p\n", &var );
/* 在指针变量中存储的地址 */
printf("Address stored in ip variable: %p\n", ip );
/* 使用指针访问值 */
printf("Value of *ip variable: %d\n", *ip );
return 0;
}
|
the_stack_data/211081280.c | /*******************************************************************************
*
* Program: memchr() Demonstration
*
* Description: Example of using the memchr() function in C.
*
* YouTube Lesson: https://www.youtube.com/watch?v=GbwaXI75AfE
*
* Author: Kevin Browne @ https://portfoliocourses.com
*
*******************************************************************************/
#include <stdio.h>
#include <string.h>
int main(void)
{
// test char array
char data[] = {'q', 'r', 's', 't', 'p', 'a', 'x'};
// memchr will search 7 chars deep into the data array for the char 't'
// and return a pointer to the first occurrence of the character
char *pos = memchr(data, 't', 7);
// if memchr can't find the character it will return NULL, so for example
// if we searched for 'z' in the above char array we would expect a
// return value of NULL
if (pos == NULL)
{
printf("Character not found!\n");
}
// we should get 't' and 'p' as output if use array indexing with the pointer
else
{
printf("pos[0] = %c\n", pos[0]);
printf("pos[1] = %c\n", pos[1]);
}
// an obvious use case for the function is working with strings, for example:
char str[] = "[email protected]";
// let's find the first occurrence of the '@' char in the email address above,
// giving us the domain of the e-mail
char *domain = memchr(str, '@', strlen(str));
// we can increment the pointer by 1 to skip over the @ character so that
// domain will point to the string "microsoft.com" instead of "@microsoft.com"
domain++;
// we will get "microsoft.com" as output
printf("domain: %s\n", domain);
return 0;
} |
the_stack_data/154831044.c | char target;
char source;
int main() {
target = 'U';
source = 'I';
target = source;
putchar(target);
putchar(source);
}
|
the_stack_data/168894218.c | #include <stdio.h>
int main() {
int grade, sum = 0, num_grades = 0, failed = 0;
while (scanf("%d", &grade) == 1) {
while (grade < 5 || grade > 10) {
printf("Enter grade from 5 to 10: ");
if (scanf("%d", &grade) != 1) break;
}
/* counting */
if (grade >= 6 && grade <= 10) {
sum += grade;
num_grades++;
}
else /*if (grade == 5) */
failed++;
}
if (num_grades == 0)
printf("No passed exams");
else
printf("Average is %4.2f\n", (float)sum / num_grades);
if (failed != 0)
printf("Failed on %d exams\n", failed);
else
printf("No failed exams\n");
return 0;
}
|
the_stack_data/127825.c | // Include Header files
#include "stdio.h" //printf, scanf etc
// Start of C application
int main()
{
// Print to Console/Terminal
printf("Hello World\n");
// Return Success
return 0;
} |
the_stack_data/61318.c | // 用函数调用实现字符串的复制
#include <stdio.h>
int main(void)
{
void copy_string(char from[], char to[]);
char a[] = "I am a teacher.";
char b[] = "You are a student.";
printf("string a=%s\nstring b=%s\n", a, b);
printf("copy string a to string b:\n");
copy_string(a, b);
printf("\nstring a = %s\nstring b = %s\n", a, b);
return 0;
}
void copy_string(char from[], char to[]) // 形参为字符数组
{
int i = 0;
while (from[i] != '\0')
{
to[i] = from[i];
i++;
}
to[i] = '\0';
} |
the_stack_data/187643179.c | /*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header: /cvsup/minix/src/lib/ansi/div.c,v 1.1.1.1 2005/04/21 14:56:04 beng Exp $ */
#include <stdlib.h>
static int tmp = -1;
div_t
div(register int numer, register int denom)
{
div_t r;
/* The assignment of tmp should not be optimized !! */
if (tmp == -1) {
tmp = (tmp / 2 == 0);
}
if (numer == 0) {
r.quot = numer / denom; /* might trap if denom == 0 */
r.rem = numer % denom;
} else if ( !tmp && ((numer < 0) != (denom < 0))) {
r.quot = (numer / denom) + 1;
r.rem = numer - (numer / denom + 1) * denom;
} else {
r.quot = numer / denom;
r.rem = numer % denom;
}
return r;
}
|
the_stack_data/92327514.c | /*
* Z88 stdio library
*
* fread(void *ptr,size_t size,size_t numb);
*
* djm 25/1/2000
*
* This is a major fudge and plays on the inept library
* for i/o of z88dk
*/
#define FDSTDIO
#include <sys/types.h>
#include <stdio.h>
#include <fcntl.h>
int fdfwrite(void *ptr, int size, int num, FILE *fp)
{
if (fchkhdl(fp)) return (write((int)fp,ptr,size*num));
/* fchkhdl exits with hl=0 for bad handle.. */
}
|
the_stack_data/831622.c | typedef enum {false,true} bool;
extern int __VERIFIER_nondet_int(void);
int main() {
int i;
i = __VERIFIER_nondet_int();
while (i != 0) {
if (i > -5 && i < 5) {
if (i < 0) {
i = i+1;
}
if (i > 0) {
i = i-1;
}
}
}
return 0;
}
|
the_stack_data/722180.c | // Note: modified from MachSuite: https://breagen.github.io/MachSuite/
// > Brandon Reagen, Robert Adolf, Sophia Yakun Shao, Gu-Yeon Wei, and David Brooks.
// > *"MachSuite: Benchmarks for Accelerator Design and Customized Architectures."*
// 2014 IEEE International Symposium on Workload Characterization.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define SIZE 256
#define TYPE int
#define TYPE_MAX INT32_MAX
int a[SIZE] = {8630, 2371, 2106, 7047, 9475, 9554, 7281, 6704, 1253, 2157, 2702, 5221, 549, 5266, 7151, 8215, 8118, 7034, 2088, 9135, 3332, 6269, 5470, 1887, 9323, 8378, 8971, 7937, 9515, 3476, 1646, 3823, 555, 2036, 5010, 2633, 6890, 6000, 3503, 4297, 8403, 1966, 4584, 296, 322, 5328, 9540, 4442, 8455, 1645, 918, 2763, 4392, 6305, 3658, 8480, 8317, 6815, 5122, 5437, 2203, 511, 5744, 7766, 2356, 2207, 9796, 3578, 7374, 2888, 9291, 7479, 5700, 1726, 1181, 4994, 9697, 5623, 9487, 8533, 5359, 5216, 1, 6160, 8711, 8220, 6721, 4251, 288, 1950, 4118, 8633, 7052, 5668, 9958, 9749, 3057, 163, 5420, 7122, 3599, 2192, 5139, 4181, 6943, 16, 2609, 144, 3845, 5201, 8248, 5315, 4539, 8064, 671, 7867, 3556, 6717, 5041, 7526, 2624, 2612, 1269, 6184, 5584, 4656, 4378, 1243, 7797, 9670, 3304, 5750, 3355, 8214, 2352, 5843, 770, 7960, 3927, 9337, 6192, 4939, 4203, 9404, 3437, 4012, 8768, 6298, 9854, 7487, 537, 6765, 8956, 292, 6868, 8865, 2349, 1272, 2426, 5098, 1587, 7189, 7336, 2419, 3763, 5662, 9479, 3154, 33, 4661, 4990, 7170, 6230, 5919, 2969, 1882, 4291, 6145, 9519, 2130, 3981, 6171, 7298, 8669, 1915, 1826, 520, 2619, 2685, 9032, 7117, 7485, 3923, 4877, 6452, 1773, 2854, 3782, 448, 6425, 1996, 1688, 7995, 8573, 7790, 4629, 3495, 3746, 8733, 7781, 8415, 526, 6759, 9079, 8943, 3982, 6409, 8583, 3020, 4513, 5015, 7657, 6111, 3815, 9629, 1856, 1560, 8332, 5885, 9471, 1330, 7337, 7486, 9288, 7380, 524, 4007, 9589, 9680, 4558, 3996, 9331, 2769, 4166, 1952, 8244, 434, 5746, 7112, 7613, 2348, 4351, 393, 4421, 6386, 8158};
void _p_mergesort() {
int start, stop;
int i, m, from, mid, to;
start = 0;
stop = SIZE;
for (m=1; m<stop-start; m+=m) {
for (i=start; i<stop; i+=m+m) {
from = i;
mid = i+m-1;
to = i+m+m-1;
if (to < stop) {
TYPE temp[SIZE];
int i, j, k;
for (i=from; i<=mid; i++) {
temp[i] = a[i];
}
for (j=mid+1; j<=to; j++) {
temp[mid+1+to-j] = a[j];
}
i = from;
j = to;
for (k=from; k<=to; k++) {
TYPE tmp_j = temp[j];
TYPE tmp_i = temp[i];
if (tmp_j < tmp_i) {
a[k] = tmp_j;
j--;
} else {
a[k] = tmp_i;
i++;
}
}
} else {
TYPE temp[SIZE];
int i, j, k;
for (i=from; i<=mid; i++) {
temp[i] = a[i];
}
for (j=mid+1; j<=stop; j++) {
temp[mid+1+stop-j] = a[j];
}
i = from;
j = stop;
for (k=from; k<=stop; k++) {
TYPE tmp_j = temp[j];
TYPE tmp_i = temp[i];
if (tmp_j < tmp_i) {
a[k] = tmp_j;
j--;
} else {
a[k] = tmp_i;
i++;
}
}
}
}
}
}
int main(int argc, char const *argv[]) {
_p_mergesort();
for (int i = 0; i < SIZE; i++) {
printf("%d\n", a[i]);
}
return 0;
}
|
the_stack_data/73574456.c | /*
## Copyright 2009-2020 ECMWF.
## This software is licensed under the terms of the Apache Licence version 2.0
## which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
## In applying this licence, ECMWF does not waive the privileges and immunities
## granted to it by virtue of its status as an intergovernmental organisation
## nor does it submit to any jurisdiction.
*
* Read stdin and create a session from it
*
* Read standard in, to a input file, forks a child process as a separate session
* and then run the shell using the input file. In the child process, we close
* standard out, and duplicate standard out as standard error. The next fopen()
* is then used as standard out/error. i.e output file.
*
# Build stand alone to test
gcc -g -Dlinux ecflow_standalone.c -o ecflow_standalone
# Create file exe.sh use in the test below.
cat > $(pwd)/exe.sh <<\!!
xxx="hello worlds from /home/ma/ma0"
#printenv
echo $SHELL
fred="[email protected]"
if [ '"module unload emos" "module unload fftw" "module unload grib_api" "module unload eccodes" "module unload git" "module unload python" "module unload metview"' != '' ] ; then
array_of_module_cleanup=("module unload emos" "module unload fftw" "module unload grib_api" "module unload eccodes" "module unload git" "module unload python" "module unload metview")
for module_cleanup_i in "${array_of_module_cleanup[@]}";do
echo "${module_cleanup_i}"
${module_cleanup_i}
done
echo $PATH
fi
@@
!!
# Both these tests must work.
ssh localhost $(pwd)/ecflow_standalone -s /bin/bash -o $(pwd)/out.txt < $(pwd)/exe.sh # EXPECT non empty out.txt, and mail
ssh localhost $(pwd)/ecflow_standalone -s /bin/bash -o $(pwd)/out.txt -i $(pwd)/exe.sh # EXPECT non empty out.txt, and mail
# Compare ecflow_standalone with standalone
/usr/local/apps/sms/bin/standalone -s /bin/bash -o $(pwd)/out1.txt < $(pwd)/exe.sh
meld out.txt out1.txt
# Make sure output of echo and module commands is shown
std=/usr/local/apps/sms/bin/standalone
ssh eurus.ecmwf.int $std -s /bin/bash -o $(pwd)/out.txt < $(pwd)/exe.sh # OK
ssh localhost $std -s /bin/bash -o $(pwd)/out.txt -i $(pwd)/exe.sh # OK
*
* Other test using:
* echo "xxx=\"hello worlds from $HOME\"\nfred=$USER" | ./ecflow_standalone -i in.txt -o out.txt
*
* in.txt
* xxx="hello worlds from /home/ma/ma0"
* fred=ma0
*
* out.txt
* + xxx='hello worlds from /home/ma/ma0'
* + fred=ma0
************************************o*************************************/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <limits.h> /* for PATH_MAX */
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#define MAXLEN 1024 /* Maximum line length */
char *nameof(char *name) {
char *s;
int len = strlen(name);
for( s=name+len-1 ; len && *s != '/' ; len-- ) s--;
if(*s == '/') s++;
return s;
}
int main(argc,argv) int argc; char **argv;
{
char *infile = NULL; /* Temporary input file */
char *outfile= "/dev/null"; /* Output file (def /dev/null) */
char *shell= "/bin/sh"; /* default shell */
/* int keep_file=FALSE;*/ /* Flag to keep the input file */
FILE *input_fp; /* Temp to write the input file */
char buff[MAXLEN]; /* Temp buffer to read in lines */
char fname[PATH_MAX];
int option;
extern char *optarg; /* Needed for the getopt */
extern int optind;
signal(SIGCHLD,SIG_IGN);
while( (option=getopt(argc,argv,"i:o:s:")) != -1 )
switch( option ) {
case 'i':
infile = optarg;
/* keep_file = TRUE; */
break;
case 'o':
outfile = optarg;
break;
case 's':
shell = optarg;
if (shell == NULL) {
fprintf(stderr,"usage: %s [-i inputfile] -o [outputfile] -s shell # empty shell argument passed for -s\n",*argv);
exit(0);
}
break;
default:
fprintf(stderr,"usage: %s [-i inputfile] -o [outputfile]\n",*argv);
exit(0);
}
/* Copy standard input to infile */
if( !infile ) {
/* printf("!infile\n"); */
static char template[] = "/tmp/tmp_ecflowXXXXXX";
strcpy(fname, template); /* Copy template */
int fd = mkstemp(fname);
/* printf("input Filename is %s\n", fname); Print it for information */
infile = fname;
close(fd);
if (!(input_fp = fopen(infile, "w"))) {
perror("ecflow_standalone.c, temp file creation error");
exit(1);
}
while( fgets(buff, MAXLEN-1, stdin)) {
/* fprintf(stderr, "%s", buff); */
fputs(buff,input_fp);
}
}
else {
if( !(input_fp=fopen(infile,"r")) ) {
perror("STANDALONE-INPUT-FILE cannot open");
exit(1);
}
}
fclose(input_fp);
/* fork child process, closing the parent */
switch(fork()) {
case -1: perror(*argv); exit(1);
case 0: break; /* child */
default: exit(0); /* The parent exits */
}
/* close standard out,and make standard out a copy of standard error
* This is done so that very next fopen(), will be used as stdout/srderr for execl
*
* int dup2(int oldfd, int newfd);
* makes newfd be the copy of oldfd, closing newfd first if necessary
* */
close(2); /* close standard error in child */
FILE* fout = fopen(outfile,"w"); /* Open file for output and error, when running execl(..) */
dup2(2,1);
close(0); /* close standard in , in child */
/* make sure infile exists and is readable */
if( !(input_fp=fopen(infile,"r")) ) {
perror("STANDALONE-INPUT-FILE-FOR-SHELL");
exit(1);
}
/* fclose(input_fp); */
/* if( !keep_file ) unlink(infile);
for (n=3; n<65535 ;n++) fclose(n); */
/* create a new session from the child process */
#if defined(linux) || defined(__APPLE__) || defined(__MACH__) || defined(hpux) || defined(solaris) || defined(SGI) || defined(SVR4) || defined(AIX) || defined(SYG) || defined(alpha)
if( setsid() == -1 )
#else
if( setsid(0) == -1 )
#endif
{
perror("STANDALONE-SETSID");
exit(1);
}
execl(shell,nameof(shell),"-x",infile,(char *)0);
/* if( !keep_file ) unlink(infile);
fclose(fout); */
exit(1);
}
|
the_stack_data/64199083.c | /*
* References:
* https://wiki.openssl.org/index.php/Simple_TLS_Server
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
int create_socket(int port)
{
int s;
struct sockaddr_in addr;
bzero(&addr, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
//addr.sin_addr.s_addr = inet_addr("127.0.0.1");
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0) {
perror("Unable to create socket");
exit(EXIT_FAILURE);
}
if (bind(s, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
perror("Unable to bind");
exit(EXIT_FAILURE);
}
if (listen(s, 1) < 0) {
perror("Unable to listen");
exit(EXIT_FAILURE);
}
return s;
}
void init_openssl()
{
OpenSSL_add_all_algorithms();
SSL_load_error_strings();
SSL_library_init();
}
void cleanup_openssl()
{
EVP_cleanup();
}
SSL_CTX *create_context()
{
const SSL_METHOD *method;
SSL_CTX *ctx;
method = SSLv23_server_method();
//method = TLSv1_2_server_method();
ctx = SSL_CTX_new(method);
if (!ctx) {
perror("Unable to create SSL context");
ERR_print_errors_fp(stderr);
exit(EXIT_FAILURE);
}
return ctx;
}
void configure_context(SSL_CTX *ctx, const char *serverCert, const char *serverKey,
const char *caCert)
{
SSL_CTX_set_ecdh_auto(ctx, 1);
/* Set the key and cert */
if (SSL_CTX_use_certificate_file(ctx, serverCert, SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stderr);
exit(EXIT_FAILURE);
}
if (SSL_CTX_use_PrivateKey_file(ctx, serverKey, SSL_FILETYPE_PEM) <= 0 ) {
ERR_print_errors_fp(stderr);
exit(EXIT_FAILURE);
}
//SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL); // not to verify client
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL); // to verify client certificate
/* Set CA certificate for client verification */
{
FILE * rootCaFile = NULL;
X509 *rootCa = NULL;
if ((rootCaFile = fopen(caCert, "r")) == NULL) {
perror("Unable to find CA certificate");
exit(EXIT_FAILURE);
}
if ((rootCa = PEM_read_X509(rootCaFile, NULL, NULL, NULL)) == NULL) {
perror("Unable to decode CA certificate");
exit(EXIT_FAILURE);
}
if (X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), rootCa) <= 0) {
perror("Unable to load CA certificate");
exit(EXIT_FAILURE);
}
if (rootCaFile != NULL)
fclose(rootCaFile);
}
}
void showCert(SSL* ssl)
{
X509 *cert;
char *line;
cert = SSL_get_peer_certificate(ssl);
if (cert != NULL) {
printf("Client certificate:\n");
line = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
printf("Subject: %s\n", line);
free(line);
line = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
printf("Issuer: %s\n", line);
free(line);
X509_free(cert);
}
}
int main(int argc, char **argv)
{
int sock;
SSL_CTX *ctx;
init_openssl();
ctx = create_context();
configure_context(ctx, "remote-ca.crt", "remote-ca.key", "remote-ca.crt");
sock = create_socket(5555);
/* Handle connections */
while(1) {
struct sockaddr_in addr;
uint len = sizeof(addr);
SSL *ssl;
const char reply[] = "\nYou have passed the assessment.\n";
int client = accept(sock, (struct sockaddr*)&addr, &len);
if (client < 0) {
perror("Unable to accept");
exit(EXIT_FAILURE);
}
ssl = SSL_new(ctx);
SSL_set_fd(ssl, client);
if (SSL_accept(ssl) <= 0) {
ERR_print_errors_fp(stderr);
}
else {
//int bytes = 0;
//char buf[256];
showCert(ssl);
SSL_write(ssl, reply, strlen(reply));
/* remove this potion of code to avoid client hogging */
/*bytes = SSL_read(ssl, buf, sizeof(buf)); // receive message from client
if (bytes) {
buf[bytes] = '\0';
printf("\nReceived: \"%s\"\n", buf);
}*/
}
SSL_shutdown(ssl);
SSL_free(ssl);
close(client);
}
close(sock);
SSL_CTX_free(ctx);
cleanup_openssl();
}
|
the_stack_data/37638016.c | // Allow a Cygwin program to run under a different uid (setuid).
// Assumes winkill.exe exists and uses Perl's $ARGV[0] and
// $ARGV[1].
#include <stdio.h>
int main(int argc, char *argv[]) {
int rc = execl("/home/bheckel/bin/winkill", "winkill",
argv[1], argv[2], NULL);
if ( rc == 0 ) {
return 0;
} else {
return 1;
}
}
|
the_stack_data/125576.c | /**
@file win32.c
@brief ENet Win32 system specific functions
*/
#ifdef _WIN32
#define ENET_BUILDING_LIB 0
#include "enet/enet.h"
#include <windows.h>
#include <mmsystem.h>
static enet_uint32 timeBase = 0;
int
enet_initialize (void)
{
WORD versionRequested = MAKEWORD (1, 1);
WSADATA wsaData;
if (WSAStartup (versionRequested, & wsaData))
return -1;
if (LOBYTE (wsaData.wVersion) != 1||
HIBYTE (wsaData.wVersion) != 1)
{
WSACleanup ();
return -1;
}
#ifndef WINRT_ENABLED
timeBeginPeriod (1);
#endif
return 0;
}
void
enet_deinitialize (void)
{
#ifndef WINRT_ENABLED
timeEndPeriod (1);
#endif
WSACleanup ();
}
#ifdef WINRT_ENABLED
enet_uint32
timeGetTime() {
ULONGLONG ticks = GetTickCount64();
return (enet_uint32)ticks;
}
#endif
enet_uint32
enet_host_random_seed (void)
{
return (enet_uint32) timeGetTime ();
}
enet_uint32
enet_time_get (void)
{
return (enet_uint32) timeGetTime () - timeBase;
}
void
enet_time_set (enet_uint32 newTimeBase)
{
timeBase = (enet_uint32) timeGetTime () - newTimeBase;
}
int
enet_address_set_host (ENetAddress * address, const char * name)
{
struct hostent * hostEntry;
hostEntry = gethostbyname (name);
if (hostEntry == NULL ||
hostEntry -> h_addrtype != AF_INET)
{
unsigned long host = inet_addr (name);
if (host == INADDR_NONE)
return -1;
address -> host = host;
return 0;
}
address -> host = * (enet_uint32 *) hostEntry -> h_addr_list [0];
return 0;
}
int
enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameLength)
{
char * addr = inet_ntoa (* (struct in_addr *) & address -> host);
if (addr == NULL)
return -1;
else
{
size_t addrLen = strlen(addr);
if (addrLen >= nameLength)
return -1;
memcpy (name, addr, addrLen + 1);
}
return 0;
}
int
enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry;
in.s_addr = address -> host;
hostEntry = gethostbyaddr ((char *) & in, sizeof (struct in_addr), AF_INET);
if (hostEntry == NULL)
return enet_address_get_host_ip (address, name, nameLength);
else
{
size_t hostLen = strlen (hostEntry -> h_name);
if (hostLen >= nameLength)
return -1;
memcpy (name, hostEntry -> h_name, hostLen + 1);
}
return 0;
}
int
enet_socket_bind (ENetSocket socket, const ENetAddress * address)
{
struct sockaddr_in sin;
memset (& sin, 0, sizeof (struct sockaddr_in));
sin.sin_family = AF_INET;
if (address != NULL)
{
sin.sin_port = ENET_HOST_TO_NET_16 (address -> port);
sin.sin_addr.s_addr = address -> host;
}
else
{
sin.sin_port = 0;
sin.sin_addr.s_addr = INADDR_ANY;
}
return bind (socket,
(struct sockaddr *) & sin,
sizeof (struct sockaddr_in)) == SOCKET_ERROR ? -1 : 0;
}
int
enet_socket_get_address (ENetSocket socket, ENetAddress * address)
{
struct sockaddr_in sin;
int sinLength = sizeof (struct sockaddr_in);
if (getsockname (socket, (struct sockaddr *) & sin, & sinLength) == -1)
return -1;
address -> host = (enet_uint32) sin.sin_addr.s_addr;
address -> port = ENET_NET_TO_HOST_16 (sin.sin_port);
return 0;
}
int
enet_socket_listen (ENetSocket socket, int backlog)
{
return listen (socket, backlog < 0 ? SOMAXCONN : backlog) == SOCKET_ERROR ? -1 : 0;
}
ENetSocket
enet_socket_create (ENetSocketType type)
{
return socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
}
int
enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
{
int result = SOCKET_ERROR;
switch (option)
{
case ENET_SOCKOPT_NONBLOCK:
{
u_long nonBlocking = (u_long) value;
result = ioctlsocket (socket, FIONBIO, & nonBlocking);
break;
}
case ENET_SOCKOPT_BROADCAST:
result = setsockopt (socket, SOL_SOCKET, SO_BROADCAST, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_REUSEADDR:
result = setsockopt (socket, SOL_SOCKET, SO_REUSEADDR, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_RCVBUF:
result = setsockopt (socket, SOL_SOCKET, SO_RCVBUF, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_SNDBUF:
result = setsockopt (socket, SOL_SOCKET, SO_SNDBUF, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_RCVTIMEO:
result = setsockopt (socket, SOL_SOCKET, SO_RCVTIMEO, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_SNDTIMEO:
result = setsockopt (socket, SOL_SOCKET, SO_SNDTIMEO, (char *) & value, sizeof (int));
break;
case ENET_SOCKOPT_NODELAY:
result = setsockopt (socket, IPPROTO_TCP, TCP_NODELAY, (char *) & value, sizeof (int));
break;
default:
break;
}
return result == SOCKET_ERROR ? -1 : 0;
}
int
enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
{
int result = SOCKET_ERROR, len;
switch (option)
{
case ENET_SOCKOPT_ERROR:
len = sizeof(int);
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, & len);
break;
default:
break;
}
return result == SOCKET_ERROR ? -1 : 0;
}
int
enet_socket_connect (ENetSocket socket, const ENetAddress * address)
{
struct sockaddr_in sin;
int result;
memset (& sin, 0, sizeof (struct sockaddr_in));
sin.sin_family = AF_INET;
sin.sin_port = ENET_HOST_TO_NET_16 (address -> port);
sin.sin_addr.s_addr = address -> host;
result = connect (socket, (struct sockaddr *) & sin, sizeof (struct sockaddr_in));
if (result == SOCKET_ERROR && WSAGetLastError () != WSAEWOULDBLOCK)
return -1;
return 0;
}
ENetSocket
enet_socket_accept (ENetSocket socket, ENetAddress * address)
{
SOCKET result;
struct sockaddr_in sin;
int sinLength = sizeof (struct sockaddr_in);
result = accept (socket,
address != NULL ? (struct sockaddr *) & sin : NULL,
address != NULL ? & sinLength : NULL);
if (result == INVALID_SOCKET)
return ENET_SOCKET_NULL;
if (address != NULL)
{
address -> host = (enet_uint32) sin.sin_addr.s_addr;
address -> port = ENET_NET_TO_HOST_16 (sin.sin_port);
}
return result;
}
int
enet_socket_shutdown (ENetSocket socket, ENetSocketShutdown how)
{
return shutdown (socket, (int) how) == SOCKET_ERROR ? -1 : 0;
}
void
enet_socket_destroy (ENetSocket socket)
{
if (socket != INVALID_SOCKET)
closesocket (socket);
}
int
enet_socket_send (ENetSocket socket,
const ENetAddress * address,
const ENetBuffer * buffers,
size_t bufferCount)
{
struct sockaddr_in sin;
DWORD sentLength;
if (address != NULL)
{
memset (& sin, 0, sizeof (struct sockaddr_in));
sin.sin_family = AF_INET;
sin.sin_port = ENET_HOST_TO_NET_16 (address -> port);
sin.sin_addr.s_addr = address -> host;
}
if (WSASendTo (socket,
(LPWSABUF) buffers,
(DWORD) bufferCount,
& sentLength,
0,
address != NULL ? (struct sockaddr *) & sin : NULL,
address != NULL ? sizeof (struct sockaddr_in) : 0,
NULL,
NULL) == SOCKET_ERROR)
{
if (WSAGetLastError () == WSAEWOULDBLOCK)
return 0;
return -1;
}
return (int) sentLength;
}
int
enet_socket_receive (ENetSocket socket,
ENetAddress * address,
ENetBuffer * buffers,
size_t bufferCount)
{
INT sinLength = sizeof (struct sockaddr_in);
DWORD flags = 0,
recvLength;
struct sockaddr_in sin;
if (WSARecvFrom (socket,
(LPWSABUF) buffers,
(DWORD) bufferCount,
& recvLength,
& flags,
address != NULL ? (struct sockaddr *) & sin : NULL,
address != NULL ? & sinLength : NULL,
NULL,
NULL) == SOCKET_ERROR)
{
switch (WSAGetLastError ())
{
case WSAEWOULDBLOCK:
case WSAECONNRESET:
return 0;
}
return -1;
}
if (flags & MSG_PARTIAL)
return -1;
if (address != NULL)
{
address -> host = (enet_uint32) sin.sin_addr.s_addr;
address -> port = ENET_NET_TO_HOST_16 (sin.sin_port);
}
return (int) recvLength;
}
int
enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocketSet * writeSet, enet_uint32 timeout)
{
struct timeval timeVal;
timeVal.tv_sec = timeout / 1000;
timeVal.tv_usec = (timeout % 1000) * 1000;
return select (maxSocket + 1, readSet, writeSet, NULL, & timeVal);
}
int
enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeout)
{
fd_set readSet, writeSet;
struct timeval timeVal;
int selectCount;
timeVal.tv_sec = timeout / 1000;
timeVal.tv_usec = (timeout % 1000) * 1000;
FD_ZERO (& readSet);
FD_ZERO (& writeSet);
if (* condition & ENET_SOCKET_WAIT_SEND)
FD_SET (socket, & writeSet);
if (* condition & ENET_SOCKET_WAIT_RECEIVE)
FD_SET (socket, & readSet);
selectCount = select (socket + 1, & readSet, & writeSet, NULL, & timeVal);
if (selectCount < 0)
return -1;
* condition = ENET_SOCKET_WAIT_NONE;
if (selectCount == 0)
return 0;
if (FD_ISSET (socket, & writeSet))
* condition |= ENET_SOCKET_WAIT_SEND;
if (FD_ISSET (socket, & readSet))
* condition |= ENET_SOCKET_WAIT_RECEIVE;
return 0;
}
#endif
|
the_stack_data/102230.c | #include<stdio.h>
#include<math.h>
#include<assert.h>
//Function to calcualte next multiple of two given values
int findNextMultiple(int number1, int number2){
int answer = number1 / number2;
return (answer + 1)*number2;
}
//Function to convert Fahrenheit to Celsuius
float convertFtoC(float fahrenheit){
float celsius;
celsius = (fahrenheit-32) * 5/9;
return celsius;
}
//Function to calculate fibonacci series for first 20 numbers
int fibonacci(){
int a=0, b=1 ,c;
for(int i=1;i<20;i++)
{
printf("%d ",a);
c = a + b;
a = b;
b = c;
}
return a;
}
//Function to cast a long to an int
int castToInt(long num){
int n;
n = (int) num;
return n;
}
//Function to cast a long to an double
double castToDouble(long num){
double n;
n = (double) num;
return n;
}
//Function to cast a long to an char
char castToChar(long num){
char a;
a = (char) num;
return a;
}
//The main driver
int main(){
//TODO Write code to print "Hello World"
printf("Hello World");
//TODO For given value of x calculate value of expression
printf("\n\t=============================\n");
printf("\t= PART A =\n");
printf("\t=============================\n\n");
printf("\n\t=========Starting Expression Conversion Tests===========\n");
//Write code to evaluate the following expression: 3x^3 - 5x^2 + 6 for x = 2.5.
float result = 0, x = 2.5;
result = (3*(pow(2.5,3))) - (5*(pow((float)x,2))) + 6;
printf("Part A1 = %f",result);
assert(result == 21.625);
//Write code to evaluate the following expression: (4 * 10^8 + 2 * 10^-7) / (7 * 10^-6 + 2 * 10^8)
result = 0;
result = ((4 * (pow(10,8))) + (2 * (pow(10,(-7))))) / ((7 * (pow(10,(-6)))) + (2 * (pow(10,8))));
printf("Part A2 = %f",result);
assert(result == 2.0);
printf("\n\t\t....Converting Expressions Tests Passed\n");
printf("\n\t=========Starting Next Multiple Tests===========\n");
//For given numbers find next multiple
int number1 = 365, number2 = 7;
assert(371 == findNextMultiple(number1,number2));
number1 = 12258; number2 = 28;
assert(12264 == findNextMultiple(number1,number2));
number1 = 996; number2 = 4;
assert(1000 == findNextMultiple(number1,number2));
printf("\n\t\t....Next Multiple Tests Passed\n");
printf("\n\t=========Starting Fahrenheit to Celsius Tests===========\n");
//Convert Fahrenheit value to Celsius value
float fahrenheit = 95;
float celsius = convertFtoC(fahrenheit);
assert(35.0 == celsius);
fahrenheit = 32;
celsius = convertFtoC(fahrenheit);
assert(0.0 == celsius);
fahrenheit = -40;
celsius = convertFtoC(fahrenheit);
assert(-40.0 == celsius);
printf("\n\t\t....Fahrenheit to Celsius Tests Passed\n");
printf("\n\t=============================\n");
printf("\t= PART B =\n");
printf("\t=============================\n\n");
printf("\n\t=========Starting Casting Tests===========\n");
//Testing our Casting and how its loses values for wrong casting
long int large_num = 9223372036854775617;
int large_num_as_int = castToInt(large_num);
assert(-191 == large_num_as_int);
double large_num_as_double = castToDouble(large_num);
assert(9223372036854775808.0 == large_num_as_double);
char large_num_as_char = castToChar(large_num);
assert('A' == large_num_as_char);
printf("\n\t\t....Casting Tests Passed\n");
printf("\n\t=============================\n");
printf("\t= PART C =\n");
printf("\t=============================\n\n");
printf("\n\t=========Starting Fibonacci Tests===========\n");
//finding fibonacci series for first 20 numbers
assert(4181 == fibonacci());
printf("\n\t\t....Fibonacci Tests Passed\n");
printf("\n\t=========ALL TESTS PASSED===========\n");
return 0;
}
|
the_stack_data/162643576.c | #include<stdio.h>
int main()
{
struct stu
{ long int xh;
char name[20];
int grade;
} ;
struct stu s1,s2;
printf("please enter s1 information\n");
printf("NO.=");
scanf("%d",&s1.xh);
printf("name=");
scanf("%s",s1.name);
printf("grade=");
scanf("%d",&s1.grade);
printf("please enter s2 information\n");
printf("NO.=");
scanf("%d",&s2.xh);
printf("name=");
scanf("%s",s2.name);
printf("grade=");
scanf("%d",&s2.grade);
if(s1.grade>s2.grade)
printf("NO.=%d\nname=%s\ngrade=%d\n",s1.xh,s1.name,s1.grade);
else if(s1.grade<s2.grade)
printf("NO.=%d\nname=%s\ngrade=%d\n",s2.xh,s2.name,s2.grade);
else
printf("NO.=%d\nname=%s\ngrade=%d\n",s1.xh,s1.name,s1.grade);
printf("NO.=%d\nname=%s\ngrade=%d\n",s2.xh,s2.name,s2.grade);
return 0;
} |
the_stack_data/82885.c | // C program to print the month by month
// calendar for the given year
#include <stdio.h>
// Function that returns the index of the
// day for date DD/MM/YYYY
int dayNumber(int day, int month, int year)
{
static int t[] = { 0, 3, 2, 5, 0, 3,
5, 1, 4, 6, 2, 4 };
year -= month < 3;
return (year + year / 4
- year / 100
+ year / 400
+ t[month - 1] + day)
% 7;
}
// Function that returns the name of the
// month for the given month Number
// January - 0, February - 1 and so on
char* getMonthName(int monthNumber)
{
char* month;
switch (monthNumber) {
case 0:
month = "January";
break;
case 1:
month = "February";
break;
case 2:
month = "March";
break;
case 3:
month = "April";
break;
case 4:
month = "May";
break;
case 5:
month = "June";
break;
case 6:
month = "July";
break;
case 7:
month = "August";
break;
case 8:
month = "September";
break;
case 9:
month = "October";
break;
case 10:
month = "November";
break;
case 11:
month = "December";
break;
}
return month;
}
// Function to return the number of days
// in a month
int numberOfDays(int monthNumber, int year)
{
// January
if (monthNumber == 0)
return (31);
// February
if (monthNumber == 1) {
// If the year is leap then Feb
// has 29 days
if (year % 400 == 0
|| (year % 4 == 0
&& year % 100 != 0))
return (29);
else
return (28);
}
// March
if (monthNumber == 2)
return (31);
// April
if (monthNumber == 3)
return (30);
// May
if (monthNumber == 4)
return (31);
// June
if (monthNumber == 5)
return (30);
// July
if (monthNumber == 6)
return (31);
// August
if (monthNumber == 7)
return (31);
// September
if (monthNumber == 8)
return (30);
// October
if (monthNumber == 9)
return (31);
// November
if (monthNumber == 10)
return (30);
// December
if (monthNumber == 11)
return (31);
}
// Function to print the calendar of
// the given year
void printCalendar(int year)
{
printf(" Calendar - %d\n\n", year);
int days;
// Index of the day from 0 to 6
int current = dayNumber(1, 1, year);
// i for Iterate through months
// j for Iterate through days
// of the month - i
for (int i = 0; i < 12; i++) {
days = numberOfDays(i, year);
// Print the current month name
printf("\n ------------%s-------------\n",
getMonthName(i));
// Print the columns
printf(" Sun Mon Tue Wed Thu Fri Sat\n");
// Print appropriate spaces
int k;
for (k = 0; k < current; k++)
printf(" ");
for (int j = 1; j <= days; j++) {
printf("%5d", j);
if (++k > 6) {
k = 0;
printf("\n");
}
}
if (k)
printf("\n");
current = k;
}
return;
}
// Driver Code
int main()
{
int year = 2026;
// Function Call
printCalendar(year);
return 0;
}
|
the_stack_data/232955298.c | /***************************************************************************
* TCP/IP Echo Server Example
*
* File : echoserver.c
* Purpose : This file provides Berkeley sockets implementation of a TCP/IP
* echo server. It evolved from some sockets base code that I
* wrote back in 1990. I find myself referencing it every few
* years, so I formalized it and put it in a location that's
* easy to find.
* Author : Michael Dipperstein
* Date : December 27, 2017
*
****************************************************************************
*
* Echo Server: A Berkeley socket implementation of a TCP/IP Echo Server
* Copyright (C) 2017 by Michael Dipperstein ([email protected])
*
* 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 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 HOLDER 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <poll.h>
/***************************************************************************
* CONSTANTS
***************************************************************************/
#define MAX_BACKLOG 10 /* maximum outstanding connection requests */
#define BUF_SIZE 1024 /* size of receive buffer */
/***************************************************************************
* TYPES
***************************************************************************/
typedef struct fd_list_t
{
int fd;
struct fd_list_t* next;
} fd_list_t;
/***************************************************************************
* PROTOTYPES
***************************************************************************/
int DoEcho(const int clientFd, const fd_list_t *list);
int InsertFd(int fd, fd_list_t **list);
int RemoveFd(int fd, fd_list_t **list);
void PrintFdList(const fd_list_t *list);
/***************************************************************************
* FUNCTIONS
***************************************************************************/
/***************************************************************************
* Function : main
* Description: This is the main function for this program, it opens a TCP
* socket on the port specified in argv[1]. It accepts all
* connections and maintains connections to the specified
* port. If the connected socket may be read, DoEcho is
* called to handle receiving and echoing data.
* Parameters : argc - number of parameters
* argv - parameter list (argv[1] is port number)
* Effects : A socket is open and accepts connections on the specified
* port. Readable connections are passed to DoEcho
* Returned : This function should never return
*
* TODO: Add signalfd to handle ctrl-c and exit cleanly.
***************************************************************************/
int main(int argc, char *argv[])
{
int result;
int listenFd; /* socket fd used to listen for connection requests */
struct fd_list_t *fdList, *thisFd;
struct pollfd *pfds;
int numFds, changed;
/* structures for server and client internet addresses */
struct sockaddr_in serverAddr;
int i;
/* argv[1] is port number, make sure it's passed to us */
if (argc != 2)
{
fprintf(stderr, "Usage: %s <port number>\n", argv[0]);
exit(EXIT_FAILURE);
}
fdList = NULL;
/* create server socket descriptor */
listenFd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenFd < 0)
{
perror("Error creating socket");
exit(EXIT_FAILURE);
}
memset(&serverAddr, 0, sizeof(serverAddr)); /* clear data structure */
/* allow internet connection from any address on port argv[1] */
serverAddr.sin_family = AF_INET; /* internet address family */
serverAddr.sin_addr.s_addr = htonl(INADDR_ANY); /* any incoming address */
serverAddr.sin_port = htons(atoi(argv[1])); /* port number */
/* bind to the local address */
result = bind(listenFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
if (result < 0)
{
/* bind failed */
perror("Error binding socket");
close(listenFd);
exit(EXIT_FAILURE);
}
/* listen for incoming connections */
result = listen(listenFd, MAX_BACKLOG);
if (result < 0)
{
/* listen failed */
perror("Error listening for connections");
exit(EXIT_FAILURE);
}
/* listenFd is our only fd when we start */
numFds = 1;
changed = 1;
pfds = NULL;
/* service all sockets as needed */
while (1)
{
int startingFds = numFds;
if (changed)
{
/* one or more fds changed. we need to change the polling struct */
if (NULL != pfds)
{
free(pfds);
}
pfds = (struct pollfd *)malloc(numFds * sizeof(struct pollfd));
if (NULL == pfds)
{
perror("Error allocating fds for poll");
break;
}
/* listen fd goes in slot 0, just because */
pfds[0].fd = listenFd;
pfds[0].events = POLLIN;
/* now poll for input from the rest of the sockets */
thisFd = fdList;
for(i = 1; i < numFds; i++)
{
pfds[i].fd = thisFd->fd;
pfds[i].events = POLLIN;
thisFd = thisFd->next;
}
changed = 0;
}
/* block on poll until something needs servicing */
if (-1 == poll(pfds, numFds, -1))
{
perror("Error poll failed");
exit(EXIT_FAILURE);
}
/* one or more fds need servicing */
if (pfds[0].revents & POLLIN)
{
/* listening socket we got a new connection request */
int acceptedFd; /* fd for accepted connection */
/* accept the connection; we don't care about the address */
acceptedFd = accept(listenFd, NULL, NULL);
if (acceptedFd < 0)
{
/* accept failed. keep processing */
perror("Error accepting connections");
}
else
{
printf("New connection on socket %d.\n", acceptedFd);
InsertFd(acceptedFd, &fdList);
numFds++;
changed = 1;
}
}
for(i = 1; i < startingFds; i++)
{
/* one or more clients needs servicing */
if (pfds[i].revents & POLLIN)
{
/* service this client */
result = DoEcho(pfds[i].fd, fdList);
if (result <= 0)
{
/* socket closed normally or failed */
close(pfds[i].fd);
RemoveFd(pfds[i].fd, &fdList);
numFds--;
changed = 1;
}
}
}
}
close(listenFd);
return EXIT_SUCCESS; /* we should not get here */
}
/***************************************************************************
* Function : DoEcho
* Description: This routine receives from a client's socket and then
* writes the received message back to each connected client
* socket. The write is non-blocking, so clients with busy
* sockets will not receive the message.
* Parameters : clientFd - The socket descriptor for the socket to be read
* from.
* list - a pointer to a list of fds for all connected sockets.
* Effects : clientFd is read from. If the read succeeds, the value
* that was read is sent to all client sockets. The send will
* only succeed if the socket may be written to without
* blocking.
* Returned : 0 for normal disconnect of clientFd, < 0 for failure,
* a positive value will be returned.
***************************************************************************/
int DoEcho(const int clientFd, const fd_list_t *list)
{
int result;
char buffer[BUF_SIZE + 1]; /* stores received message */
(void)list;
result = recv(clientFd, buffer, BUF_SIZE, 0);
if (result < 0)
{
/* receive failed */
perror("Error receiving message from client");
}
else if (0 == result)
{
printf("Socket %d disconnected.\n", clientFd);
}
else
{
const fd_list_t *here;
buffer[result] = '\0';
printf("Socket %d received %s", clientFd, buffer);
/*******************************************************************
* echo the buffer to all connected sockets, skip if waiting
* is required. Use threads or a complex polling loop if it's
* important that every socket receive the echo.
*******************************************************************/
here = list;
while (here != NULL)
{
result = send(here->fd, buffer, result, MSG_DONTWAIT);
if (result == -1)
{
if ((EAGAIN == errno) || (EWOULDBLOCK == errno))
{
fprintf(stderr, "Socket %d is busy\n", here->fd);
}
else
{
/* send failed */
fprintf(stderr, "Error echoing message to socket %d ",
here->fd);
perror("");
}
}
here = here->next;
}
result = 1; /* any echoing is success for this function */
}
return result;
}
/***************************************************************************
* Function : InsertFd
* Description: This routine will traverse a linked list of file
* descriptors. If it reaches the end of the list without
* finding the file descriptor passed a as parameter, it
* will insert a node for the new file descriptor at the end
* of the list.
* Parameters : fd - The socket descriptor to be inserted to the list.
* list - a pointer to a list of fds for all connected
* sockets.
* Effects : A node for the fd is added to the end of the list of fds.
* Returned : 0 for success, otherwise errno for the failure.
*
* NOTE: If duplicates aren't an issue, it's faster to insert the new
* file descriptor to the head of the linked list.
***************************************************************************/
int InsertFd(int fd, fd_list_t **list)
{
fd_list_t *here;
/* handle empty list */
if (NULL == *list)
{
*list = (fd_list_t *)malloc(sizeof(fd_list_t));
if (NULL == list)
{
perror("Error allocating fd_list_t");
return errno;
}
(*list)->fd = fd;
(*list)->next = NULL;
return 0;
}
/* find the end of the list */
here = *list;
while(here->next != NULL)
{
if (here->fd == fd)
{
fprintf(stderr, "Tried to insert fd that already exists: %d\n", fd);
return EEXIST; /* is there a better errno? */
}
here = here->next;
}
/* we're at the end make sure that fd isn't already here */
if (here->fd == fd)
{
fprintf(stderr, "Tried to insert fd that already exists: %d\n", fd);
return EEXIST; /* is there a better errno? */
}
/* add new fd to list */
here->next = (fd_list_t *)malloc(sizeof(fd_list_t));
if (NULL == here->next)
{
perror("Error allocating fd_list_t");
return errno;
}
here->next->fd = fd;
here->next->next = NULL;
return 0;
}
/***************************************************************************
* Function : RemoveFd
* Description: This routine will traverse a linked list of file
* descriptors until it finds a node for the file descriptor
* passed a as parameter. Then it will remove that node from
* the list. If the file descriptor is not found, ENOENT
* is returned.
* Parameters : fd - The socket descriptor to be deleted from the list.
* list - a pointer to a list of fds for all connected
* sockets.
* Effects : The node for the fd is removed from the list of fds.
* Returned : 0 for success, otherwise ENOENT for the failure.
***************************************************************************/
int RemoveFd(int fd, fd_list_t **list)
{
fd_list_t *here, *prev;
if (NULL == *list)
{
return 0;
}
here = *list;
prev = NULL;
while (here != NULL)
{
if (here->fd == fd)
{
/* found it */
if (NULL == prev)
{
/* deleted the head */
*list = here->next;
}
else
{
prev->next = here->next;
}
free(here);
return 0;
}
prev = here;
here = here->next;
}
return ENOENT;
}
/***************************************************************************
* Function : PrintFdList
* Description: This is a debugging routine for printing all of file
* descriptors in a file descriptor list.
* Parameters : list - a pointer to the head of an file descriptor list.
* Effects : The values of all of the file descriptors in the list are
* written to stdout.
* Returned : None.
***************************************************************************/
void PrintFdList(const fd_list_t *list)
{
const fd_list_t *here;
if (NULL == list)
{
printf("No fds\n");
return;
}
here = list;
printf("fds: ");
while (here != NULL)
{
if (here->next != NULL)
{
printf("%d, ", here->fd);
}
else
{
printf("%d\n", here->fd);
}
here = here->next;
}
}
|
the_stack_data/90762068.c | typedef struct __attribute__((__may_alias__)) { short x; } test;
test *p;
int g(int *a)
{
p = (test*)a;
}
int f()
{
int a;
g(&a);
a = 10;
test s={1};
*p=s;
return a;
}
int main() {
if (f() == 10)
__builtin_abort();
return 0;
}
|
the_stack_data/33203.c | #include <stdio.h>
#include <string.h>
char analyze(char *sequence)
{
int length = strlen(sequence);
if (strcmp(sequence, "1") == 0 || strcmp(sequence, "4") == 0 || strcmp(sequence, "78") == 0)
{
return '+';
}
char *lastTwoDigits = sequence + (length - 2);
if (strcmp(lastTwoDigits, "35") == 0)
{
return '-';
}
char firstDigit = sequence[0];
char lastDigit = sequence[length - 1];
if (firstDigit == '9' && lastDigit == '4')
{
return '*';
}
if (strncmp(sequence, "190", 3) == 0)
{
return '?';
}
return '!';
}
int main()
{
int n; /* A integer n stating the number of encrypted results */
scanf("%d\n", &n);
int i;
char sequence[20], output;
for (i = 0; i < n; i++)
{
fgets(sequence, 20, stdin);
strtok(sequence, "\n");
output = analyze(sequence);
printf("%c\n", output);
}
return 0;
} |
the_stack_data/192331692.c | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#include<unistd.h>
#include<sys/msg.h>
#define MAX_TEXT 512
//#define BUFSIZ 100
struct my_msg_st
{
long int type;char some_text[MAX_TEXT];
};
int main()
{
int running=1;int msgid;struct my_msg_st some_data;
char buffer[BUFSIZ];
msgid=msgget((key_t)1234,0666|IPC_CREAT);
if(msgid==-1)
{
fprintf(stderr,"failed to create:\n");
exit(EXIT_FAILURE);
}
// while(running)
// {
printf("\nEnter some text:");
fgets(buffer,BUFSIZ,stdin);
some_data.type=1;
strcpy(some_data.some_text,buffer);
if(msgsnd(msgid,(void*)&some_data,MAX_TEXT,0)==-1)
{
fprintf(stderr,"failed to send:\n");
exit(EXIT_FAILURE);
}
if(strncmp(buffer,"end",3)==0)
running=0;
//}
exit(EXIT_SUCCESS);
return 0;
}
|
the_stack_data/34512678.c | /*10. Write a program that asks for a value in centimeter and convert it into meter and kilometer.
kilometer = centimeters/100000;*/
#include <stdio.h>
int main()
{
int number01 = 0;
printf("Insert your value in cm:");
scanf_s("%i", &number01);
printf("Your value in meters is %fm \n", (float)number01 / 1000);
printf("Your value in kilometers is %fkm", (float)number01 / 1000000);
return 0;
} |
the_stack_data/14545.c | #include <stdio.h>
char nome_musica1[20];
char nome_musica2[20];
char nome_musica3[20];
char nome_autor1[20];
char nome_autor2[20];
char nome_autor3[20];
FILE *file;
void main(){
int opc;
printf("Programa de biblioteca de musica.\n");
do {
printf("\nMENU\n\n");
printf("1 - Entrada de Dados\n2 - Listar Dados na Tela\n3 - Pesquisar Musica\n4 - Pesquisar Autor por Letra\n5 - Alterar Dados\n6 - Excluir Dados\n7 - Sair\n\n");
printf("Opcao: ");
scanf(" %s" , &opc);
switch (opc)
{
case '1':
entradaDados();
break;
case '2':
listaDados();
break;
case '3':
pesquisaMusica();
break;
case '4':
pesquisaAutor();
break;
case '5':
alteraDados();
break;
case '6':
excluiDados();
break;
case '7':
printf("\nSaindo do programa...");
exit(0);
default:
break;
}} while (opc != 7);
}
entradaDados(){
printf("\nEntrada de Dados\n\n");
printf("Musica 1: ");
scanf("%s" , &nome_musica1);
printf("Autor 1: ");
scanf("%s" , &nome_autor1);
printf("Musica 2: ");
scanf("%s" , &nome_musica2);
printf("Autor 2: ");
scanf("%s" , &nome_autor2);
printf("Musica 3: ");
scanf("%s" , &nome_musica3);
printf("Autor 3: ");
scanf("%s" , &nome_autor3);
file = fopen ("musica.txt", "w");
fwrite(&nome_musica1, sizeof(nome_musica1),1,file);
fwrite(&nome_autor1, sizeof(nome_autor1),1,file);
fwrite(&nome_musica2, sizeof(nome_musica2),1,file);
fwrite(&nome_autor2, sizeof(nome_autor2),1,file);
fwrite(&nome_musica3, sizeof(nome_musica3),1,file);
fwrite(&nome_autor3, sizeof(nome_autor3),1,file);
fclose (file);
}
listaDados(){
printf("\nListagem de Dados\n\n");
file = fopen ("musica.txt", "r");
fread (&nome_musica1, sizeof (nome_musica1) ,1,file);
printf("Musica 1 - %s ", nome_musica1);
fread (&nome_autor1, sizeof (nome_autor1) ,1,file);
printf("Autor 1 - %s\n", nome_autor1);
fread (&nome_musica2, sizeof (nome_musica2) ,1,file);
printf("Musica 2 - %s ", nome_musica2);
fread (&nome_autor2, sizeof (nome_autor2) ,1,file);
printf("Autor 2 - %s\n", nome_autor2);
fread (&nome_musica3, sizeof (nome_musica3) ,1,file);
printf("Musica 3 - %s ", nome_musica3);
fread (&nome_autor3, sizeof (nome_autor3) ,1,file);
printf("Autor 3 - %s\n", nome_autor3);
fclose(file);
}
pesquisaMusica(){
char pesquisa[20];
printf("\nPesquisa de Musica\n");
printf("Nome completo da musica: ");
scanf("%s" , &pesquisa);
int x;
int vf=0; // inicia como não localizada
// verificador musica1
x=0; // reset loop
while (pesquisa[x] == nome_musica1[x] && pesquisa[x] != '\0' && nome_musica1[x] != '\0')
{
++x;
}
if (pesquisa[x] == '\0' && nome_musica1[x] == '\0'){
printf("\nMusica encontrada na posicao 1.\n");
vf=1; //caso seja localizada o valor é alterado
}
// verificador musica2
x=0; // reset loop
while (pesquisa[x] == nome_musica2[x] && pesquisa[x] != '\0' && nome_musica2[x] != '\0')
{
++x;
}
if (pesquisa[x] == '\0' && nome_musica2[x] == '\0'){
printf("\nMusica encontrada na posicao 2.\n");
vf=1;
}
// verificador musica3
x=0; // reset loop
while (pesquisa[x] == nome_musica3[x] && pesquisa[x] != '\0' && nome_musica3[x] != '\0')
{
++x;
}
if (pesquisa[x] == '\0' && nome_musica3[x] == '\0'){
printf("\nMusica encontrada na posicao 3.\n");
vf=1;
}
if (vf==0){printf("\nMusica nao encontrada.\n");} // caso o valor não se altere não foi encontrada.
}
pesquisaAutor(){
printf("\nPesquisa de Autor\n");
char p;
printf("\nInforme a primeira letra do autor: ");
scanf("%s" , &p);
int vf=0; // inicia como não localizada
if (p == nome_autor1[0]){
printf("\nAutor encontrado na posicao 1: %s\n" , nome_autor1);
vf=1; // caso localizada o valor se altera
}
if (p == nome_autor2[0]){
printf("\nAutor encontrado na posicao 2: %s\n" , nome_autor2);
vf=1;
}
if (p == nome_autor3[0]){
printf("\nAutor encontrado na posicao 3: %s\n" , nome_autor3);
vf=1;
}
if (vf==0){printf("\nAutor nao encontrado.\n");} // caso o valor não se altere não foi encontrado.
}
alteraDados(){
char p[20];
printf("\nAlteracao de Dados\n");
printf("Nome completo da musica: ");
scanf("%s" , &p);
int x; // variavel para verificação de caracteres
int vf=0; // inicia como não localizada
// verificador primeira musica
x=0; // reset loop
while (p[x] == nome_musica1[x] && p[x] != '\0' && nome_musica1[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica1[x] == '\0'){
printf ("\nMusica encontrada na posicao 1.\n");
printf("Novo nome: ");
scanf("%s",&nome_musica1);
printf("Novo autor: ");
scanf("%s",&nome_autor1);
vf=1; // caso localizada o valor se altera
}
// verificador segunda musica
x=0; // reset loop
while (p[x] == nome_musica2[x] && p[x] != '\0' && nome_musica2[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica2[x] == '\0'){
printf ("\nMusica encontrada na posicao 2.\n");
printf("Novo nome: ");
scanf("%s",&nome_musica2);
printf("Novo autor: ");
scanf("%s",&nome_autor2);
vf=1; // caso localizada o valor se altera
}
// verificador terceira musica
x=0; // reset loop
while (p[x] == nome_musica3[x] && p[x] != '\0' && nome_musica3[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica3[x] == '\0'){
printf ("\nMusica encontrada na posicao 3.\n");
printf("Novo nome: ");
scanf("%s",&nome_musica3);
printf("Novo autor: ");
scanf("%s",&nome_autor3);
vf=1; // caso localizada o valor se altera
}
if (vf==0){printf("\nMusica não encontrada.\n");} // caso o valor não se altere não foi encontrada.
// registro de dados no arquivo
file = fopen ("musica.txt", "w");
fwrite(&nome_musica1, sizeof(nome_musica1),1,file);
fwrite(&nome_autor1, sizeof(nome_autor1),1,file);
fwrite(&nome_musica2, sizeof(nome_musica2),1,file);
fwrite(&nome_autor2, sizeof(nome_autor2),1,file);
fwrite(&nome_musica3, sizeof(nome_musica3),1,file);
fwrite(&nome_autor3, sizeof(nome_autor3),1,file);
fclose (file);
}
excluiDados(){
printf("\nExclusao de Dados\n");
char p[20];
printf("Nome completo da musica: ");
scanf("%s" , &p);
int x; // variavel para verificação de caracteres
int z; // variavel para exclusão de caracteres
int vf=0; // inicia como nao localizada
// verificador primeira musica
x=0; // reset loop
z=0; // reset loop
while (p[x] == nome_musica1[x] && p[x] != '\0' && nome_musica1[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica1[x] == '\0'){
printf ("\nMusica encontrada na posicao 1.\n");
while (nome_musica1[z] != '\0'){ // exclusao caracteres posicao 1
nome_musica1[z] =' ';
++z;
}
z=0; // reset loop
while (nome_autor1[z] != '\0'){ // exclusao caracteres posicao 1
nome_autor1[z] =' ';
++z;
}
printf ("\nMusica excluida com sucesso!\n");
vf=1;
}
// verificador segunda musica
x=0; // reset loop
z=0; // reset loop
while (p[x] == nome_musica2[x] && p[x] != '\0' && nome_musica2[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica2[x] == '\0'){
printf ("\nMusica encontrada na posicao 2.\n");
while (nome_musica2[z] != '\0'){ // exclusao caracteres posicao 2
nome_musica2[z] =' ';
++z;
}
z=0; // reset loop
while (nome_autor2[z] != '\0'){ // exclusao caracteres posicao 2
nome_autor2[z] =' ';
++z;
}
printf ("\nMusica excluida com sucesso!\n");
vf=1;
}
// verificador terceira musica
x=0; // reset loop
z=0; // reset loop
while (p[x] == nome_musica3[x] && p[x] != '\0' && nome_musica3[x] != '\0')
{
++x;
}
if (p[x] == '\0' && nome_musica3[x] == '\0'){
printf ("\nMusica encontrada na posicao 3.\n");
while (nome_musica3[z] != '\0'){ // exclusao caracteres posicao 3
nome_musica3[z] =' ';
++z;
}
z=0; // reset loop
while (nome_autor3[z] != '\0'){ // exclusao caracteres posicao 3
nome_autor3[z] =' ';
++z;
}
printf ("\nMusica excluida com sucesso!\n");
vf=1;
}
if (vf==0){printf("\nMusica não encontrada.\n");} // caso o valor não se altere não foi encontrada.
// registro de dados no arquivo
file = fopen ("musica.txt", "w");
fwrite(&nome_musica1, sizeof(nome_musica1),1,file);
fwrite(&nome_autor1, sizeof(nome_autor1),1,file);
fwrite(&nome_musica2, sizeof(nome_musica2),1,file);
fwrite(&nome_autor2, sizeof(nome_autor2),1,file);
fwrite(&nome_musica3, sizeof(nome_musica3),1,file);
fwrite(&nome_autor3, sizeof(nome_autor3),1,file);
fclose (file);
} |
the_stack_data/89200486.c | union test {
int a[2];
char c[8];
double d;
};
int main() {
union test a;
int i = 0;
for (i = 0; i < 8; i++) {
a.c[i] = i + 1;
}
return (a.a[0] + a.a[1]) % 256;
}
|
the_stack_data/3946.c | #include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
int main()
{
struct stat sb, sb_new;
int stat_st;
int chown_st;
// read origin owner
stat_st = stat("./chown.c", &sb);
printf("UID=%ld, GID=%ld\n", (long int)sb.st_uid, (long int) sb.st_gid);
// change owner
chown_st = chown("./chown.c", 1001, 1001);
if (chown_st == -1) {
printf("error\n");
return chown_st;
}
stat_st = stat("./chown.c", &sb_new);
printf("UID=%ld, GID=%ld\n", (long int)sb_new.st_uid, (long int) sb_new.st_gid);
// change owner to origin
chown_st = chown("./chown.c", sb.st_uid, sb.st_gid);
if (chown_st == -1) {
printf("error\n");
return chown_st;
}
stat_st = stat("./chown.c", &sb);
printf("UID=%ld, GID=%ld\n", (long int)sb.st_uid, (long int) sb.st_gid);
return 0;
}
|
the_stack_data/54857.c | // RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm %s -o - | FileCheck %s
// CHECK: define void @foo() #0
__attribute__((signal)) void foo(void) { }
// CHECK: attributes #0 = {{{.*signal.*}}}
|
the_stack_data/26699109.c | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#define MAXBUF 1024
int port = 8000;
int listen_port = 5; //最大监听数
void ShowCerts(SSL * ssl)
{
X509 *cert;
char *line;
cert = SSL_get_peer_certificate(ssl);
// SSL_get_verify_result()是重点,SSL_CTX_set_verify()只是配置启不启用并没有执行认证,调用该函数才会真证进行证书认证
// 如果验证不通过,那么程序抛出异常中止连接
if(SSL_get_verify_result(ssl) == X509_V_OK){
printf("证书验证通过\n");
}
if (cert != NULL) {
printf("数字证书信息:\n");
line = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
printf("证书: %s\n", line);
free(line);
line = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
printf("颁发者: %s\n", line);
free(line);
X509_free(cert);
} else
printf("无证书信息!\n");
}
int main(int argc, char **argv) {
int sockfd, new_fd;
socklen_t len;
struct sockaddr_in my_addr, their_addr;
char buf[MAXBUF + 1];
SSL_CTX *ctx;
/* SSL 库初始化 */
SSL_library_init();
/* 载入所有 SSL 算法 */
OpenSSL_add_all_algorithms();
/* 载入所有 SSL 错误消息 */
SSL_load_error_strings();
/* 以 SSL V2 和 V3 标准兼容方式产生一个 SSL_CTX ,即 SSL Content Text */
ctx = SSL_CTX_new(SSLv23_server_method());
/* 也可以用 SSLv2_server_method() 或 SSLv3_server_method() 单独表示 V2 或 V3标准 */
if (ctx == NULL) {
ERR_print_errors_fp(stdout);
exit(1);
}
SSL_CTX_set_default_passwd_cb_userdata(ctx,"1qaz2wsx");
// 双向验证
// SSL_VERIFY_PEER---要求对证书进行认证,没有证书也会放行
// SSL_VERIFY_FAIL_IF_NO_PEER_CERT---要求客户端需要提供证书,但验证发现单独使用没有证书也会放行
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL);
// 设置信任根证书
if (SSL_CTX_load_verify_locations(ctx, "../certificate/ca.crt",NULL)<=0){
ERR_print_errors_fp(stdout);
exit(1);
}
/* 载入用户的数字证书, 此证书用来发送给客户端。 证书里包含有公钥 */
if (SSL_CTX_use_certificate_file(ctx, "../certificate/server.crt", SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stdout);
exit(1);
}
/* 载入用户私钥 */
if (SSL_CTX_use_PrivateKey_file(ctx, "../certificate/server_rsa_private.pem.unsecure", SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stdout);
exit(1);
}
/* 检查用户私钥是否正确 */
if (!SSL_CTX_check_private_key(ctx)) {
ERR_print_errors_fp(stdout);
exit(1);
}
/* 开启一个 socket 监听 */
if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
} else
printf("socket created\n");
bzero(&my_addr, sizeof(my_addr));
my_addr.sin_family = PF_INET;
my_addr.sin_port = htons(port);
my_addr.sin_addr.s_addr = INADDR_ANY;
if (bind(sockfd, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) == -1) {
perror("bind");
exit(1);
} else
printf("binded\n");
if (listen(sockfd, listen_port) == -1) {
perror("listen");
exit(1);
} else
printf("begin listen\n");
while (1) {
SSL *ssl;
len = sizeof(struct sockaddr);
/* 等待客户端连上来 */
if ((new_fd = accept(sockfd, (struct sockaddr *) &their_addr, &len))
== -1) {
perror("accept");
exit(errno);
} else
printf("server: got connection from %s, port %d, socket %d\n",
inet_ntoa(their_addr.sin_addr), ntohs(their_addr.sin_port),
new_fd);
/* 基于 ctx 产生一个新的 SSL */
ssl = SSL_new(ctx);
/* 将连接用户的 socket 加入到 SSL */
SSL_set_fd(ssl, new_fd);
/* 建立 SSL 连接 */
if (SSL_accept(ssl) == -1) {
perror("accept");
close(new_fd);
break;
}
ShowCerts(ssl);
/* 开始处理每个新连接上的数据收发 */
bzero(buf, MAXBUF + 1);
strcpy(buf, "server->client");
/* 发消息给客户端 */
len = SSL_write(ssl, buf, strlen(buf));
if (len <= 0) {
printf("消息'%s'发送失败!错误代码是%d,错误信息是'%s'\n", buf, errno,
strerror(errno));
goto finish;
} else
printf("消息'%s'发送成功,共发送了%d个字节!\n", buf, len);
bzero(buf, MAXBUF + 1);
/* 接收客户端的消息 */
len = SSL_read(ssl, buf, MAXBUF);
if (len > 0)
printf("接收消息成功:'%s',共%d个字节的数据\n", buf, len);
else
printf("消息接收失败!错误代码是%d,错误信息是'%s'\n",
errno, strerror(errno));
/* 处理每个新连接上的数据收发结束 */
finish:
/* 关闭 SSL 连接 */
SSL_shutdown(ssl);
/* 释放 SSL */
SSL_free(ssl);
/* 关闭 socket */
close(new_fd);
}
/* 关闭监听的 socket */
close(sockfd);
/* 释放 CTX */
SSL_CTX_free(ctx);
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.