Exemplo n.º 1
0
int
puts(const char *s)
{
  // DS: Variable length array (C99)
  char str[__builtin_strlen(s) + 1];
  __builtin_strcpy(str, s);
  str[__builtin_strlen(s)] = '\n';
  return stdout->write(stdout->cookie, str, __builtin_strlen(s) + 1);
}
Exemplo n.º 2
0
__attribute__((noipa)) size_t
foo (char *p, char *q, size_t *r)
{
  size_t n0 = __builtin_strlen (p);
  __builtin_strncat (q, p, n0);		/* { dg-warning "specified bound depends on the length" } */
  size_t n1 = __builtin_strlen (p);
  *r = n0;
  return n1;
}
Exemplo n.º 3
0
static int
parse_icap_version(char **buf){
	parse_whitespaces(buf);
	if(strncasecmp(*buf,ICAP_VERSION_STR,__builtin_strlen(ICAP_VERSION_STR))){
		bitch("Bad ICAP version: %s != %s\n",*buf,ICAP_VERSION_STR);
		return -1;
	}
	*buf += __builtin_strlen(ICAP_VERSION_STR);
	return 0;
}
Exemplo n.º 4
0
int main(int argc, char *argv[]) {
  char *source = "asdf";
  char target[__builtin_strlen(source) + 1];
  move(target, source, __builtin_strlen(source) + 1);
  if (__builtin_strcmp(target, source) != 0) {
    abort();
  } else {
    exit(0);
  }
}
Exemplo n.º 5
0
// Returns 1 for a valid SSDP response, -1 for a valid SSDP query, 0 otherwise
int handle_ssdp_packet(omphalos_packet *op,const void *frame,size_t len) {
    if(len < __builtin_strlen(SSDP_METHOD_NOTIFY)) {
        diagnostic("%s frame too short (%zu)",__func__,len);
        op->malformed = 1;
        return 0;
    }
    if(strncmp(frame,SSDP_METHOD_NOTIFY,__builtin_strlen(SSDP_METHOD_NOTIFY)) == 0) {
        return 1;
    } else if(strncmp(frame,SSDP_METHOD_SEARCH,__builtin_strlen(SSDP_METHOD_SEARCH)) == 0) {
        return -1;
    }
    return 0;
}
Exemplo n.º 6
0
unsigned g (void)
{
  char d[8];
  const char s[] = "0123";
  __builtin_memcpy (d, s, sizeof s);
  return __builtin_strlen (d);
}
Exemplo n.º 7
0
void
foo (void)
{
  printf ("%zu\n", strspn ("abc", "abcdefg"));
  printf ("%zu\n", (size_t) strspn ("abc", "abcdefg"));
  printf ("%zu\n", __builtin_strspn ("abc", "abcdefg"));
  printf ("%zu\n", (size_t) __builtin_strspn ("abc", "abcdefg"));
  printf ("%zu\n", strcspn ("abc", "abcdefg"));
  printf ("%zu\n", (size_t) strcspn ("abc", "abcdefg"));
  printf ("%zu\n", __builtin_strcspn ("abc", "abcdefg"));
  printf ("%zu\n", (size_t) __builtin_strcspn ("abc", "abcdefg"));
  printf ("%zu\n", strlen ("abc"));
  printf ("%zu\n", (size_t) strlen ("abc"));
  printf ("%zu\n", __builtin_strlen ("abc"));
  printf ("%zu\n", (size_t) __builtin_strlen ("abc"));
}
Exemplo n.º 8
0
void
_cgo_panic (const char *p)
{
  intgo len;
  unsigned char *data;
  String *ps;
  Eface e;
  const struct __go_type_descriptor *td;

  runtime_exitsyscall (0);
  len = __builtin_strlen (p);
  data = alloc_saved (len);
  __builtin_memcpy (data, p, len);
  ps = alloc_saved (sizeof *ps);
  ps->str = data;
  ps->len = len;
  td = &string_type_descriptor;
  memcpy(&e._type, &td, sizeof td); /* This is a const_cast.  */
  e.data = ps;

  /* We don't call runtime_entersyscall here, because normally what
     will happen is that we will walk up the stack to a Go deferred
     function that calls recover.  However, this will do the wrong
     thing if this panic is recovered and the stack unwinding is
     caught by a C++ exception handler.  It might be possible to
     handle this by calling runtime_entersyscall in the personality
     function in go-unwind.c.  FIXME.  */

  __go_panic (e);
}
Exemplo n.º 9
0
static enum user_response
authenticate_user(request *req,
                  char **user_name,
                  struct user_info **user_item)
{
  char *authent = ((void *)0);
  har resp = ha_no_value;
  enum user_response user_resp;
  int ret_val = no_user_response;
  if (req->authent && __builtin_strlen(req->authent)) {
    authent = req->authent;
    user_resp = get_user_info_from_header(req->internal_realm,
                                          user_name,
                                          user_item);
    if (user_resp == ok_user_response) {
      resp = has_auth_user(authent, 0, req->internal_realm, "", 1);
      if (resp == ha_no_error)
	ret_val = ok_user_response;
      else if (resp != he_stale_nonce)
	ret_val = access_denied_user_response;
    } else if (user_resp == access_denied_user_response)
      ret_val = access_denied_user_response;
  }
  if (resp != he_memory_too_small && resp != ha_no_error)
    resp = has_www_auth("", 1, req->internal_realm, resp);
  return ret_val;
}
Exemplo n.º 10
0
String
Signame (intgo sig)
{
  const char* s = NULL;
  char buf[100];
  size_t len;
  byte *data;
  String ret;

#if defined(HAVE_STRSIGNAL)
  s = strsignal (sig);
#endif

  if (s == NULL)
    {
      snprintf(buf, sizeof buf, "signal %ld", (long) sig);
      s = buf;
    }
  len = __builtin_strlen (s);
  data = runtime_mallocgc (len, FlagNoPointers, 0, 0);
  __builtin_memcpy (data, s, len);
  ret.str = data;
  ret.len = len;
  return ret;
}
Exemplo n.º 11
0
int
foo (const char *name)
{
  if (name)
    return 6;
  return __builtin_strlen (name);	/* { dg-warning "argument 1 null where non-null expected" } */
}
Exemplo n.º 12
0
int
main ()
{
  char a[8] = "";
  __builtin_strcpy (a, "123");
  size_t n0 = __builtin_strlen (a);
  __builtin_strncat (a + 3, a, n0);	/* { dg-warning "specified bound depends on the length" } */
  size_t n1 = __builtin_strlen (a);
  if (n1 == n0)
    __builtin_abort ();
  a[6] = '7';
  __builtin_strcpy (a, "456");
  size_t n2;
  if (foo (a, a + 3, &n2) != 6 || n2 != 3)
    __builtin_abort ();
  if (__builtin_memcmp (a, "456456\0", sizeof "456456\0"))
    __builtin_abort ();
  return 0;
}
Exemplo n.º 13
0
void verbose_text_loop (void *data)
{
  FILE *dev_vcs;
  char buf[81];
  GString *buf_str;
  gshort i, j;
  while (1)      
    {
      for (i = 1; i <= 7; i++)
	{
	  while (fgets (buf, 81, dev_vcs))
	    {
	      for (j = 0;   j < __builtin_strlen (buf);   j++)
		if (buf[j] != ' ')    
		  break;   
	      for (;   j < __builtin_strlen (buf);   j++)
		g_string_append_c_inline (buf_str, buf[j]); 
	    }
	}
    }
}
Exemplo n.º 14
0
// FIXME is it safe to be using (possibly signed) naked chars?
static int
process_reverse_lookup(const char *buf,int *fam,void *addr){
	const size_t len = strlen(buf);

	// First, check for mDNS
	if(len < __builtin_strlen(MDNS_REVSTR_DECODED)){
		return -1;
	}
	const size_t xmlen = len - __builtin_strlen(MDNS_REVSTR_DECODED);
	if(strcmp(buf + xmlen,MDNS_REVSTR_DECODED) == 0){
		// FIXME for now, do nothing with mDNS PTR records
		return -1;
	}
	// Check the IPv6 string first (it's shorter)
	if(len < __builtin_strlen(IP6_REVSTR_DECODED)){
		return -1;
	}
	const size_t x6len = len - __builtin_strlen(IP6_REVSTR_DECODED);
	if(strcmp(buf + x6len,IP6_REVSTR_DECODED) == 0){
		return process_reverse6_lookup(buf,fam,addr,x6len);
	}
	// Look for the IPv4 string
	if(len < __builtin_strlen(IP4_REVSTR_DECODED)){
		return -1;
	}
	const size_t xlen = len - __builtin_strlen(IP4_REVSTR_DECODED);
	if(strcmp(buf + xlen,IP4_REVSTR_DECODED) == 0){
		return process_reverse4_lookup(buf,fam,addr);
	}
	return -1;
}
Exemplo n.º 15
0
static int
callback (void *data, uintptr_t pc __attribute__ ((unused)),
	  const char *filename, int lineno, const char *function)
{
  struct caller *c = (struct caller *) data;

  if (function == NULL)
    {
      c->fn.str = NULL;
      c->fn.len = 0;
    }
  else
    {
      byte *s;

      c->fn.len = __builtin_strlen (function);
      s = runtime_malloc (c->fn.len);
      __builtin_memcpy (s, function, c->fn.len);
      c->fn.str = s;
    }

  if (filename == NULL)
    {
      c->file.str = NULL;
      c->file.len = 0;
    }
  else
    {
      byte *s;

      c->file.len = __builtin_strlen (filename);
      s = runtime_malloc (c->file.len);
      __builtin_memcpy (s, filename, c->file.len);
      c->file.str = s;
    }

  c->line = lineno;

  return 0;
}
Exemplo n.º 16
0
String
getgoroot ()
{
  const char *p;
  String ret;

  p = getenv ("GOROOT");
  ret.str = (const byte *) p;
  if (ret.str == NULL)
    ret.len = 0;
  else
    ret.len = __builtin_strlen (p);
  return ret;
}
Exemplo n.º 17
0
void
__go_panic_msg (const char* msg)
{
  size_t len;
  unsigned char *sdata;
  struct __go_string s;
  struct __go_empty_interface arg;

  len = __builtin_strlen (msg);
  sdata = runtime_mallocgc (len, FlagNoPointers, 0, 0);
  __builtin_memcpy (sdata, msg, len);
  s.__data = sdata;
  s.__length = len;
  newErrorString(s, &arg);
  __go_panic (arg);
}
checkv (const char *func, int line, int res, int min, int max,
	char *dst, const char *fmt, __builtin_va_list va)
{
  int n = __builtin_vsprintf (dst, fmt, va);
  int len = __builtin_strlen (dst);

  ++ntests;

  int fail = 0;
  if (n != res)
    {
      __builtin_printf ("FAIL: %s:%i: \"%s\" expected result for \"%s\" "
			"doesn't match function call return value: ",
			func, line, fmt, dst);
      if (min == max)
	__builtin_printf ("%i != %i\n", n, min);
      else
	__builtin_printf ("%i not in [%i, %i]\n", n, min, max);

      fail = 1;
    }
  else
    {
      if (len < min || max < len)
	{
	  __builtin_printf ("FAIL: %s:%i: \"%s\" expected result for \"%s\" "
			    "doesn't match output length: ",
			    func, line, fmt, dst);

	  if (min == max)
	    __builtin_printf ("%i != %i\n", len, min);
	  else
	    __builtin_printf ("%i not in [%i, %i]\n", len, min, max);

	  fail = 1;
	}
      else if (min == max)
	__builtin_printf ("PASS: %s:%i: \"%s\" result %i: \"%s\"\n",
			  func, line, fmt, n, dst);
      else
	__builtin_printf ("PASS: %s:%i: \"%s\" result %i in [%i, %i]: \"%s\"\n",
			  func, line, fmt, n, min, max, dst);
    }

  if (fail)
    ++nfails;
}
Exemplo n.º 19
0
int main(void)
{
	char buf[128];

	int ab = __builtin_abs(-7) - __builtin_abs(5);
	printf("Res1: %d\n", ab);
	__builtin_memcpy(vals1, vals0, sizeof(vals0));
	printf("Res2: %d\n", __builtin_memcmp(vals0, vals1, sizeof(vals0)));
	__builtin_memset(vals0, 0, sizeof(vals0));
	printf("Res3: %d %d %d %d %d\n", vals0[0], vals0[1], vals0[2], vals0[3], vals0[4]);
	printf("Res4: %d\n", (int) __builtin_strlen("Hello World"));
	printf("Res5: %d\n", __builtin_strcmp(hello, "Hello World") > 0);
	__builtin_strcpy(buf, hello);
	printf("Res6: %s\n", buf);

	return 0;
}
Exemplo n.º 20
0
int C::foo (char ch, int offset) const
{
  int len = __builtin_strlen (a);
  if (len == 0)
    return __INT_MAX__;
  if (offset >= len)
    offset = len - 1;

  while (bar (offset, ch) != 0)
    {
      if (offset == 0)
        return __INT_MAX__;
      offset--;
    }

  return offset;
}
Exemplo n.º 21
0
void
_cgo_panic (const char *p)
{
  int len;
  unsigned char *data;
  struct __go_string *ps;
  struct __go_empty_interface e;

  len = __builtin_strlen (p);
  data = __go_alloc (len);
  __builtin_memcpy (data, p, len);
  ps = __go_alloc (sizeof *ps);
  ps->__data = data;
  ps->__length = len;
  e.__type_descriptor = &string_type_descriptor;
  e.__object = ps;
  __go_panic (e);
}
Exemplo n.º 22
0
int main(int argc, char **argv) {
  int a;
  a = __builtin_bswap32(a);
  a = __builtin_bswap64(a);
  a = __builtin_constant_p(1);
  a = __builtin_constant_p("string");
  char *b = __builtin_strchr("string", 's');
  a = __builtin_expect(1, a);
  a = __builtin_strlen("string");
  a = __builtin_strcmp("string1", "string2");
  a = __builtin_offsetof(struct point, y);
  char c[100];
  b = __builtin_strcpy(c, "a");
  b = __builtin_strncpy(c, "a", 1);
  a = __builtin_ctzl(a);
  varargsfn(0);
  __builtin_prefetch(b);
  __builtin_prefetch(b, 1);
  __builtin_prefetch(b, 1, 1);
  return a;
}
Exemplo n.º 23
0
static int
parse_icap_startline(char *line,struct pollfd_state *pfd,icap_status *istat){
	icap_state *is = get_pfd_icap(pfd);
	const char *method;

	is->method = parse_method(&line);
	if(is->method == ICAP_METHOD_COUNT){
		*istat = ICAPSTATUS_METHOD_NOT_IMPLEMENTED;
		return -1;
	}
	if((method = name_icap_method(is->method)) == NULL){
		bitch("Couldn't stringize method %d\n",is->method);
		*istat = ICAPSTATUS_INTERNAL_ERROR;
		return -1;
	}
	// nag("Valid method: %s\n",method);
	inc_method_begun(is->method);
	if((is->icapuri = extract_uri(ICAP_URI_SCHEME,&line)) == NULL){
		*istat = ICAPSTATUS_BAD_REQUEST;
		return -1;
	}
	if(verify_icap_uri(is->icapuri,is)){
		bitch("Bad URI for %s\n",method);
		free_uri(&is->icapuri);
		*istat = ICAPSTATUS_METHOD_BAD_SERVICE;
		return -1;
	}
	if(parse_icap_version(&line)){
		*istat = ICAPSTATUS_VERSION_NOT_SUPPORTED;
		return -1;
	}
	if(strcmp(line,CRLF)){
		bitch("Excess data after ICAP version (%zu/%zu)\n",
				strlen(line),__builtin_strlen(CRLF));
		*istat = ICAPSTATUS_BAD_REQUEST;
		return -1;
	}
	return 0;
}
// file coreutils/basename.c line 49
signed int __main(signed int argc, char **argv)
{
  unsigned long int m;
  unsigned long int n;
  char *s;
  if(!(argv == ((char **)NULL)))
    (void)0;

  else
    /* assertion !(argv == ((char **)((void*)0))) */
    __VERIFIER_error();
  signed int tmp_statement_expression$1;
  _Bool tmp_if_expr$2;
  signed int tmp_if_expr$5;
  signed int tmp_statement_expression$3;
  signed int return_value___builtin_strcmp$4;
  if(!(*(1l + argv) == ((char *)NULL)))
  {
    unsigned long int basename_main$$1$$1$$__s1_len;
    unsigned long int __s2_len;
    if((_Bool)1)
    {
      if(!((unsigned long int)("--" + 1l) + -((unsigned long int)"--") == 1ul))
        goto __CPROVER_DUMP_L3;

      __s2_len=__builtin_strlen("--");
      tmp_if_expr$2 = (__s2_len < (unsigned long int)4 ? (signed int)(1 != 0) : (signed int)(0 != 0)) != 0;
    }

    else
    {

    __CPROVER_DUMP_L3:
      ;
      tmp_if_expr$2 = 0 != 0;
    }
    if(!(tmp_if_expr$2 == (_Bool)0))
    {
      const unsigned char *__s2;
      if(!(argv == ((char **)NULL)))
        (void)0;

      else
        /* assertion !(argv == ((char **)((void*)0))) */
        __VERIFIER_error();
      __s2 = (const char *)argv[(signed long int)1];
      signed int __result;
      if(!(__s2 == ((const unsigned char *)NULL)))
        (void)0;

      else
        /* assertion !(__s2 == ((const unsigned char *)((void*)0))) */
        __VERIFIER_error();
      __result = (signed int)((const char *)"--")[(signed long int)0] - (signed int)__s2[(signed long int)0];
      if(__s2_len > 0ul)
      {
        if(__result == 0)
        {
          if(!("--" == ((const char *)NULL)))
            (void)0;

          else
            /* assertion !("--" == ((const unsigned char *)((void*)0))) */
            __VERIFIER_error();
          if(!(__s2 == ((const unsigned char *)NULL)))
            (void)0;

          else
            /* assertion !(__s2 == ((const unsigned char *)((void*)0))) */
            __VERIFIER_error();
          __result = (signed int)((const char *)"--")[(signed long int)1] - (signed int)__s2[(signed long int)1];
          if(__s2_len > 1ul)
          {
            if(__result == 0)
            {
              if(!("--" == ((const char *)NULL)))
                (void)0;

              else
                /* assertion !("--" == ((const unsigned char *)((void*)0))) */
                __VERIFIER_error();
              if(!(__s2 == ((const unsigned char *)NULL)))
                (void)0;

              else
                /* assertion !(__s2 == ((const unsigned char *)((void*)0))) */
                __VERIFIER_error();
              __result = (signed int)((const char *)"--")[(signed long int)2] - (signed int)__s2[(signed long int)2];
              if(__s2_len > 2ul)
              {
                if(__result == 0)
                {
                  if(!("--" == ((const char *)NULL)))
                    (void)0;

                  else
                    /* assertion !("--" == ((const unsigned char *)((void*)0))) */
                    __VERIFIER_error();
                  /* assertion (_Bool)0 */
                  __VERIFIER_error();
                  if(!(__s2 == ((const unsigned char *)NULL)))
                    (void)0;

                  else
                    /* assertion !(__s2 == ((const unsigned char *)((void*)0))) */
                    __VERIFIER_error();
                  __result = (signed int)((const char *)"--")[(signed long int)3] - (signed int)__s2[(signed long int)3];
                }

              }

            }

          }

        }

      }

      tmp_statement_expression$3 = __result;
      tmp_if_expr$5 = -tmp_statement_expression$3;
    }

    else
    {
      if(!(argv == ((char **)NULL)))
        (void)0;

      else
        /* assertion !(argv == ((char **)((void*)0))) */
        __VERIFIER_error();
      return_value___builtin_strcmp$4=__builtin_strcmp(argv[(signed long int)1], "--");
      tmp_if_expr$5 = return_value___builtin_strcmp$4;
    }
    tmp_statement_expression$1 = tmp_if_expr$5;
    if(tmp_statement_expression$1 == 0)
    {
      argv = argv + 1l;
      argc = argc - 1;
    }

  }
Exemplo n.º 25
0
void
main_test (void)
{
  const char *const foo = "hello world";

  if (strlen (foo) != 11)
    abort ();
  if (strlen (foo + 4) != 7)
    abort ();
  if (strlen (foo + (x++ & 7)) != 5)
    abort ();
  if (x != 7)
    abort ();
  if (strcmp (foo, "hello") <= 0)
    abort ();
  if (strcmp (foo + 2, "llo") <= 0)
    abort ();
  if (strcmp (foo, foo) != 0)
    abort ();
  if (strcmp (foo, "hello world ") >= 0)
    abort ();
  if (strcmp (foo + 10, "dx") >= 0)
    abort ();
  if (strcmp (10 + foo, "dx") >= 0)
    abort ();
  if (strcmp (bar, "") <= 0)
    abort ();
  if (strcmp ("", bar) >= 0)
    abort ();
  if (strcmp (bar+8, "") != 0)
    abort ();
  if (strcmp ("", bar+8) != 0)
    abort ();
  if (strcmp (bar+(--x), "") <= 0 || x != 6)
    abort ();
  if (strcmp ("", bar+(++x)) >= 0 || x != 7)
    abort ();
  if (strrchr (foo, 'x'))
    abort ();
  if (strrchr (foo, 'o') != foo + 7)
    abort ();
  if (strrchr (foo, 'e') != foo + 1)
    abort ();
  if (strrchr (foo + 3, 'e'))
    abort ();
  if (strrchr (foo, '\0') != foo + 11)
    abort ();
  if (strrchr (bar, '\0') != bar + 8)
    abort ();
  if (strrchr (bar + 4, '\0') != bar + 8)
    abort ();
  if (strrchr (bar + (x++ & 3), '\0') != bar + 8)
    abort ();
  if (x != 8)
    abort ();
  /* Test only one instance of rindex since the code path is the same
     as that of strrchr. */
  if (rindex ("hello", 'z') != 0)
    abort ();

  /* Test at least one instance of the __builtin_ style.  We do this
     to ensure that it works and that the prototype is correct.  */
  if (__builtin_rindex (foo, 'o') != foo + 7)
    abort ();
  if (__builtin_strrchr (foo, 'o') != foo + 7)
    abort ();
  if (__builtin_strlen (foo) != 11)
    abort ();
  if (__builtin_strcmp (foo, "hello") <= 0)
    abort ();
}
Exemplo n.º 26
0
size_t
builtin_strlen (const CHAR *p)
{
  return __builtin_strlen (p);
}
Exemplo n.º 27
0
Arquivo: pr78153-1.c Projeto: kraj/gcc
void f(const char *s)
{
    if (__PTRDIFF_MAX__ <= __builtin_strlen (s))
        __builtin_abort ();
}
Exemplo n.º 28
0
char parity7[__builtin_parity(0xb826) == 1 ? 1 : -1];
char parity8[__builtin_parity(~0) == 0 ? 1 : -1];
char parity9[__builtin_parityl(1L << (BITSIZE(long) - 1)) == 1 ? 1 : -1];
char parity10[__builtin_parityll(1LL << (BITSIZE(long long) - 1)) == 1 ? 1 : -1];

char ffs1[__builtin_ffs(0) == 0 ? 1 : -1];
char ffs2[__builtin_ffs(1) == 1 ? 1 : -1];
char ffs3[__builtin_ffs(0xfbe71) == 1 ? 1 : -1];
char ffs4[__builtin_ffs(0xfbe70) == 5 ? 1 : -1];
char ffs5[__builtin_ffs(1U << (BITSIZE(int) - 1)) == BITSIZE(int) ? 1 : -1];
char ffs6[__builtin_ffsl(0x10L) == 5 ? 1 : -1];
char ffs7[__builtin_ffsll(0x100LL) == 9 ? 1 : -1];
#undef BITSIZE

// GCC misc stuff

extern int f();

int h0 = __builtin_types_compatible_p(int, float);
//int h1 = __builtin_choose_expr(1, 10, f());
//int h2 = __builtin_expect(0, 0);
int h3 = __builtin_bswap16(0x1234) == 0x3412 ? 1 : f();
int h4 = __builtin_bswap32(0x1234) == 0x34120000 ? 1 : f();
int h5 = __builtin_bswap64(0x1234) == 0x3412000000000000 ? 1 : f();
extern long int bi0;
extern __typeof__(__builtin_expect(0, 0)) bi0;

// Strings
int array1[__builtin_strlen("ab\0cd")];
int array2[(sizeof(array1)/sizeof(int)) == 2? 1 : -1];
// file libbb/single_argv.c line 11
static char * single_argv(char **argv)
{
  signed int tmp_statement_expression$1;
  _Bool tmp_if_expr$2;
  signed int tmp_if_expr$5;
  signed int tmp_statement_expression$3;
  signed int return_value___builtin_strcmp$4;
  if(!(*(1l + argv) == ((char *)NULL)))
  {
    unsigned long int __s1_len;
    unsigned long int __s2_len;
    if((_Bool)1)
    {
      if(!((unsigned long int)("--" + 1l) + -((unsigned long int)"--") == 1ul))
        goto __CPROVER_DUMP_L1;

      __s2_len=__builtin_strlen("--");
      tmp_if_expr$2 = (__s2_len < (unsigned long int)4 ? (signed int)(1 != 0) : (signed int)(0 != 0)) != 0;
    }

    else
    {

    __CPROVER_DUMP_L1:
      ;
      tmp_if_expr$2 = 0 != 0;
    }
    if(!(tmp_if_expr$2 == (_Bool)0))
    {
      const unsigned char *__s2 = (const char *)argv[(signed long int)1];
      signed int __result = (signed int)((const char *)"--")[(signed long int)0] - (signed int)__s2[(signed long int)0];
      if(__s2_len > 0ul)
      {
        if(__result == 0)
        {
          __result = (signed int)((const char *)"--")[(signed long int)1] - (signed int)__s2[(signed long int)1];
          if(__s2_len > 1ul)
          {
            if(__result == 0)
            {
              __result = (signed int)((const char *)"--")[(signed long int)2] - (signed int)__s2[(signed long int)2];
              if(__s2_len > 2ul)
              {
                if(__result == 0)
                  __result = (signed int)((const char *)"--")[(signed long int)3] - (signed int)__s2[(signed long int)3];

              }

            }

          }

        }

      }

      tmp_statement_expression$3 = __result;
      tmp_if_expr$5 = -tmp_statement_expression$3;
    }

    else
    {
      return_value___builtin_strcmp$4=__builtin_strcmp(argv[(signed long int)1], "--");
      tmp_if_expr$5 = return_value___builtin_strcmp$4;
    }
    tmp_statement_expression$1 = tmp_if_expr$5;
    if(tmp_statement_expression$1 == 0)
      argv = argv + 1l;

  }

  _Bool tmp_if_expr$6;
  if(*(1l + argv) == ((char *)NULL))
    tmp_if_expr$6 = 1 != 0;

  else
    tmp_if_expr$6 = (argv[(signed long int)2] != (char *)NULL ? (signed int)(1 != 0) : (signed int)(0 != 0)) != 0;
  if(!(tmp_if_expr$6 == (_Bool)0))
    bb_show_usage();

  return argv[(signed long int)1];
}
Exemplo n.º 30
0
int
fputs(const char *s, FILE *stream)
{
  return stream->write(stream->cookie, s, __builtin_strlen(s));
}