2021-03-01 04:48 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000719Frama-CKernelpublic2014-02-12 16:59
Reporterregehr 
Assigned Tomonate 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product VersionFrama-C Carbon-20110201 
Target VersionFixed in VersionFrama-C Nitrogen-20111001 
Summary0000719: unsoundness due to packed structs
DescriptionAnalyzing the attached program like this:

  toplevel.opt -val -slevel 14 foo_pp.c

Gives output including this:

        g_113.f0 ? {2240865284; }
             .f1 ? {-540177875780372926; }
             .f2 ? {-1; }
             .f3 ? {0; }
             .f4 ? {-1; }
             .[bits 184 to 191] ? UNINITIALIZED
             .f5 ? {-1; }
             .f6 ? {-5796648127719171460; }

g_113 is of type S0 which is declared using the pack(1) pragma, which makes all fields 1-byte aligned, so there should be no padding.

Not packing the struct properly causes Frama-C to have an incorrect impression about its layout.

Perhaps a very strongly-worded warning should appear in the output if the pack pragma is encountered in a program, but not honored.
TagsNo tags attached.
Attached Files
  • c file icon foo_pp.c (54,091 bytes) 2011-02-13 05:47 -
    # 1 "foo.c"
    # 1 "foo.c" 1
    # 1 "<built-in>" 1
    # 1 "<built-in>" 3
    # 128 "<built-in>" 3
    # 1 "<command line>" 1
    # 1 "<built-in>" 2
    # 1 "foo.c" 2
    # 10 "foo.c"
    # 1 "/mnt/z/csmith/runtime/random_inc.h" 1
    # 51 "/mnt/z/csmith/runtime/random_inc.h"
    # 1 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/limits.h" 1 3 4
    # 38 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/limits.h" 3 4
    # 1 "/usr/include/limits.h" 1 3 4
    # 27 "/usr/include/limits.h" 3 4
    # 1 "/usr/include/features.h" 1 3 4
    # 322 "/usr/include/features.h" 3 4
    # 1 "/usr/include/bits/predefs.h" 1 3 4
    # 323 "/usr/include/features.h" 2 3 4
    # 355 "/usr/include/features.h" 3 4
    # 1 "/usr/include/sys/cdefs.h" 1 3 4
    # 353 "/usr/include/sys/cdefs.h" 3 4
    # 1 "/usr/include/bits/wordsize.h" 1 3 4
    # 354 "/usr/include/sys/cdefs.h" 2 3 4
    # 356 "/usr/include/features.h" 2 3 4
    # 387 "/usr/include/features.h" 3 4
    # 1 "/usr/include/gnu/stubs.h" 1 3 4
    
    
    
    # 1 "/usr/include/bits/wordsize.h" 1 3 4
    # 5 "/usr/include/gnu/stubs.h" 2 3 4
    
    
    # 1 "/usr/include/gnu/stubs-32.h" 1 3 4
    # 8 "/usr/include/gnu/stubs.h" 2 3 4
    # 388 "/usr/include/features.h" 2 3 4
    # 28 "/usr/include/limits.h" 2 3 4
    # 145 "/usr/include/limits.h" 3 4
    # 1 "/usr/include/bits/posix1_lim.h" 1 3 4
    # 157 "/usr/include/bits/posix1_lim.h" 3 4
    # 1 "/usr/include/bits/local_lim.h" 1 3 4
    # 39 "/usr/include/bits/local_lim.h" 3 4
    # 1 "/usr/include/linux/limits.h" 1 3 4
    # 40 "/usr/include/bits/local_lim.h" 2 3 4
    # 158 "/usr/include/bits/posix1_lim.h" 2 3 4
    # 146 "/usr/include/limits.h" 2 3 4
    
    
    
    # 1 "/usr/include/bits/posix2_lim.h" 1 3 4
    # 150 "/usr/include/limits.h" 2 3 4
    # 39 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/limits.h" 2 3 4
    # 52 "/mnt/z/csmith/runtime/random_inc.h" 2
    
    
    
    # 1 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdint.h" 1 3 4
    # 33 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdint.h" 3 4
    # 1 "/usr/include/stdint.h" 1 3 4
    # 27 "/usr/include/stdint.h" 3 4
    # 1 "/usr/include/bits/wchar.h" 1 3 4
    # 28 "/usr/include/stdint.h" 2 3 4
    # 1 "/usr/include/bits/wordsize.h" 1 3 4
    # 29 "/usr/include/stdint.h" 2 3 4
    
    
    
    
    
    
    
    
    typedef signed char int8_t;
    typedef short int int16_t;
    typedef int int32_t;
    
    
    
    __extension__
    typedef long long int int64_t;
    
    
    
    
    typedef unsigned char uint8_t;
    typedef unsigned short int uint16_t;
    
    typedef unsigned int uint32_t;
    
    
    
    
    
    __extension__
    typedef unsigned long long int uint64_t;
    
    
    
    
    
    
    typedef signed char int_least8_t;
    typedef short int int_least16_t;
    typedef int int_least32_t;
    
    
    
    __extension__
    typedef long long int int_least64_t;
    
    
    
    typedef unsigned char uint_least8_t;
    typedef unsigned short int uint_least16_t;
    typedef unsigned int uint_least32_t;
    
    
    
    __extension__
    typedef unsigned long long int uint_least64_t;
    
    
    
    
    
    
    typedef signed char int_fast8_t;
    
    
    
    
    
    typedef int int_fast16_t;
    typedef int int_fast32_t;
    __extension__
    typedef long long int int_fast64_t;
    
    
    
    typedef unsigned char uint_fast8_t;
    
    
    
    
    
    typedef unsigned int uint_fast16_t;
    typedef unsigned int uint_fast32_t;
    __extension__
    typedef unsigned long long int uint_fast64_t;
    # 126 "/usr/include/stdint.h" 3 4
    typedef int intptr_t;
    
    
    typedef unsigned int uintptr_t;
    # 138 "/usr/include/stdint.h" 3 4
    __extension__
    typedef long long int intmax_t;
    __extension__
    typedef unsigned long long int uintmax_t;
    # 34 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdint.h" 2 3 4
    # 56 "/mnt/z/csmith/runtime/random_inc.h" 2
    
    
    
    
    # 1 "/usr/include/assert.h" 1 3 4
    # 71 "/usr/include/assert.h" 3 4
    extern void __assert_fail (__const char *__assertion, __const char *__file,
          unsigned int __line, __const char *__function)
         __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
    
    
    extern void __assert_perror_fail (int __errnum, __const char *__file,
          unsigned int __line,
          __const char *__function)
         __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
    
    
    
    
    extern void __assert (const char *__assertion, const char *__file, int __line)
         __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
    # 61 "/mnt/z/csmith/runtime/random_inc.h" 2
    # 78 "/mnt/z/csmith/runtime/random_inc.h"
    # 1 "/mnt/z/csmith/runtime/platform_generic.h" 1
    # 40 "/mnt/z/csmith/runtime/platform_generic.h"
    # 1 "/usr/include/stdio.h" 1 3 4
    # 34 "/usr/include/stdio.h" 3 4
    # 1 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stddef.h" 1 3 4
    # 29 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stddef.h" 3 4
    typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
    
    
    typedef __typeof__(sizeof(int)) size_t;
    
    
    
    
    typedef int wchar_t;
    # 35 "/usr/include/stdio.h" 2 3 4
    
    # 1 "/usr/include/bits/types.h" 1 3 4
    # 28 "/usr/include/bits/types.h" 3 4
    # 1 "/usr/include/bits/wordsize.h" 1 3 4
    # 29 "/usr/include/bits/types.h" 2 3 4
    
    
    typedef unsigned char __u_char;
    typedef unsigned short int __u_short;
    typedef unsigned int __u_int;
    typedef unsigned long int __u_long;
    
    
    typedef signed char __int8_t;
    typedef unsigned char __uint8_t;
    typedef signed short int __int16_t;
    typedef unsigned short int __uint16_t;
    typedef signed int __int32_t;
    typedef unsigned int __uint32_t;
    
    
    
    
    __extension__ typedef signed long long int __int64_t;
    __extension__ typedef unsigned long long int __uint64_t;
    
    
    
    
    
    
    
    __extension__ typedef long long int __quad_t;
    __extension__ typedef unsigned long long int __u_quad_t;
    # 131 "/usr/include/bits/types.h" 3 4
    # 1 "/usr/include/bits/typesizes.h" 1 3 4
    # 132 "/usr/include/bits/types.h" 2 3 4
    
    
    __extension__ typedef __u_quad_t __dev_t;
    __extension__ typedef unsigned int __uid_t;
    __extension__ typedef unsigned int __gid_t;
    __extension__ typedef unsigned long int __ino_t;
    __extension__ typedef __u_quad_t __ino64_t;
    __extension__ typedef unsigned int __mode_t;
    __extension__ typedef unsigned int __nlink_t;
    __extension__ typedef long int __off_t;
    __extension__ typedef __quad_t __off64_t;
    __extension__ typedef int __pid_t;
    __extension__ typedef struct { int __val[2]; } __fsid_t;
    __extension__ typedef long int __clock_t;
    __extension__ typedef unsigned long int __rlim_t;
    __extension__ typedef __u_quad_t __rlim64_t;
    __extension__ typedef unsigned int __id_t;
    __extension__ typedef long int __time_t;
    __extension__ typedef unsigned int __useconds_t;
    __extension__ typedef long int __suseconds_t;
    
    __extension__ typedef int __daddr_t;
    __extension__ typedef long int __swblk_t;
    __extension__ typedef int __key_t;
    
    
    __extension__ typedef int __clockid_t;
    
    
    __extension__ typedef void * __timer_t;
    
    
    __extension__ typedef long int __blksize_t;
    
    
    
    
    __extension__ typedef long int __blkcnt_t;
    __extension__ typedef __quad_t __blkcnt64_t;
    
    
    __extension__ typedef unsigned long int __fsblkcnt_t;
    __extension__ typedef __u_quad_t __fsblkcnt64_t;
    
    
    __extension__ typedef unsigned long int __fsfilcnt_t;
    __extension__ typedef __u_quad_t __fsfilcnt64_t;
    
    __extension__ typedef int __ssize_t;
    
    
    
    typedef __off64_t __loff_t;
    typedef __quad_t *__qaddr_t;
    typedef char *__caddr_t;
    
    
    __extension__ typedef int __intptr_t;
    
    
    __extension__ typedef unsigned int __socklen_t;
    # 37 "/usr/include/stdio.h" 2 3 4
    
    
    
    
    
    
    
    
    struct _IO_FILE;
    
    
    
    typedef struct _IO_FILE FILE;
    # 65 "/usr/include/stdio.h" 3 4
    typedef struct _IO_FILE __FILE;
    # 75 "/usr/include/stdio.h" 3 4
    # 1 "/usr/include/libio.h" 1 3 4
    # 32 "/usr/include/libio.h" 3 4
    # 1 "/usr/include/_G_config.h" 1 3 4
    # 15 "/usr/include/_G_config.h" 3 4
    # 1 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stddef.h" 1 3 4
    # 16 "/usr/include/_G_config.h" 2 3 4
    
    
    
    
    # 1 "/usr/include/wchar.h" 1 3 4
    # 83 "/usr/include/wchar.h" 3 4
    typedef struct
    {
      int __count;
      union
      {
    
        unsigned int __wch;
    
    
    
        char __wchb[4];
      } __value;
    } __mbstate_t;
    # 21 "/usr/include/_G_config.h" 2 3 4
    
    typedef struct
    {
      __off_t __pos;
      __mbstate_t __state;
    } _G_fpos_t;
    typedef struct
    {
      __off64_t __pos;
      __mbstate_t __state;
    } _G_fpos64_t;
    # 53 "/usr/include/_G_config.h" 3 4
    typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
    typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
    typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
    typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
    # 33 "/usr/include/libio.h" 2 3 4
    # 53 "/usr/include/libio.h" 3 4
    # 1 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdarg.h" 1 3 4
    # 30 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdarg.h" 3 4
    typedef __builtin_va_list va_list;
    # 48 "/mnt/z/z/compiler-install/llvm-gcc-r125433-install/bin/../lib/clang/2.9/include/stdarg.h" 3 4
    typedef __builtin_va_list __gnuc_va_list;
    # 54 "/usr/include/libio.h" 2 3 4
    # 170 "/usr/include/libio.h" 3 4
    struct _IO_jump_t; struct _IO_FILE;
    # 180 "/usr/include/libio.h" 3 4
    typedef void _IO_lock_t;
    
    
    
    
    
    struct _IO_marker {
      struct _IO_marker *_next;
      struct _IO_FILE *_sbuf;
    
    
    
      int _pos;
    # 203 "/usr/include/libio.h" 3 4
    };
    
    
    enum __codecvt_result
    {
      __codecvt_ok,
      __codecvt_partial,
      __codecvt_error,
      __codecvt_noconv
    };
    # 271 "/usr/include/libio.h" 3 4
    struct _IO_FILE {
      int _flags;
    
    
    
    
      char* _IO_read_ptr;
      char* _IO_read_end;
      char* _IO_read_base;
      char* _IO_write_base;
      char* _IO_write_ptr;
      char* _IO_write_end;
      char* _IO_buf_base;
      char* _IO_buf_end;
    
      char *_IO_save_base;
      char *_IO_backup_base;
      char *_IO_save_end;
    
      struct _IO_marker *_markers;
    
      struct _IO_FILE *_chain;
    
      int _fileno;
    
    
    
      int _flags2;
    
      __off_t _old_offset;
    
    
    
      unsigned short _cur_column;
      signed char _vtable_offset;
      char _shortbuf[1];
    
    
    
      _IO_lock_t *_lock;
    # 319 "/usr/include/libio.h" 3 4
      __off64_t _offset;
    # 328 "/usr/include/libio.h" 3 4
      void *__pad1;
      void *__pad2;
      void *__pad3;
      void *__pad4;
      size_t __pad5;
    
      int _mode;
    
      char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
    
    };
    
    
    typedef struct _IO_FILE _IO_FILE;
    
    
    struct _IO_FILE_plus;
    
    extern struct _IO_FILE_plus _IO_2_1_stdin_;
    extern struct _IO_FILE_plus _IO_2_1_stdout_;
    extern struct _IO_FILE_plus _IO_2_1_stderr_;
    # 364 "/usr/include/libio.h" 3 4
    typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
    
    
    
    
    
    
    
    typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
         size_t __n);
    
    
    
    
    
    
    
    typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
    
    
    typedef int __io_close_fn (void *__cookie);
    # 416 "/usr/include/libio.h" 3 4
    extern int __underflow (_IO_FILE *);
    extern int __uflow (_IO_FILE *);
    extern int __overflow (_IO_FILE *, int);
    # 460 "/usr/include/libio.h" 3 4
    extern int _IO_getc (_IO_FILE *__fp);
    extern int _IO_putc (int __c, _IO_FILE *__fp);
    extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
    extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
    
    extern int _IO_peekc_locked (_IO_FILE *__fp);
    
    
    
    
    
    extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
    extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
    extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
    # 490 "/usr/include/libio.h" 3 4
    extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
       __gnuc_va_list, int *__restrict);
    extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
        __gnuc_va_list);
    extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
    extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
    
    extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
    extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
    
    extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
    # 76 "/usr/include/stdio.h" 2 3 4
    
    
    
    
    typedef __gnuc_va_list va_list;
    # 91 "/usr/include/stdio.h" 3 4
    typedef __off_t off_t;
    # 103 "/usr/include/stdio.h" 3 4
    typedef __ssize_t ssize_t;
    
    
    
    
    
    
    
    typedef _G_fpos_t fpos_t;
    # 161 "/usr/include/stdio.h" 3 4
    # 1 "/usr/include/bits/stdio_lim.h" 1 3 4
    # 162 "/usr/include/stdio.h" 2 3 4
    
    
    
    extern struct _IO_FILE *stdin;
    extern struct _IO_FILE *stdout;
    extern struct _IO_FILE *stderr;
    
    
    
    
    
    
    
    extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
    
    extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
    
    
    
    
    extern int renameat (int __oldfd, __const char *__old, int __newfd,
           __const char *__new) __attribute__ ((__nothrow__));
    # 192 "/usr/include/stdio.h" 3 4
    extern FILE *tmpfile (void) ;
    # 206 "/usr/include/stdio.h" 3 4
    extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
    
    
    
    
    
    extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
    # 224 "/usr/include/stdio.h" 3 4
    extern char *tempnam (__const char *__dir, __const char *__pfx)
         __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
    # 234 "/usr/include/stdio.h" 3 4
    extern int fclose (FILE *__stream);
    
    
    
    
    extern int fflush (FILE *__stream);
    # 249 "/usr/include/stdio.h" 3 4
    extern int fflush_unlocked (FILE *__stream);
    # 269 "/usr/include/stdio.h" 3 4
    extern FILE *fopen (__const char *__restrict __filename,
          __const char *__restrict __modes) ;
    
    
    
    
    extern FILE *freopen (__const char *__restrict __filename,
            __const char *__restrict __modes,
            FILE *__restrict __stream) ;
    # 303 "/usr/include/stdio.h" 3 4
    extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
    # 316 "/usr/include/stdio.h" 3 4
    extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
      __attribute__ ((__nothrow__)) ;
    
    
    
    
    extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
    
    
    
    
    
    
    extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
    
    
    
    extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
          int __modes, size_t __n) __attribute__ ((__nothrow__));
    
    
    
    
    
    extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
             size_t __size) __attribute__ ((__nothrow__));
    
    
    extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
    # 353 "/usr/include/stdio.h" 3 4
    extern int fprintf (FILE *__restrict __stream,
          __const char *__restrict __format, ...);
    
    
    
    
    extern int printf (__const char *__restrict __format, ...);
    
    extern int sprintf (char *__restrict __s,
          __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
    
    
    
    
    
    extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
           __gnuc_va_list __arg);
    
    
    
    
    extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
    
    extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
           __gnuc_va_list __arg) __attribute__ ((__nothrow__));
    
    
    
    
    
    extern int snprintf (char *__restrict __s, size_t __maxlen,
           __const char *__restrict __format, ...)
         __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
    
    extern int vsnprintf (char *__restrict __s, size_t __maxlen,
            __const char *__restrict __format, __gnuc_va_list __arg)
         __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
    # 414 "/usr/include/stdio.h" 3 4
    extern int vdprintf (int __fd, __const char *__restrict __fmt,
           __gnuc_va_list __arg)
         __attribute__ ((__format__ (__printf__, 2, 0)));
    extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
         __attribute__ ((__format__ (__printf__, 2, 3)));
    # 427 "/usr/include/stdio.h" 3 4
    extern int fscanf (FILE *__restrict __stream,
         __const char *__restrict __format, ...) ;
    
    
    
    
    extern int scanf (__const char *__restrict __format, ...) ;
    
    extern int sscanf (__const char *__restrict __s,
         __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
    # 445 "/usr/include/stdio.h" 3 4
    extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") ;
    
    
    extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") ;
    
    extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__));
    # 473 "/usr/include/stdio.h" 3 4
    extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
          __gnuc_va_list __arg)
         __attribute__ ((__format__ (__scanf__, 2, 0))) ;
    
    
    
    
    
    extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
         __attribute__ ((__format__ (__scanf__, 1, 0))) ;
    
    
    extern int vsscanf (__const char *__restrict __s,
          __const char *__restrict __format, __gnuc_va_list __arg)
         __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
    # 496 "/usr/include/stdio.h" 3 4
    extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
    
    
    
         __attribute__ ((__format__ (__scanf__, 2, 0))) ;
    extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
    
         __attribute__ ((__format__ (__scanf__, 1, 0))) ;
    extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__))
    
    
    
         __attribute__ ((__format__ (__scanf__, 2, 0)));
    # 533 "/usr/include/stdio.h" 3 4
    extern int fgetc (FILE *__stream);
    extern int getc (FILE *__stream);
    
    
    
    
    
    extern int getchar (void);
    # 552 "/usr/include/stdio.h" 3 4
    extern int getc_unlocked (FILE *__stream);
    extern int getchar_unlocked (void);
    # 563 "/usr/include/stdio.h" 3 4
    extern int fgetc_unlocked (FILE *__stream);
    # 575 "/usr/include/stdio.h" 3 4
    extern int fputc (int __c, FILE *__stream);
    extern int putc (int __c, FILE *__stream);
    
    
    
    
    
    extern int putchar (int __c);
    # 596 "/usr/include/stdio.h" 3 4
    extern int fputc_unlocked (int __c, FILE *__stream);
    
    
    
    
    
    
    
    extern int putc_unlocked (int __c, FILE *__stream);
    extern int putchar_unlocked (int __c);
    
    
    
    
    
    
    extern int getw (FILE *__stream);
    
    
    extern int putw (int __w, FILE *__stream);
    # 624 "/usr/include/stdio.h" 3 4
    extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ;
    
    
    
    
    
    
    extern char *gets (char *__s) ;
    # 658 "/usr/include/stdio.h" 3 4
    extern __ssize_t __getdelim (char **__restrict __lineptr,
              size_t *__restrict __n, int __delimiter,
              FILE *__restrict __stream) ;
    extern __ssize_t getdelim (char **__restrict __lineptr,
            size_t *__restrict __n, int __delimiter,
            FILE *__restrict __stream) ;
    
    
    
    
    
    
    
    extern __ssize_t getline (char **__restrict __lineptr,
           size_t *__restrict __n,
           FILE *__restrict __stream) ;
    # 682 "/usr/include/stdio.h" 3 4
    extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
    
    
    
    
    
    extern int puts (__const char *__s);
    
    
    
    
    
    
    extern int ungetc (int __c, FILE *__stream);
    
    
    
    
    
    
    extern size_t fread (void *__restrict __ptr, size_t __size,
           size_t __n, FILE *__restrict __stream) ;
    
    
    
    
    extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
            size_t __n, FILE *__restrict __s);
    # 730 "/usr/include/stdio.h" 3 4
    extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
             size_t __n, FILE *__restrict __stream) ;
    extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
              size_t __n, FILE *__restrict __stream);
    # 742 "/usr/include/stdio.h" 3 4
    extern int fseek (FILE *__stream, long int __off, int __whence);
    
    
    
    
    extern long int ftell (FILE *__stream) ;
    
    
    
    
    extern void rewind (FILE *__stream);
    # 766 "/usr/include/stdio.h" 3 4
    extern int fseeko (FILE *__stream, __off_t __off, int __whence);
    
    
    
    
    extern __off_t ftello (FILE *__stream) ;
    # 791 "/usr/include/stdio.h" 3 4
    extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
    
    
    
    
    extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
    # 819 "/usr/include/stdio.h" 3 4
    extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
    
    extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
    
    extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
    
    
    
    
    extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
    extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
    extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
    # 839 "/usr/include/stdio.h" 3 4
    extern void perror (__const char *__s);
    
    
    
    
    
    
    
    # 1 "/usr/include/bits/sys_errlist.h" 1 3 4
    # 27 "/usr/include/bits/sys_errlist.h" 3 4
    extern int sys_nerr;
    extern __const char *__const sys_errlist[];
    # 847 "/usr/include/stdio.h" 2 3 4
    
    
    
    
    extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
    
    
    
    
    extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
    # 866 "/usr/include/stdio.h" 3 4
    extern FILE *popen (__const char *__command, __const char *__modes) ;
    
    
    
    
    
    extern int pclose (FILE *__stream);
    
    
    
    
    
    extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
    # 906 "/usr/include/stdio.h" 3 4
    extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
    
    
    
    extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
    
    
    extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
    # 41 "/mnt/z/csmith/runtime/platform_generic.h" 2
    
    
    static void
    platform_main_begin(void)
    {
    
    }
    
    static void
    platform_main_end(uint32_t crc)
    {
    
        Frama_C_dump_assert_each();
    
     printf ("checksum = %X\n", crc);
    }
    # 79 "/mnt/z/csmith/runtime/random_inc.h" 2
    # 96 "/mnt/z/csmith/runtime/random_inc.h"
    # 1 "/mnt/z/csmith/runtime/safe_math.h" 1
    # 13 "/mnt/z/csmith/runtime/safe_math.h"
    static int8_t
    (safe_unary_minus_func_int8_t_s)(int8_t si)
    {
      return
    
    
    
    
    
    
        -si;
    }
    
    static int8_t
    (safe_add_func_int8_t_s_s)(int8_t si1, int8_t si2)
    {
      return
    
    
    
    
    
    
        (si1 + si2);
    }
    
    static int8_t
    (safe_sub_func_int8_t_s_s)(int8_t si1, int8_t si2)
    {
      return
    
    
    
    
    
    
        (si1 - si2);
    }
    
    static int8_t
    (safe_mul_func_int8_t_s_s)(int8_t si1, int8_t si2)
    {
      return
    
    
    
    
    
    
        si1 * si2;
    }
    
    static int8_t
    (safe_mod_func_int8_t_s_s)(int8_t si1, int8_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-128)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 % si2);
    }
    
    static int8_t
    (safe_div_func_int8_t_s_s)(int8_t si1, int8_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-128)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 / si2);
    }
    
    static int8_t
    (safe_lshift_func_int8_t_s_s)(int8_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32) || (left > ((127) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static int8_t
    (safe_lshift_func_int8_t_s_u)(int8_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32) || (left > ((127) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static int8_t
    (safe_rshift_func_int8_t_s_s)(int8_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32))?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static int8_t
    (safe_rshift_func_int8_t_s_u)(int8_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    static int16_t
    (safe_unary_minus_func_int16_t_s)(int16_t si)
    {
      return
    
    
    
    
    
    
        -si;
    }
    
    static int16_t
    (safe_add_func_int16_t_s_s)(int16_t si1, int16_t si2)
    {
      return
    
    
    
    
    
    
        (si1 + si2);
    }
    
    static int16_t
    (safe_sub_func_int16_t_s_s)(int16_t si1, int16_t si2)
    {
      return
    
    
    
    
    
    
        (si1 - si2);
    }
    
    static int16_t
    (safe_mul_func_int16_t_s_s)(int16_t si1, int16_t si2)
    {
      return
    
    
    
    
    
    
        si1 * si2;
    }
    
    static int16_t
    (safe_mod_func_int16_t_s_s)(int16_t si1, int16_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-32767 -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 % si2);
    }
    
    static int16_t
    (safe_div_func_int16_t_s_s)(int16_t si1, int16_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-32767 -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 / si2);
    }
    
    static int16_t
    (safe_lshift_func_int16_t_s_s)(int16_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32) || (left > ((32767) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static int16_t
    (safe_lshift_func_int16_t_s_u)(int16_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32) || (left > ((32767) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static int16_t
    (safe_rshift_func_int16_t_s_s)(int16_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32))?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static int16_t
    (safe_rshift_func_int16_t_s_u)(int16_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    static int32_t
    (safe_unary_minus_func_int32_t_s)(int32_t si)
    {
      return
    
    
        (si==(-2147483647 -1)) ?
        ((si)) :
    
    
        -si;
    }
    
    static int32_t
    (safe_add_func_int32_t_s_s)(int32_t si1, int32_t si2)
    {
      return
    
    
        (((si1>0) && (si2>0) && (si1 > ((2147483647)-si2))) || ((si1<0) && (si2<0) && (si1 < ((-2147483647 -1)-si2)))) ?
        ((si1)) :
    
    
        (si1 + si2);
    }
    
    static int32_t
    (safe_sub_func_int32_t_s_s)(int32_t si1, int32_t si2)
    {
      return
    
    
        (((si1^si2) & (((si1 ^ ((si1^si2) & (~(2147483647))))-si2)^si2)) < 0) ?
        ((si1)) :
    
    
        (si1 - si2);
    }
    
    static int32_t
    (safe_mul_func_int32_t_s_s)(int32_t si1, int32_t si2)
    {
      return
    
    
        (((si1 > 0) && (si2 > 0) && (si1 > ((2147483647) / si2))) || ((si1 > 0) && (si2 <= 0) && (si2 < ((-2147483647 -1) / si1))) || ((si1 <= 0) && (si2 > 0) && (si1 < ((-2147483647 -1) / si2))) || ((si1 <= 0) && (si2 <= 0) && (si1 != 0) && (si2 < ((2147483647) / si1)))) ?
        ((si1)) :
    
    
        si1 * si2;
    }
    
    static int32_t
    (safe_mod_func_int32_t_s_s)(int32_t si1, int32_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-2147483647 -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 % si2);
    }
    
    static int32_t
    (safe_div_func_int32_t_s_s)(int32_t si1, int32_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-2147483647 -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 / si2);
    }
    
    static int32_t
    (safe_lshift_func_int32_t_s_s)(int32_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32) || (left > ((2147483647) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static int32_t
    (safe_lshift_func_int32_t_s_u)(int32_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32) || (left > ((2147483647) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static int32_t
    (safe_rshift_func_int32_t_s_s)(int32_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32))?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static int32_t
    (safe_rshift_func_int32_t_s_u)(int32_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    
    static int64_t
    (safe_unary_minus_func_int64_t_s)(int64_t si)
    {
      return
    
    
        (si==(-9223372036854775807LL -1)) ?
        ((si)) :
    
    
        -si;
    }
    
    static int64_t
    (safe_add_func_int64_t_s_s)(int64_t si1, int64_t si2)
    {
      return
    
    
        (((si1>0) && (si2>0) && (si1 > ((9223372036854775807LL)-si2))) || ((si1<0) && (si2<0) && (si1 < ((-9223372036854775807LL -1)-si2)))) ?
        ((si1)) :
    
    
        (si1 + si2);
    }
    
    static int64_t
    (safe_sub_func_int64_t_s_s)(int64_t si1, int64_t si2)
    {
      return
    
    
        (((si1^si2) & (((si1 ^ ((si1^si2) & (~(9223372036854775807LL))))-si2)^si2)) < 0) ?
        ((si1)) :
    
    
        (si1 - si2);
    }
    
    static int64_t
    (safe_mul_func_int64_t_s_s)(int64_t si1, int64_t si2)
    {
      return
    
    
        (((si1 > 0) && (si2 > 0) && (si1 > ((9223372036854775807LL) / si2))) || ((si1 > 0) && (si2 <= 0) && (si2 < ((-9223372036854775807LL -1) / si1))) || ((si1 <= 0) && (si2 > 0) && (si1 < ((-9223372036854775807LL -1) / si2))) || ((si1 <= 0) && (si2 <= 0) && (si1 != 0) && (si2 < ((9223372036854775807LL) / si1)))) ?
        ((si1)) :
    
    
        si1 * si2;
    }
    
    static int64_t
    (safe_mod_func_int64_t_s_s)(int64_t si1, int64_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-9223372036854775807LL -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 % si2);
    }
    
    static int64_t
    (safe_div_func_int64_t_s_s)(int64_t si1, int64_t si2)
    {
      return
    
        ((si2 == 0) || ((si1 == (-9223372036854775807LL -1)) && (si2 == (-1)))) ?
        ((si1)) :
    
        (si1 / si2);
    }
    
    static int64_t
    (safe_lshift_func_int64_t_s_s)(int64_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32) || (left > ((9223372036854775807LL) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static int64_t
    (safe_lshift_func_int64_t_s_u)(int64_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32) || (left > ((9223372036854775807LL) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static int64_t
    (safe_rshift_func_int64_t_s_s)(int64_t left, int right)
    {
      return
    
        ((left < 0) || (((int)right) < 0) || (((int)right) >= 32))?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static int64_t
    (safe_rshift_func_int64_t_s_u)(int64_t left, unsigned int right)
    {
      return
    
        ((left < 0) || (((unsigned int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    
    
    
    
    static uint8_t
    (safe_unary_minus_func_uint8_t_u)(uint8_t ui)
    {
      return -ui;
    }
    
    static uint8_t
    (safe_add_func_uint8_t_u_u)(uint8_t ui1, uint8_t ui2)
    {
      return ui1 + ui2;
    }
    
    static uint8_t
    (safe_sub_func_uint8_t_u_u)(uint8_t ui1, uint8_t ui2)
    {
      return ui1 - ui2;
    }
    
    static uint8_t
    (safe_mul_func_uint8_t_u_u)(uint8_t ui1, uint8_t ui2)
    {
      return ((unsigned int)ui1) * ((unsigned int)ui2);
    }
    
    static uint8_t
    (safe_mod_func_uint8_t_u_u)(uint8_t ui1, uint8_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 % ui2);
    }
    
    static uint8_t
    (safe_div_func_uint8_t_u_u)(uint8_t ui1, uint8_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 / ui2);
    }
    
    static uint8_t
    (safe_lshift_func_uint8_t_u_s)(uint8_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32) || (left > ((255) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static uint8_t
    (safe_lshift_func_uint8_t_u_u)(uint8_t left, unsigned int right)
    {
      return
    
        ((((unsigned int)right) >= 32) || (left > ((255) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static uint8_t
    (safe_rshift_func_uint8_t_u_s)(uint8_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static uint8_t
    (safe_rshift_func_uint8_t_u_u)(uint8_t left, unsigned int right)
    {
      return
    
        (((unsigned int)right) >= 32) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    static uint16_t
    (safe_unary_minus_func_uint16_t_u)(uint16_t ui)
    {
      return -ui;
    }
    
    static uint16_t
    (safe_add_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2)
    {
      return ui1 + ui2;
    }
    
    static uint16_t
    (safe_sub_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2)
    {
      return ui1 - ui2;
    }
    
    static uint16_t
    (safe_mul_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2)
    {
      return ((unsigned int)ui1) * ((unsigned int)ui2);
    }
    
    static uint16_t
    (safe_mod_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 % ui2);
    }
    
    static uint16_t
    (safe_div_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 / ui2);
    }
    
    static uint16_t
    (safe_lshift_func_uint16_t_u_s)(uint16_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32) || (left > ((65535) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static uint16_t
    (safe_lshift_func_uint16_t_u_u)(uint16_t left, unsigned int right)
    {
      return
    
        ((((unsigned int)right) >= 32) || (left > ((65535) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static uint16_t
    (safe_rshift_func_uint16_t_u_s)(uint16_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static uint16_t
    (safe_rshift_func_uint16_t_u_u)(uint16_t left, unsigned int right)
    {
      return
    
        (((unsigned int)right) >= 32) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    static uint32_t
    (safe_unary_minus_func_uint32_t_u)(uint32_t ui)
    {
      return -ui;
    }
    
    static uint32_t
    (safe_add_func_uint32_t_u_u)(uint32_t ui1, uint32_t ui2)
    {
      return ui1 + ui2;
    }
    
    static uint32_t
    (safe_sub_func_uint32_t_u_u)(uint32_t ui1, uint32_t ui2)
    {
      return ui1 - ui2;
    }
    
    static uint32_t
    (safe_mul_func_uint32_t_u_u)(uint32_t ui1, uint32_t ui2)
    {
      return ((unsigned int)ui1) * ((unsigned int)ui2);
    }
    
    static uint32_t
    (safe_mod_func_uint32_t_u_u)(uint32_t ui1, uint32_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 % ui2);
    }
    
    static uint32_t
    (safe_div_func_uint32_t_u_u)(uint32_t ui1, uint32_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 / ui2);
    }
    
    static uint32_t
    (safe_lshift_func_uint32_t_u_s)(uint32_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32) || (left > ((4294967295U) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static uint32_t
    (safe_lshift_func_uint32_t_u_u)(uint32_t left, unsigned int right)
    {
      return
    
        ((((unsigned int)right) >= 32) || (left > ((4294967295U) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static uint32_t
    (safe_rshift_func_uint32_t_u_s)(uint32_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static uint32_t
    (safe_rshift_func_uint32_t_u_u)(uint32_t left, unsigned int right)
    {
      return
    
        (((unsigned int)right) >= 32) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    
    
    
    
    static uint64_t
    (safe_unary_minus_func_uint64_t_u)(uint64_t ui)
    {
      return -ui;
    }
    
    static uint64_t
    (safe_add_func_uint64_t_u_u)(uint64_t ui1, uint64_t ui2)
    {
      return ui1 + ui2;
    }
    
    static uint64_t
    (safe_sub_func_uint64_t_u_u)(uint64_t ui1, uint64_t ui2)
    {
      return ui1 - ui2;
    }
    
    static uint64_t
    (safe_mul_func_uint64_t_u_u)(uint64_t ui1, uint64_t ui2)
    {
      return ((unsigned long long int)ui1) * ((unsigned long long int)ui2);
    }
    
    static uint64_t
    (safe_mod_func_uint64_t_u_u)(uint64_t ui1, uint64_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 % ui2);
    }
    
    static uint64_t
    (safe_div_func_uint64_t_u_u)(uint64_t ui1, uint64_t ui2)
    {
      return
    
        (ui2 == 0) ?
        ((ui1)) :
    
        (ui1 / ui2);
    }
    
    static uint64_t
    (safe_lshift_func_uint64_t_u_s)(uint64_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32) || (left > ((18446744073709551615ULL) >> ((int)right)))) ?
        ((left)) :
    
        (left << ((int)right));
    }
    
    static uint64_t
    (safe_lshift_func_uint64_t_u_u)(uint64_t left, unsigned int right)
    {
      return
    
        ((((unsigned int)right) >= 32) || (left > ((18446744073709551615ULL) >> ((unsigned int)right)))) ?
        ((left)) :
    
        (left << ((unsigned int)right));
    }
    
    static uint64_t
    (safe_rshift_func_uint64_t_u_s)(uint64_t left, int right)
    {
      return
    
        ((((int)right) < 0) || (((int)right) >= 32)) ?
        ((left)) :
    
        (left >> ((int)right));
    }
    
    static uint64_t
    (safe_rshift_func_uint64_t_u_u)(uint64_t left, unsigned int right)
    {
      return
    
        (((unsigned int)right) >= 32) ?
        ((left)) :
    
        (left >> ((unsigned int)right));
    }
    # 97 "/mnt/z/csmith/runtime/random_inc.h" 2
    # 11 "foo.c" 2
    
    volatile uint64_t csmith_sink_ = 0;
    
    long __undefined;
    
    
    #pragma pack(push)
    #pragma pack(1)
    struct S0 {
        const uint32_t f0;
        const int64_t f1;
       int64_t f2;
       uint16_t f3;
       int8_t f4;
       int32_t f5;
       int64_t f6;
    };
    #pragma pack(pop)
    
    struct S1 {
       int8_t f0;
        const struct S0 f1;
       uint16_t f2;
       uint32_t f3;
        const uint16_t f4;
       uint8_t f5;
    };
    
    
    int32_t g_2 = 0x2E08974BL;
    int32_t g_37 = 0x5493A50EL;
    int16_t g_46 = 0x8F7DL;
    int16_t g_84 = -9L;
    uint64_t g_106 = 0x400ABD0B17AAFE8ALL;
    uint64_t g_109 = -1L;
    struct S0 g_113 = {0x8590E404L,0xF880E7157E95F642LL,-1L,0L,-1L,-1L,0xAF8E2B3D635D9A7CLL};
    uint8_t g_210 = 0x64L;
    struct S1 g_213 = {1L,{-1L,0xAD3B0C1B5C86E0DFLL,0L,0x0666L,0x6AL,0L,-4L},4L,-10L,0L,0x72L};
    
    
    
     const uint8_t func_1(void);
    int32_t func_12( const uint8_t p_13, struct S1 p_14, int32_t p_15);
    struct S1 func_17(struct S0 p_18, const struct S0 p_19);
    int32_t func_24(uint8_t p_25, int64_t p_26, uint32_t p_27, uint8_t p_28);
    struct S1 func_33(int8_t p_34, uint64_t p_35, uint32_t p_36);
    int32_t func_43(int64_t p_44, struct S0 p_45);
    struct S1 func_48(uint64_t p_49, uint16_t p_50, uint32_t p_51, const int64_t p_52);
    int32_t func_55(uint16_t p_56);
    int32_t func_57(struct S0 p_58, int16_t p_59, int64_t p_60, int32_t p_61, int16_t p_62);
    int32_t func_70(uint16_t p_71, uint32_t p_72, const int8_t p_73);
    # 70 "foo.c"
     const uint8_t func_1(void)
    {
        uint32_t l_334 = 1L;
        int32_t l_336 = 0xA3CD57E0L;
        struct S0 l_337 = {0L,1L,0x27379416BD0946EBLL,0x1DC1L,1L,0xDCEC06D1L,-3L};
        struct S1 l_338 = {0x9FL,{0x4B34C819L,0x009C6021F33E96E9LL,0xBB8A498CEFA681B2LL,-1L,8L,0L,0x760B0DC34B03E5E2LL},0xCA47L,0x7B00D799L,0x9DE0L,0L};
        int32_t l_344 = 0x66E59A3CL;
        for (g_2 = 0; (g_2 < 0); g_2 = safe_add_func_uint16_t_u_u (g_2, 8))
        {
             const uint64_t l_9 = -5L;
            g_2 = g_2;
            for (g_2 = 23; (g_2 <= 23); g_2 = safe_sub_func_uint16_t_u_u (g_2, 1))
            {
                struct S0 l_332 = {0x87A202B6L,0x4AA25C52C26C8E93LL,0x2AEE43E5D3A11EBBLL,0xB34DL,0x86L,0x1F5E1482L,0x5F02E03701D3A4CBLL};
                uint32_t l_333 = 0L;
                int16_t l_335 = 0x880AL;
                l_334 = (safe_rshift_func_int16_t_s_u ((0xA0D461E3L <= ((g_2 || l_9) <= (((g_2 >= g_2) != (l_9 ^ g_2)) == (safe_add_func_uint8_t_u_u (l_9, (g_2 && l_9)))))), func_12(g_2, func_17(l_332, g_213.f1), l_333)));
                g_113.f5 |= g_2;
                g_2 = l_335;
            }
        }
        l_336 |= g_213.f1.f6;
        g_2 = g_213.f4;
        l_344 &= (func_70(g_213.f1.f6, l_336, ((g_210 <= 0L) && func_43(0x93AFC0850A92BA41LL, l_337))) | ((-1L | func_12(g_113.f1, l_338, (safe_add_func_int64_t_s_s ((safe_rshift_func_uint16_t_u_s (g_113.f0, -1L)), g_109)))) <= ((safe_unary_minus_func_uint16_t_u ((!(l_337.f3 && l_338.f1.f0)))) <= l_338.f1.f2)));
        return l_334;
    }
    
    
    
    
    
    
    
    int32_t func_12( const uint8_t p_13, struct S1 p_14, int32_t p_15)
    {
        int64_t l_16 = 0x4C638299FA9EF816LL;
        return l_16;
    }
    
    
    
    
    
    
    
    struct S1 func_17(struct S0 p_18, const struct S0 p_19)
    {
        uint16_t l_30 = 0xC048L;
        int32_t l_31 = -1L;
        int32_t l_32 = -1L;
        struct S0 l_47 = {-1L,0xAF746A6ECCD28260LL,5L,1L,1L,0x8558EF10L,-1L};
        uint64_t l_244 = -1L;
        int32_t l_269 = 0x849A9B35L;
        uint16_t l_275 = 0xF17BL;
        uint64_t l_301 = 0L;
        int32_t l_310 = 0L;
        struct S1 l_331 = {-2L,{0L,0x82DA7392BCE64652LL,5L,0x7B0CL,0x8AL,0x2D6ED1DBL,5L},7L,0L,1L,4L};
    lbl_214:
        for (p_18.f5 = 0; (p_18.f5 == 0); p_18.f5 = safe_sub_func_uint32_t_u_u (p_18.f5, 1))
        {
            uint8_t l_23 = 0x41L;
            struct S1 l_39 = {0L,{-2L,0xF3A6950E6E27DFDELL,0xAF792179B1000BAFLL,0L,1L,0L,1L},2L,-1L,-2L,-1L};
            l_32 = ((safe_unary_minus_func_int16_t_s (((p_18.f3 || ((g_2 ^ l_23) < func_24(g_2, l_30, p_19.f1, p_19.f1))) == g_2))) >= l_31);
            if (func_12(g_2, func_33(g_37, 0x8D581CA9286DF497LL, g_2), p_19.f5))
            {
                return l_39;
            }
            else
            {
                uint64_t l_40 = 0xDA6125F89738BBD8LL;
                g_113.f5 = ((func_24(p_18.f2, 0L, (l_39.f1.f4 > g_37), (~l_40)) > g_2) <= func_12((safe_rshift_func_uint8_t_u_u ((~(func_43(p_19.f5, l_47) & (l_39.f1.f0 >= p_19.f3))), 0xF6DE5F43L)), func_48((func_55(g_113.f4) != (g_113.f0 >= p_19.f4)), (func_24((p_18.f4 || l_30), (safe_sub_func_int8_t_s_s (g_2, l_40)), (safe_rshift_func_uint8_t_u_u (l_47.f0, p_18.f3)), g_113.f1) >= 0x11ED2F5AL), (l_40 | func_70(p_19.f5, p_19.f4, p_19.f4)), g_113.f0), g_113.f2));
                g_113.f5 = (safe_rshift_func_uint8_t_u_u (l_40, 0L));
            }
        }
        if (func_24(0xD5L, -1L, (safe_mod_func_int32_t_s_s ((safe_mod_func_int64_t_s_s ((safe_mod_func_uint32_t_u_u (func_55(g_37), -1L)), g_113.f6)), g_2)), ((g_37 == ((0L < (l_32 >= l_47.f5)) & (g_113.f2 == (g_113.f4 <= l_47.f3)))) == g_2)))
        {
            uint8_t l_197 = 0xA4L;
            int64_t l_200 = 9L;
            int32_t l_211 = 0x2605A821L;
            int32_t l_212 = 0x91060841L;
            uint8_t l_222 = -1L;
            if ((((safe_unary_minus_func_int8_t_s (l_47.f0)) == g_84) ^ (safe_lshift_func_uint16_t_u_s ((safe_lshift_func_int16_t_s_s (((g_37 <= p_19.f0) == ((p_18.f2 || l_47.f2) <= (g_113.f6 >= l_197))), -1L)), 0xE5EAE226L))))
            {
                int16_t l_201 = 0xA6DAL;
                for (l_47.f2 = 24; (l_47.f2 <= 5); l_47.f2 = safe_add_func_int16_t_s_s (l_47.f2, 1))
                {
                    p_18.f5 = (+func_57(p_19, 0x1B15L, g_106, l_47.f2, (l_200 != l_201)));
                    l_212 = (safe_rshift_func_int8_t_s_s (func_24(g_113.f5, (safe_mod_func_uint32_t_u_u (0L, ((safe_rshift_func_int8_t_s_s ((safe_sub_func_int32_t_s_s (l_200, g_46)), func_57(g_113, p_19.f2, p_18.f6, g_113.f6, g_210))) || func_12(l_31, func_48(p_19.f4, l_211, p_18.f3, p_19.f2), p_18.f1)))), p_19.f4, p_18.f3), 0xCDBE9B9FL));
                }
                if (p_19.f0)
                    goto lbl_215;
                return g_213;
            }
            else
            {
                if (g_84)
                    goto lbl_214;
    lbl_215:
                l_212 = p_19.f0;
                p_18.f5 = ((p_19.f2 > (-3L && (g_213.f1.f1 < (safe_rshift_func_uint8_t_u_u ((!p_18.f4), 1L))))) ^ g_213.f2);
                for (p_18.f2 = 1; (p_18.f2 != -20); p_18.f2 = safe_add_func_int32_t_s_s (p_18.f2, 1))
                {
                    return g_213;
                }
            }
            p_18.f5 = (((l_197 && l_47.f6) >= (safe_div_func_uint64_t_u_u ((l_222 | func_43(g_210, g_113)), (l_47.f2 || (safe_sub_func_uint16_t_u_u ((safe_rshift_func_uint16_t_u_s (p_18.f0, 0x735A5136L)), func_24(g_109, l_47.f6, l_47.f6, g_106))))))) | (l_32 > l_212));
        }
        else
        {
            int32_t l_233 = 0x53D69D35L;
            int32_t l_236 = -10L;
            int32_t l_264 = 1L;
            l_236 |= (safe_rshift_func_int8_t_s_u ((safe_sub_func_uint64_t_u_u ((safe_mod_func_int8_t_s_s (l_233, (safe_lshift_func_int16_t_s_u ((!(l_233 < p_19.f6)), 0xDE1195C0L)))), l_47.f1)), 1L));
            for (g_106 = 0; (g_106 < 0); g_106 = safe_add_func_uint8_t_u_u (g_106, 1))
            {
                if (g_213.f1.f6)
                    break;
            }
            for (l_31 = 16; (l_31 != 0); l_31 = safe_add_func_uint16_t_u_u (l_31, 1))
            {
                uint32_t l_241 = 1L;
                struct S1 l_285 = {-4L,{-9L,-5L,0x671C78C1057D3ECDLL,0xF49DL,0x3DL,0L,0x62C63C90DD8B250BLL},0x2747L,-8L,0x9F68L,0xCEL};
                uint16_t l_290 = -7L;
                uint8_t l_307 = 0x3FL;
                 const int32_t l_313 = -7L;
                int32_t l_314 = -1L;
                 const int16_t l_319 = 0x2776L;
                int16_t l_322 = 0x2062L;
                p_18.f5 = l_241;
                if (g_213.f2)
                    goto lbl_272;
                if ((safe_mul_func_uint8_t_u_u (func_57(g_113, p_18.f1, (func_12(g_113.f1, func_33(g_113.f0, g_213.f1.f3, -4L), g_213.f1.f2) != l_244), l_31, l_241), ((g_213.f0 | p_18.f6) <= (((safe_sub_func_uint8_t_u_u ((safe_mod_func_uint16_t_u_u (g_213.f0, g_210)), l_241)) != p_19.f0) >= l_236)))))
                {
                    int16_t l_256 = 0xA53AL;
                    for (l_244 = 0; (l_244 == -16); l_244 = safe_add_func_int32_t_s_s (l_244, 0))
                    {
                        int64_t l_255 = -2L;
                        uint8_t l_259 = 0L;
                        l_259 = (safe_mod_func_uint32_t_u_u (g_84, func_12(-7L, func_48(func_12((safe_mul_func_uint8_t_u_u ((l_233 && l_255), l_256)), func_48(-1L, g_84, g_213.f1.f5, (p_18.f1 == l_47.f3)), ((p_18.f3 == p_18.f5) < (safe_sub_func_int64_t_s_s (p_19.f2, p_18.f3)))), p_19.f5, (p_18.f0 | l_47.f1), p_19.f3), g_213.f3)));
                    }
                    l_236 = (safe_div_func_uint16_t_u_u ((safe_rshift_func_int8_t_s_u ((func_70(l_47.f4, 0xDF69DBDDL, g_213.f1.f4) == l_264), (safe_mod_func_int32_t_s_s ((2L > l_244), (safe_rshift_func_uint8_t_u_u (((g_37 | g_213.f1.f2) ^ func_24(p_19.f2, l_269, g_109, g_213.f1.f5)), p_18.f1)))))), -1L));
                }
                else
                {
                    for (l_32 = 19; (l_32 >= 0); l_32 = safe_add_func_int64_t_s_s (l_32, 3))
                    {
    lbl_272:
                        l_47.f5 &= 9L;
                        for (l_244 = 0; (l_244 >= 0); l_244 = safe_sub_func_uint64_t_u_u (l_244, 1))
                        {
                            uint32_t l_278 = 0xF827C98EL;
                            l_275 = (l_241 || 0xD67FAE14L);
                            g_113.f5 &= (safe_mod_func_uint32_t_u_u (l_278, (safe_mul_func_int8_t_s_s ((safe_mul_func_uint16_t_u_u (9L, p_18.f1)), l_278))));
                        }
                        if (p_19.f1)
                            continue;
                    }
                    for (l_47.f4 = 0; (l_47.f4 != 15); l_47.f4 = safe_add_func_int8_t_s_s (l_47.f4, 1))
                    {
                        int8_t l_295 = 0x3BL;
                        struct S1 l_306 = {1L,{2L,-5L,0xA5AF9E53DDB62CF2LL,0x5841L,0xFDL,-1L,0x071430AAFB5A1B66LL},8L,0xD675C657L,0x5371L,0L};
                        if (g_109)
                        {
                            return l_285;
                        }
                        else
                        {
                            int16_t l_296 = 0L;
                            l_296 = (safe_add_func_uint64_t_u_u ((safe_lshift_func_int8_t_s_u (8L, 0L)), func_57(g_113, l_290, l_47.f6, p_19.f5, (p_19.f5 && ((safe_div_func_uint16_t_u_u (g_113.f6, func_57(g_113, g_213.f1.f6, g_213.f1.f6, g_113.f4, p_19.f1))) & ((safe_mul_func_int8_t_s_s (p_19.f0, l_285.f1.f6)) != (p_19.f0 > l_295)))))));
                            l_314 = ((safe_div_func_int32_t_s_s (((safe_sub_func_uint32_t_u_u (func_12(p_19.f1, func_33(p_18.f5, l_301, p_19.f1), (safe_rshift_func_uint8_t_u_s (g_213.f1.f0, g_84))), g_213.f4)) != (safe_mul_func_uint8_t_u_u (g_2, (func_12(l_295, l_306, p_19.f6) == (l_285.f1.f2 > l_307))))), g_213.f4)) == ((0x076AC924L & ((safe_lshift_func_uint8_t_u_u (func_43(l_310, p_18), 0x79DBF3E3L)) == (safe_mod_func_uint32_t_u_u ((p_19.f5 <= g_213.f1.f5), (p_19.f1 & l_313))))) || l_47.f3));
                            return g_213;
                        }
                    }
                    g_113.f5 = (0xF705E14EL & func_43(p_18.f6, p_19));
                    l_322 &= (safe_div_func_uint8_t_u_u ((+(+(func_12(g_213.f4, func_33(p_19.f3, l_285.f4, p_19.f6), g_213.f1.f6) ^ func_12((g_113.f2 <= g_113.f6), func_48(g_113.f0, l_307, g_46, p_18.f2), g_213.f2)))), (safe_lshift_func_int16_t_s_u (func_24(p_18.f4, g_113.f3, l_233, (l_319 >= (safe_lshift_func_int16_t_s_u (1L, 0x2F72A917L)))), -1L))));
                }
                l_314 = (safe_sub_func_int32_t_s_s ((safe_mul_func_uint8_t_u_u (l_236, ((safe_rshift_func_uint16_t_u_s (0x27A84E41L, -1L)) == 0x6934789DL))), (safe_mod_func_uint16_t_u_u ((~l_47.f1), p_19.f2))));
            }
        }
        return l_331;
    }
    
    
    
    
    
    
    
    int32_t func_24(uint8_t p_25, int64_t p_26, uint32_t p_27, uint8_t p_28)
    {
        int16_t l_29 = 0L;
        return l_29;
    }
    
    
    
    
    
    
    
    struct S1 func_33(int8_t p_34, uint64_t p_35, uint32_t p_36)
    {
        struct S1 l_38 = {0x8AL,{0L,0x7DD1456014EFC710LL,0x0F1939EFD9132E88LL,6L,4L,-1L,0xC4EA3C9199ED1890LL},0L,-8L,0L,0x96L};
        g_37 = 1L;
        return l_38;
    }
    
    
    
    
    
    
    
    int32_t func_43(int64_t p_44, struct S0 p_45)
    {
        g_46 = p_45.f4;
        return p_45.f0;
    }
    
    
    
    
    
    
    
    struct S1 func_48(uint64_t p_49, uint16_t p_50, uint32_t p_51, const int64_t p_52)
    {
        uint8_t l_53 = 0L;
        struct S1 l_54 = {0x5EL,{7L,2L,-6L,0x32CFL,0x9AL,0xE810F1DDL,8L},0xC4DCL,1L,-7L,-1L};
        l_53 = p_51;
        return l_54;
    }
    
    
    
    
    
    
    
    int32_t func_55(uint16_t p_56)
    {
        struct S0 l_110 = {0x799C725FL,0x692BD29671F1E863LL,0x0918AE1307C177FALL,0x1F08L,0x6BL,0x4EFEA996L,-5L};
        struct S1 l_122 = {0x64L,{0L,-9L,0L,-9L,0L,0L,0x1CB2A3AB4843688BLL},7L,0x79426CD9L,0x451FL,1L};
        int8_t l_137 = -3L;
        uint64_t l_169 = 0L;
        int32_t l_170 = 0x90428BAAL;
        int16_t l_171 = -3L;
        int32_t l_172 = 0L;
        uint32_t l_173 = 0x5E85E3D3L;
        if (func_57(l_110, g_37, (0xB91466E0L > (safe_rshift_func_int8_t_s_u ((func_57(g_113, (safe_div_func_int16_t_s_s (g_113.f0, g_106)), p_56, l_110.f2, 1L) != p_56), 0x9496D93FL))), func_24((safe_div_func_uint16_t_u_u (p_56, (safe_add_func_uint32_t_u_u (l_110.f3, ((safe_div_func_int64_t_s_s (l_110.f0, g_113.f3)) ^ func_12(p_56, l_122, g_113.f2)))))), 3L, g_2, -1L), g_113.f3))
        {
            int64_t l_127 = 0x9261988898D0BA58LL;
            int32_t l_128 = 0xADC2A9FDL;
            int8_t l_158 = 1L;
            uint8_t l_164 = -8L;
    lbl_162:
            for (g_113.f5 = -30; (g_113.f5 < -21); g_113.f5 = safe_sub_func_uint32_t_u_u (g_113.f5, 1))
            {
                uint8_t l_138 = 2L;
                int32_t l_159 = 0x4CE8BB6BL;
                for (l_122.f5 = 0; (l_122.f5 < 0); l_122.f5 = safe_add_func_int8_t_s_s (l_122.f5, 1))
                {
                    return g_113.f4;
                }
                l_128 ^= func_70(l_127, l_122.f2, ((0L <= g_113.f2) || p_56));
                l_110.f5 = (((safe_div_func_uint32_t_u_u (1L, (safe_mul_func_int8_t_s_s ((safe_add_func_int16_t_s_s ((safe_add_func_uint64_t_u_u (l_137, l_138)), 0xF75C09CCL)), ((g_106 == l_110.f5) > (safe_sub_func_uint32_t_u_u (p_56, g_113.f2))))))) || p_56) && (safe_mod_func_uint16_t_u_u ((safe_mul_func_uint16_t_u_u ((((l_138 == l_110.f6) && (g_106 > l_122.f3)) ^ (l_138 >= (l_110.f0 ^ p_56))), (safe_sub_func_uint16_t_u_u ((safe_rshift_func_uint8_t_u_u (func_70(p_56, p_56, g_109), -6L)), 0L)))), (safe_lshift_func_int8_t_s_s ((safe_add_func_int16_t_s_s (l_128, ((safe_add_func_uint32_t_u_u (g_84, l_128)) | (l_128 | g_113.f2)))), 9L)))));
                for (g_106 = 0; (g_106 > 12); g_106 = safe_add_func_uint16_t_u_u (g_106, 2))
                {
                     const int8_t l_157 = 0x50L;
                    l_158 = (l_157 > func_70(g_113.f4, 1L, p_56));
                    l_159 &= 1L;
                    l_110.f5 ^= 0x3237CEF4L;
                }
            }
            if (g_109)
                goto lbl_163;
            for (l_127 = 9; (l_127 > 19); l_127 = safe_sub_func_uint64_t_u_u (l_127, 1))
            {
                if (l_122.f5)
                    goto lbl_162;
            }
    lbl_163:
            l_128 = 0x2AC07F36L;
            l_164 = l_110.f6;
        }
        else
        {
            return l_122.f0;
        }
        g_113.f5 = ((((l_122.f5 && 0x6FDA0F33L) || (~(safe_sub_func_uint8_t_u_u ((l_122.f3 && p_56), (safe_rshift_func_uint8_t_u_s (l_169, l_110.f0)))))) & l_170) < (func_70(l_110.f3, p_56, g_2) & func_70((((l_171 || l_137) && g_106) ^ func_12(g_106, func_48(g_113.f4, p_56, g_113.f5, p_56), g_2)), p_56, l_122.f1.f3)));
        g_113.f5 |= (g_2 != l_172);
        l_172 |= ((func_24(p_56, l_173, l_122.f4, func_12(l_110.f6, func_48(g_113.f3, (g_2 <= g_113.f2), (safe_mod_func_uint64_t_u_u (l_122.f3, l_122.f5)), func_57(l_122.f1, l_122.f1.f6, l_110.f6, l_122.f5, l_110.f2)), 0xA636D355L)) >= (p_56 <= func_24(l_110.f0, (safe_mod_func_uint64_t_u_u (l_137, g_37)), (safe_rshift_func_int16_t_s_s (p_56, g_113.f1)), 0x54L))) ^ g_113.f0);
        return g_37;
    }
    
    
    
    
    
    
    
    int32_t func_57(struct S0 p_58, int16_t p_59, int64_t p_60, int32_t p_61, int16_t p_62)
    {
        uint32_t l_69 = 0x0D6DD574L;
        struct S1 l_83 = {1L,{-1L,0xAE71BBE26AF1C485LL,1L,0L,0L,-10L,0xDEEB808A6355696FLL},0x87C2L,0x977FD266L,0x85BCL,8L};
    lbl_107:
        g_84 = (safe_mul_func_uint8_t_u_u ((safe_div_func_uint8_t_u_u ((safe_sub_func_uint16_t_u_u ((g_2 >= l_69), l_69)), func_70((safe_sub_func_uint32_t_u_u ((safe_sub_func_uint32_t_u_u (func_70(l_69, g_37, g_2), (safe_unary_minus_func_uint16_t_u (g_2)))), ((l_69 | g_37) != (safe_add_func_uint64_t_u_u (p_58.f5, p_60))))), l_69, g_2))), (g_37 && (safe_div_func_uint8_t_u_u ((func_12(p_59, func_48(p_58.f3, p_58.f5, l_69, p_61), -1L) > 0x8863885EL), func_12((func_12(l_69, l_83, l_83.f1.f3) & g_2), func_48(l_83.f1.f3, l_83.f4, g_2, g_2), p_58.f2))))));
        if (p_58.f5)
            goto lbl_102;
    lbl_102:
        for (p_60 = -23; (p_60 >= 28); p_60 = safe_add_func_uint16_t_u_u (p_60, 1))
        {
            uint64_t l_96 = -10L;
            for (p_62 = 0; (p_62 >= -16); p_62 = safe_sub_func_uint32_t_u_u (p_62, 5))
            {
                int32_t l_95 = 8L;
                int32_t l_97 = 0x8C1B616BL;
                for (p_58.f2 = 0; (p_58.f2 != 0); p_58.f2 = safe_add_func_int8_t_s_s (p_58.f2, 1))
                {
                    return p_60;
                }
                l_97 ^= (safe_lshift_func_uint8_t_u_s (((safe_lshift_func_int16_t_s_s ((l_95 & ((p_58.f0 < l_96) != g_2)), 1L)) & l_95), func_70(g_2, l_96, g_84)));
            }
            if (l_83.f4)
                goto lbl_105;
            if (((-1L & ((safe_sub_func_uint8_t_u_u (p_58.f5, func_24(p_61, (l_96 > l_96), (safe_mul_func_uint16_t_u_u (l_83.f1.f4, g_84)), 0L))) | p_58.f0)) > l_96))
            {
                return p_59;
            }
            else
            {
                return l_96;
            }
        }
        for (p_58.f6 = -10; (p_58.f6 > 0); p_58.f6 = safe_sub_func_uint16_t_u_u (p_58.f6, 1))
        {
    lbl_105:
            p_61 = g_37;
            if (g_37)
                goto lbl_108;
            g_106 = p_59;
    lbl_108:
            if (l_83.f2)
                goto lbl_107;
            g_109 = p_60;
        }
        return g_109;
    }
    
    
    
    
    
    
    
    int32_t func_70(uint16_t p_71, uint32_t p_72, const int8_t p_73)
    {
        return g_2;
    }
    
    
    
    
    
    int main (void)
    {
        int print_hash_value = 0;
        platform_main_begin();
        func_1();
        csmith_sink_ = g_2;
        csmith_sink_ = g_37;
        csmith_sink_ = g_46;
        csmith_sink_ = g_84;
        csmith_sink_ = g_106;
        csmith_sink_ = g_109;
        csmith_sink_ = g_113.f0;
        csmith_sink_ = g_113.f1;
        csmith_sink_ = g_113.f2;
        csmith_sink_ = g_113.f3;
        csmith_sink_ = g_113.f4;
        csmith_sink_ = g_113.f5;
        csmith_sink_ = g_113.f6;
        csmith_sink_ = g_210;
        csmith_sink_ = g_213.f0;
        csmith_sink_ = g_213.f1.f0;
        csmith_sink_ = g_213.f1.f1;
        csmith_sink_ = g_213.f1.f2;
        csmith_sink_ = g_213.f1.f3;
        csmith_sink_ = g_213.f1.f4;
        csmith_sink_ = g_213.f1.f5;
        csmith_sink_ = g_213.f1.f6;
        csmith_sink_ = g_213.f2;
        csmith_sink_ = g_213.f3;
        csmith_sink_ = g_213.f4;
        csmith_sink_ = g_213.f5;
        platform_main_end(0);
        return 0;
    }
    
    c file icon foo_pp.c (54,091 bytes) 2011-02-13 05:47 +

-Relationships
+Relationships

-Notes

~0001488

pascal (reporter)

I have re-categorized this as a kernel issue. In presence of the "offsetof" macro, if affects all plug-ins, even if they do not otherwise think about memory in such concrete terms.

If the pack pragma applies to the entire target code, then the solution is simply a matter of defining a new target platform with different alignment parameters. There is a C program that you can compile with the pragma to get a new platform description automatically.

If the pack pragma applies only to some structs inside the target program, then the front-end would have to be deeply modified to accommodate support for the pragma. Considering the workaround above, we will wait until the need is expressed before undertaking these changes.

But yes, a warning would be nice.

~0004799

monate (reporter)

Fix committed to stable/neon branch.
+Notes

-Issue History
Date Modified Username Field Change
2011-02-13 05:47 regehr New Issue
2011-02-13 05:47 regehr Status new => assigned
2011-02-13 05:47 regehr Assigned To => pascal
2011-02-13 05:47 regehr File Added: foo_pp.c
2011-02-13 06:39 pascal Category Plug-in > value analysis => Kernel
2011-02-13 06:39 pascal Product Version Frama-C GIT, precise the release id => Frama-C Carbon-20110201
2011-02-13 06:39 pascal Summary unsoundness due to packed struct in r11868 => unsoundness due to packed structs
2011-02-13 06:47 pascal Note Added: 0001488
2011-05-02 16:24 svn
2011-05-02 16:24 svn Status assigned => resolved
2011-05-02 16:24 svn Resolution open => fixed
2011-10-10 14:13 signoles Fixed in Version => Frama-C Nitrogen-20111001
2011-10-10 14:14 signoles Status resolved => closed
2013-12-19 01:12 svn Source_changeset_attached => framac master 315f9ade
2014-02-12 16:54 monate Source_changeset_attached => framac stable/neon 315f9ade
2014-02-12 16:59 monate Note Added: 0004799
2014-02-12 16:59 monate Assigned To pascal => monate
2014-02-12 16:59 monate Status closed => resolved
+Issue History